diff --git a/.gitignore b/.gitignore index 8cb04e49..612d2b24 100755 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,5 @@ MANIFEST # Per-project virtualenvs .venv*/ -# playground dir -*/_local_scripts/* -.artifacts/ \ No newline at end of file +# GithubActions +.artifacts/ diff --git a/LICENSE.txt b/LICENSE.txt index c022d437..d58bb839 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,25 +1,26 @@ -#Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation -#All rights reserved. +# Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation +# All rights reserved. -#Redistribution and use in source and binary forms, with or without -#modification, are permitted provided that the following conditions are met: +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# * Neither the name of the TU Wien, Department of Geodesy and Geoinformation nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. +# * Neither the name of the TU Wien, Department of Geodesy and +# Geoinformation nor the names of its contributors may be used to endorse +# or promote products derived from this software without specific prior +# written permission. -#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -#DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, -#DEPARTMENT OF GEODESY AND GEOINFORMATION 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. +# 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 VIENNA UNIVERSITY OF TECHNOLOGY, +# DEPARTMENT OF GEODESY AND GEOINFORMATION BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/examples/validation_framework.ipynb b/docs/examples/validation_framework.ipynb index 51b0e0e2..f564c951 100644 --- a/docs/examples/validation_framework.ipynb +++ b/docs/examples/validation_framework.ipynb @@ -14,16 +14,10 @@ "\n", "How does the validation framework work? It makes these assumptions about the used datasets:\n", "\n", - "- The dataset readers that are used have a `read_ts` method that can be called either by a grid point index (gpi)\n", - " which can be any indicator that identifies a certain grid point or by using longitude and latitude. This means that\n", - " both call signatures `read_ts(gpi)` and `read_ts(lon, lat)` must be valid. Please check the\n", - " [pygeobase](https://github.com/TUW-GEO/pygeobase) documentation for more details on how a fully compatible dataset\n", - " class should look. But a simple `read_ts` method should do for the validation framework. This assumption can be\n", - " relaxed by using the `read_ts_names` keyword in the pytesmo.validation_framework.data_manager.DataManager class.\n", - "- The `read_ts` method returns a pandas.DataFrame time series.\n", + "- The dataset readers that are used have a method for reading data (usually called `read`) that can be called either by a grid point index (gpi) which can be any indicator that identifies a certain grid point or by using longitude and latitude. This means that both call signatures `read(gpi)` and `read(lon, lat)` must be valid. Please check the [pygeobase](https://github.com/TUW-GEO/pygeobase) documentation for more details on how a fully compatible dataset class should look. But a simple `read` method should do for the validation framework. This assumption can be relaxed by using the `read_ts_names` keyword in the pytesmo.validation_framework.data_manager.DataManager class.\n", + "- **The reading method returns a pandas.DataFrame time series.**\n", "- Ideally the datasets classes also have a `grid` attribute that is a\n", - " [pygeogrids](http://pygeogrids.readthedocs.org/en/latest/) grid. This makes the calculation of lookup tables easily\n", - " possible and the nearest neighbor search faster.\n", + " [pygeogrids](http://pygeogrids.readthedocs.org/en/latest/) grid. This makes the calculation of lookup tables easily possible and the nearest neighbor search faster.\n", "\n", "Fortunately these assumptions are true about the dataset readers included in pytesmo. \n", "\n", @@ -76,9 +70,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/wpreimes/miniconda3/envs/pytesmo/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], "source": [ "from pathlib import Path\n", "\n", @@ -100,9 +103,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Data is stored in: /tmp/tmpx6j47d8z\n" + ] + } + ], "source": [ "from tempfile import mkdtemp\n", "output_folder = mkdtemp()\n", @@ -121,7 +132,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -153,9 +164,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 33, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/wpreimes/miniconda3/envs/pytesmo/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], "source": [ "ismn_data_folder = testdata_path / \"ismn/multinetwork/header_values\"\n", "\n", @@ -176,9 +196,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 34, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Jobs (gpi, lon, lat):\n", + "[(0, 102.1333, 33.8833), (1, 102.1333, 33.6666), (2, -86.55, 34.783), (3, -97.083, 37.133), (4, -105.417, 34.25), (5, -120.9675, 38.43003), (6, -120.78559, 38.14956), (7, -120.80639, 38.17353)]\n" + ] + } + ], "source": [ "jobs = []\n", "\n", @@ -197,17 +226,40 @@ "source": [ "For this small test dataset it is only one job\n", "\n", - "It is important here that the ISMN reader has a read_ts function that works by just using the `dataset_id`. In this\n", + "It is important here that the ISMN reader has a reading function that works by just using the `dataset_id`. In this\n", " way the validation framework can go through the jobs and read the correct time series." ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ISMN data example:\n", + " soil moisture soil moisture_flag \\\n", + "date_time \n", + "2008-07-01 00:00:00+00:00 0.5 C03 \n", + "2008-07-01 01:00:00+00:00 0.5 C03 \n", + "2008-07-01 02:00:00+00:00 0.5 C03 \n", + "2008-07-01 03:00:00+00:00 0.5 C03 \n", + "2008-07-01 04:00:00+00:00 0.5 C03 \n", + "\n", + " soil moisture_orig_flag \n", + "date_time \n", + "2008-07-01 00:00:00+00:00 M \n", + "2008-07-01 01:00:00+00:00 M \n", + "2008-07-01 02:00:00+00:00 M \n", + "2008-07-01 03:00:00+00:00 M \n", + "2008-07-01 04:00:00+00:00 M \n" + ] + } + ], "source": [ - "data = ismn_reader.read_ts(ids[0])\n", + "data = ismn_reader.read(ids[0])\n", "print('ISMN data example:')\n", "print(data.head())" ] @@ -226,9 +278,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/wpreimes/miniconda3/envs/pytesmo/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], "source": [ "datasets = {\n", " 'ISMN': {\n", @@ -252,16 +313,25 @@ "to use which we have already initialized. The `columns` key describes which columns of the dataset interest us for\n", "validation. This a mandatory field telling the framework which other columns to ignore. In this case the columns\n", "`soil moisture_flag` and `soil moisture_orig_flag` will be ignored by the ISMN reader. We can also specify\n", - "additional keywords that should be given to the `read_ts` method of the dataset reader. In this case we want the\n", + "additional keywords that should be given to the `read` method of the dataset reader. In this case we want the\n", "ASCAT reader to mask the ASCAT soil moisture using the included frozen and snow probabilities as well as the SSF.\n", "There are also other keys that can be used here. Please see the documentation for explanations." ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/validation_framework/validation.py:140: UserWarning: You are using the default temporal matcher. If you are using one of the newer metric calculators (PairwiseIntercomparisonMetrics, TripleCollocationMetrics) you should probably use `make_combined_temporal_matcher` instead. Have a look at the documentation of the metric calculators for more info.\n", + " warnings.warn(\n" + ] + } + ], "source": [ "period = [datetime(2007, 1, 1), datetime(2014, 12, 31)]\n", "basic_metrics = metrics_calculators.BasicMetrics(other_name='k1')\n", @@ -304,9 +374,240 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 38, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([0.237454], dtype=float32),\n", + " 'R': array([0.4996146], dtype=float32),\n", + " 'RMSD': array([11.583476], dtype=float32),\n", + " 'gpi': array([0], dtype=int32),\n", + " 'lat': array([33.8833]),\n", + " 'lon': array([102.1333]),\n", + " 'n_obs': array([357], dtype=int32),\n", + " 'p_R': array([6.127213e-24], dtype=float32),\n", + " 'p_rho': array([2.471651e-28], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.53934574], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([-0.04330891], dtype=float32),\n", + " 'R': array([0.7128256], dtype=float32),\n", + " 'RMSD': array([7.729667], dtype=float32),\n", + " 'gpi': array([1], dtype=int32),\n", + " 'lat': array([33.6666]),\n", + " 'lon': array([102.1333]),\n", + " 'n_obs': array([384], dtype=int32),\n", + " 'p_R': array([0.], dtype=float32),\n", + " 'p_rho': array([0.], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.7002289], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:322: UserWarning: Dropping duplicated indices in reference. This might indicate issues with your data.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([0.21182442], dtype=float32),\n", + " 'R': array([0.6059472], dtype=float32),\n", + " 'RMSD': array([17.441547], dtype=float32),\n", + " 'gpi': array([2], dtype=int32),\n", + " 'lat': array([34.783]),\n", + " 'lon': array([-86.55]),\n", + " 'n_obs': array([1646], dtype=int32),\n", + " 'p_R': array([0.], dtype=float32),\n", + " 'p_rho': array([0.], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.62200236], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:322: UserWarning: Dropping duplicated indices in reference. This might indicate issues with your data.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([0.03179689], dtype=float32),\n", + " 'R': array([0.53915554], dtype=float32),\n", + " 'RMSD': array([21.125721], dtype=float32),\n", + " 'gpi': array([3], dtype=int32),\n", + " 'lat': array([37.133]),\n", + " 'lon': array([-97.083]),\n", + " 'n_obs': array([1875], dtype=int32),\n", + " 'p_R': array([0.], dtype=float32),\n", + " 'p_rho': array([0.], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.53647155], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:322: UserWarning: Dropping duplicated indices in reference. This might indicate issues with your data.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([-0.41247764], dtype=float32),\n", + " 'R': array([0.5056385], dtype=float32),\n", + " 'RMSD': array([14.31557], dtype=float32),\n", + " 'gpi': array([4], dtype=int32),\n", + " 'lat': array([34.25]),\n", + " 'lon': array([-105.417]),\n", + " 'n_obs': array([1915], dtype=int32),\n", + " 'p_R': array([0.], dtype=float32),\n", + " 'p_rho': array([2.86e-42], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.30413666], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:322: UserWarning: Dropping duplicated indices in reference. This might indicate issues with your data.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([-0.6947339], dtype=float32),\n", + " 'R': array([0.7848985], dtype=float32),\n", + " 'RMSD': array([14.187225], dtype=float32),\n", + " 'gpi': array([5], dtype=int32),\n", + " 'lat': array([38.43003]),\n", + " 'lon': array([-120.9675]),\n", + " 'n_obs': array([467], dtype=int32),\n", + " 'p_R': array([0.], dtype=float32),\n", + " 'p_rho': array([0.], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.6740655], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:322: UserWarning: Dropping duplicated indices in reference. This might indicate issues with your data.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([-1.9682411], dtype=float32),\n", + " 'R': array([0.79960084], dtype=float32),\n", + " 'RMSD': array([13.0622425], dtype=float32),\n", + " 'gpi': array([6], dtype=int32),\n", + " 'lat': array([38.14956]),\n", + " 'lon': array([-120.78559]),\n", + " 'n_obs': array([141], dtype=int32),\n", + " 'p_R': array([1.3853822e-32], dtype=float32),\n", + " 'p_rho': array([4.62621e-39], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.8418981], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n", + "{(('ASCAT', 'sm'), ('ISMN', 'soil moisture')): {'BIAS': array([-0.21823417], dtype=float32),\n", + " 'R': array([0.80635566], dtype=float32),\n", + " 'RMSD': array([12.903898], dtype=float32),\n", + " 'gpi': array([7], dtype=int32),\n", + " 'lat': array([38.17353]),\n", + " 'lon': array([-120.80639]),\n", + " 'n_obs': array([251], dtype=int32),\n", + " 'p_R': array([0.], dtype=float32),\n", + " 'p_rho': array([4.e-45], dtype=float32),\n", + " 'p_tau': array([nan], dtype=float32),\n", + " 'rho': array([0.74206454], dtype=float32),\n", + " 'tau': array([nan], dtype=float32)}}\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:304: UserWarning: No timezone given for reference, assuming it's in the same timezone as other, UTC.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/temporal_matching.py:322: UserWarning: Dropping duplicated indices in reference. This might indicate issues with your data.\n", + " warnings.warn(\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/scaling.py:85: DeprecationWarning: Pytesmo method 'pytesmo.scaling.lin_cdf_match' is deprecated and will be removed soon.\n", + " scaling_func(df[series].values, reference.values, **kwargs),\n" + ] + } + ], "source": [ "save_path = output_folder\n", "\n", @@ -335,9 +636,46 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "lon [ 102.1333 102.1333 -86.55 -97.083 -105.417 -120.9675\n", + " -120.78559 -120.80639]\n", + "lat [33.8833 33.6666 34.783 37.133 34.25 38.43003 38.14956 38.17353]\n", + "idx [0 1 2 3 4 5 6 7]\n", + "_row_size [0 0 0 0 0 0 0 0]\n", + "time []\n", + "gpi [0 1 2 3 4 5 6 7]\n", + "n_obs [ 357 384 1646 1875 1915 467 141 251]\n", + "R [0.4996146 0.7128256 0.6059472 0.53915554 0.5056385 0.7848985\n", + " 0.79960084 0.80635566]\n", + "p_R [6.1272128e-24 0.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00\n", + " 0.0000000e+00 1.3853822e-32 0.0000000e+00]\n", + "rho [0.53934574 0.7002289 0.62200236 0.53647155 0.30413666 0.6740655\n", + " 0.8418981 0.74206454]\n", + "p_rho [2.471651e-28 0.000000e+00 0.000000e+00 0.000000e+00 2.860050e-42\n", + " 0.000000e+00 4.626210e-39 4.203895e-45]\n", + "RMSD [11.583476 7.729667 17.441547 21.125721 14.31557 14.187225\n", + " 13.0622425 12.903898 ]\n", + "BIAS [ 0.237454 -0.04330891 0.21182442 0.03179689 -0.41247764 -0.6947339\n", + " -1.9682411 -0.21823417]\n", + "tau [nan nan nan nan nan nan nan nan]\n", + "p_tau [nan nan nan nan nan nan nan nan]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/wpreimes/miniconda3/envs/pytesmo/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n" + ] + } + ], "source": [ "import netCDF4\n", "results_fname = Path(save_path) / \"ASCAT.sm_with_ISMN.soil moisture.nc\"\n", @@ -358,7 +696,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 40, "metadata": {}, "outputs": [], "source": [ @@ -405,19 +743,41 @@ "### Masking adapter\n", "\n", "To easily transform an existing dataset into a masking dataset `pytesmo` offers a adapter class that calls the\n", - "`read_ts` method of an existing dataset and creates a masking dataset based on an operator, a given threshold, and (optionally) a column name." + "reading method of an existing dataset and creates a masking dataset based on an operator, a given threshold, and (optionally) a column name." ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 41, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " soil moisture\n", + "date_time \n", + "2008-07-01 00:00:00 False\n", + "2008-07-01 01:00:00 False\n", + "2008-07-01 02:00:00 False\n", + "2008-07-01 03:00:00 False\n", + "2008-07-01 04:00:00 False\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/validation_framework/adapters.py:93: UserWarning: Dropping timezone information (UTC) for data from reader ISMN_Interface\n", + " warnings.warn(\n" + ] + } + ], "source": [ "from pytesmo.validation_framework.adapters import MaskingAdapter\n", "\n", "ds_mask = MaskingAdapter(ismn_reader, '<', 0.2, 'soil moisture')\n", - "print(ds_mask.read_ts(ids[0]).head())" + "print(ds_mask.read(ids[0]).head())" ] }, { @@ -425,25 +785,49 @@ "metadata": {}, "source": [ "### Self-masking adapter\n", - "`pytesmo` also has a class that masks a dataset \"on-the-fly\", based on one of the columns it contains and an operator and a threshold. In contrast to the masking adapter mentioned above, the output of the self-masking adapter is the masked data, not the the mask. The self-masking adapter wraps a data reader, which must have a `read_ts` or `read` method. Calling its `read_ts`/`read` method will return the masked data - more precisely a DataFrame with only rows where the masking condition is true." + "`pytesmo` also has a class that masks a dataset \"on-the-fly\", based on one of the columns it contains and an operator and a threshold. In contrast to the masking adapter mentioned above, the output of the self-masking adapter is the masked data, not the the mask. The self-masking adapter wraps a data reader, which must have a `read_ts` or `read` method. Alternatively, to use a method with a name other than `read`/`read_ts`, use the `read_name` keyword which is available for each Adapter - it is still required that the method returns a pandas DataFrame! Calling the reading method will return the masked data - more precisely a DataFrame with only rows where the masking condition is true." ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 42, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " soil moisture soil moisture_flag soil moisture_orig_flag\n", + "date_time \n", + "2008-11-29 09:00:00 0.19 D01,D03 M\n", + "2008-11-29 10:00:00 0.19 D01,D03 M\n", + "2008-11-29 11:00:00 0.19 D01,D03 M\n", + "2008-11-30 03:00:00 0.19 D01,D03 M\n", + "2008-11-30 04:00:00 0.19 D01,D03 M\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/wpreimes/miniconda3/envs/pytesmo/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", + " and should_run_async(code)\n", + "/shares/wpreimes/home/code/pytesmo/src/pytesmo/validation_framework/adapters.py:93: UserWarning: Dropping timezone information (UTC) for data from reader ISMN_Interface\n", + " warnings.warn(\n" + ] + } + ], "source": [ "from pytesmo.validation_framework.adapters import SelfMaskingAdapter\n", "\n", "ds_mask = SelfMaskingAdapter(ismn_reader, '<', 0.2, 'soil moisture')\n", - "print(ds_mask.read_ts(ids[0]).head())" + "print(ds_mask.read(ids[0]).head())" ] } ], "metadata": { "kernelspec": { - "display_name": "Python [conda env:pytesmo]", + "display_name": "Python [conda env:pytesmo] *", "language": "python", "name": "conda-env-pytesmo-py" }, diff --git a/src/pytesmo/colormaps/load_cmap.py b/src/pytesmo/colormaps/load_cmap.py index 55568832..20fce3e1 100755 --- a/src/pytesmo/colormaps/load_cmap.py +++ b/src/pytesmo/colormaps/load_cmap.py @@ -13,55 +13,63 @@ import glob from pytesmo.utils import deprecated -@deprecated + +@deprecated() def colormaps_path(): """Returns application's default path for storing user-defined colormaps""" return os.path.dirname(__file__) -@deprecated + +@deprecated() def get_system_colormaps(): """Returns the list of colormaps that ship with matplotlib""" return [m for m in cm.datad] -@deprecated + +@deprecated() def get_user_colormaps(cmap_fldr=colormaps_path()): - """Returns a list of user-defined colormaps in the specified folder (defaults to - standard colormaps folder if not specified).""" + """Returns a list of user-defined colormaps in the specified folder + (defaults to standard colormaps folder if not specified).""" user_colormaps = [] for root, dirs, files in os.walk(cmap_fldr): - files = glob.glob(root + '/*.cmap') + files = glob.glob(root + "/*.cmap") for name in files: with open(os.path.join(root, name), "r") as fidin: cmap_dict = json.load(fidin) - user_colormaps.append(cmap_dict.get('name', name)) + user_colormaps.append(cmap_dict.get("name", name)) return user_colormaps -@deprecated + +@deprecated() def load_colormap(json_file): """Generates and returns a matplotlib colormap from the specified JSON file, or None if the file was invalid.""" colormap = None with open(json_file, "r") as fidin: cmap_dict = json.load(fidin) - if cmap_dict.get('colors', None) is None: + if cmap_dict.get("colors", None) is None: return colormap - colormap_type = cmap_dict.get('type', 'linear') - colormap_name = cmap_dict.get('name', os.path.basename(json_file)) - if colormap_type == 'linear': - colormap = colors.LinearSegmentedColormap.from_list(name=colormap_name, - colors=cmap_dict['colors']) - elif colormap_type == 'list': - colormap = colors.ListedColormap(name=colormap_name, colors=cmap_dict['colors']) + colormap_type = cmap_dict.get("type", "linear") + colormap_name = cmap_dict.get("name", os.path.basename(json_file)) + if colormap_type == "linear": + colormap = colors.LinearSegmentedColormap.from_list( + name=colormap_name, colors=cmap_dict["colors"] + ) + elif colormap_type == "list": + colormap = colors.ListedColormap( + name=colormap_name, colors=cmap_dict["colors"] + ) return colormap -@deprecated + +@deprecated() def load(cmap_name, cmap_folder=colormaps_path()): """Returns the matplotlib colormap of the specified name - if not found in the predefined colormaps, searches for the colormap in the specified folder (defaults to standard colormaps folder if not specified).""" - cmap_name_user = cmap_name + '.cmap' + cmap_name_user = cmap_name + ".cmap" user_colormaps = get_user_colormaps(cmap_folder) system_colormaps = get_system_colormaps() @@ -71,5 +79,5 @@ def load(cmap_name, cmap_folder=colormaps_path()): elif cmap_name in system_colormaps: return cm.get_cmap(cmap_name) else: - raise ValueError('Colormap not found') - return cmap \ No newline at end of file + raise ValueError("Colormap not found") + return cmap diff --git a/src/pytesmo/df_metrics.py b/src/pytesmo/df_metrics.py index 4bb12c28..330ff7f7 100755 --- a/src/pytesmo/df_metrics.py +++ b/src/pytesmo/df_metrics.py @@ -14,10 +14,10 @@ # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, +# 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 VIENNA UNIVERSITY OF TECHNOLOGY, # DEPARTMENT OF GEODESY AND GEOINFORMATION BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; @@ -67,7 +67,9 @@ def n_combinations(iterable, n, must_include=None, permutations=False): The possible combinations of n elements. """ if must_include: - if (not isinstance(must_include, Iterable)) or isinstance(must_include, str): + if (not isinstance(must_include, Iterable)) or isinstance( + must_include, str + ): must_include = [must_include] if permutations: @@ -111,8 +113,7 @@ def _wrap_metric(metric, symmetric=True, name=None): def wrapped(df): return _dict_to_namedtuple( - nwise_apply(df, metric, n=2, comm=symmetric), - metric_name + nwise_apply(df, metric, n=2, comm=symmetric), metric_name ) # add name and docstring @@ -172,13 +173,15 @@ def mse_decomposition(df): mse, mse_corr, mse_bias, mse_var = nwise_apply( df, metrics.mse_decomposition, n=2, comm=True ) - return (_dict_to_namedtuple(mse, 'MSE'), - _dict_to_namedtuple(mse_corr, 'MSEcorr'), - _dict_to_namedtuple(mse_bias, 'MSEbias'), - _dict_to_namedtuple(mse_var, 'MSEvar')) + return ( + _dict_to_namedtuple(mse, "MSE"), + _dict_to_namedtuple(mse_corr, "MSEcorr"), + _dict_to_namedtuple(mse_bias, "MSEbias"), + _dict_to_namedtuple(mse_var, "MSEvar"), + ) -@deprecated +@deprecated() def mse(df): """ Deprecated: use :py:func:`pytesmo.df_metrics.msd` and the functions for the @@ -201,14 +204,18 @@ def mse(df): pytesmo.metrics.mse """ - MSE, MSEcorr, MSEbias, MSEvar = nwise_apply(df, metrics.mse, n=2, comm=True) - return (_dict_to_namedtuple(MSE, 'MSE'), - _dict_to_namedtuple(MSEcorr, 'MSEcorr'), - _dict_to_namedtuple(MSEbias, 'MSEbias'), - _dict_to_namedtuple(MSEvar, 'MSEvar')) + MSE, MSEcorr, MSEbias, MSEvar = nwise_apply( + df, metrics.mse, n=2, comm=True + ) + return ( + _dict_to_namedtuple(MSE, "MSE"), + _dict_to_namedtuple(MSEcorr, "MSEcorr"), + _dict_to_namedtuple(MSEbias, "MSEbias"), + _dict_to_namedtuple(MSEvar, "MSEvar"), + ) -@deprecated +@deprecated() def tcol_error(df): """ Deprecated: use :py:func:`pytesmo.df_metrics.tcol_metrics` instead. @@ -231,19 +238,21 @@ def tcol_error(df): """ # For TC, the input order has NO effect --> comm=True err0, err1, err2 = nwise_apply(df, metrics.tcol_error, n=3, comm=True) - trips = list(err0.keys()) # triples in all err are equal + trips = list(err0.keys()) # triples in all err are equal assert trips == list(err0.keys()) == list(err1.keys()) == list(err2.keys()) errors = [] for trip in trips: res = [err0[trip], err1[trip], err2[trip]] - Inner = namedtuple('triple_collocation_error', OrderedDict(zip(trip, res))) + Inner = namedtuple( + "triple_collocation_error", OrderedDict(zip(trip, res)) + ) errors.append(Inner(*res)) return tuple(errors) -@deprecated +@deprecated() def tcol_snr(df, ref_ind=0): """DEPRECATED: use `tcol_metrics` instead.""" return tcol_metrics(df, ref_ind=0) @@ -282,18 +291,24 @@ def tcol_metrics(df, ref_ind=0): # the reference. incl = None ref_ind = 0 - snr, err, beta = nwise_apply(df, metrics.tcol_metrics, n=3, comm=True, - must_include=incl, ref_ind=ref_ind) + snr, err, beta = nwise_apply( + df, + metrics.tcol_metrics, + n=3, + comm=True, + must_include=incl, + ref_ind=ref_ind, + ) results = {} - var_dict = {'snr': snr, 'err_std_dev': err, 'beta': beta} + var_dict = {"snr": snr, "err_std_dev": err, "beta": beta} for var_name, var_vals in var_dict.items(): results[var_name] = [] for trip, res in var_vals.items(): Inner = namedtuple(var_name, OrderedDict(zip(trip, res))) results[var_name].append(Inner(*res)) - return (results['snr'], results['err_std_dev'], results['beta']) + return (results["snr"], results["err_std_dev"], results["beta"]) def pearsonr(df): @@ -314,10 +329,9 @@ def pearsonr(df): """ r, p = nwise_apply(df, stats.pearsonr, n=2, comm=True) return ( - _dict_to_namedtuple(r, 'Pearsons_r'), - _dict_to_namedtuple(p, 'p_value') + _dict_to_namedtuple(r, "Pearsons_r"), + _dict_to_namedtuple(p, "p_value"), ) - def spearmanr(df): @@ -338,8 +352,8 @@ def spearmanr(df): """ r, p = nwise_apply(df, stats.spearmanr, n=2, comm=True) return ( - _dict_to_namedtuple(r, 'Spearman_r'), - _dict_to_namedtuple(p, 'p_value') + _dict_to_namedtuple(r, "Spearman_r"), + _dict_to_namedtuple(p, "p_value"), ) @@ -361,8 +375,8 @@ def kendalltau(df): """ r, p = nwise_apply(df, stats.kendalltau, n=2, comm=True) return ( - _dict_to_namedtuple(r, 'Kendall_tau'), - _dict_to_namedtuple(p, 'p_value') + _dict_to_namedtuple(r, "Kendall_tau"), + _dict_to_namedtuple(p, "p_value"), ) @@ -386,7 +400,7 @@ def pairwise_apply(df, method, comm=False): """ warnings.warn( "pairwise_apply() is deprecated, use nwise_apply(..., n=2) instead", - DeprecationWarning + DeprecationWarning, ) numeric_df = df._get_numeric_data() cols = numeric_df.columns @@ -432,8 +446,16 @@ def pairwise_apply(df, method, comm=False): return tuple(return_list) -def nwise_apply(df, method, n=2, comm=False, as_df=False, ds_names=True, - must_include=None, **method_kwargs): +def nwise_apply( + df, + method, + n=2, + comm=False, + as_df=False, + ds_names=True, + must_include=None, + **method_kwargs, +): """ Compute given method for column combinations of a data frame, excluding NA/null values. @@ -493,7 +515,7 @@ def nwise_apply(df, method, n=2, comm=False, as_df=False, ds_names=True, c = applyf(*array_dropna(*[mat[i] for i in range(n)])) for index, value in enumerate(np.atleast_1d(c)): result.append(OrderedDict([(c, np.nan) for c in combs])) - result = np.array(result) # array of OrderedDicts + result = np.array(result) # array of OrderedDicts # each return value result is a dict that gets filled with dicts that have # the cols and keys and the results as values @@ -516,12 +538,13 @@ def nwise_apply(df, method, n=2, comm=False, as_df=False, ds_names=True, if as_df: if n != 2: - raise ValueError('Array structure only available for n=2') + raise ValueError("Array structure only available for n=2") else: if not ds_names: lut_comb_cols = None - result = [_to_df(r, comm=comm, lut_names=lut_comb_cols) - for r in result] + result = [ + _to_df(r, comm=comm, lut_names=lut_comb_cols) for r in result + ] else: if ds_names: formatted_results = [] @@ -559,7 +582,7 @@ def _to_df(result, comm=False, lut_names=None): # find out how large the matrix is imax = max([max(r) for r in list(result.keys())]) # create and fill the matrix - res = np.full((imax+1, imax+1), np.nan) + res = np.full((imax + 1, imax + 1), np.nan) for k, v in result.items(): res[k[::-1]] = v res = res.transpose() @@ -571,8 +594,7 @@ def _to_df(result, comm=False, lut_names=None): if lut_names is not None: res = pd.DataFrame( - data={lut_names[i]: res[:, i] - for i in list(range(max(res.shape)))} + data={lut_names[i]: res[:, i] for i in list(range(max(res.shape)))} ) else: res = pd.DataFrame( @@ -592,7 +614,7 @@ def _dict_to_namedtuple(res_dict, name): values = [] for k, v in res_dict.items(): - names.append('_and_'.join(k)) + names.append("_and_".join(k)) values.append(v) result = namedtuple(name, names) diff --git a/src/pytesmo/metrics/_fast.c b/src/pytesmo/metrics/_fast.c index 2ac5fadb..95e9e828 100644 --- a/src/pytesmo/metrics/_fast.c +++ b/src/pytesmo/metrics/_fast.c @@ -645,7 +645,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "numpy/ufuncobject.h" /* NumPy API declarations from "numpy/__init__.pxd" */ - + #include "numpy/npy_math.h" #include #include "pythread.h" @@ -997,7 +997,7 @@ typedef struct { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. - * + * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t @@ -1005,7 +1005,7 @@ typedef struct { typedef npy_int8 __pyx_t_5numpy_int8_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":691 - * + * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< * ctypedef npy_int32 int32_t @@ -1033,7 +1033,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t - * + * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t @@ -1041,7 +1041,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; typedef npy_uint8 __pyx_t_5numpy_uint8_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":698 - * + * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< * ctypedef npy_uint32 uint32_t @@ -1069,7 +1069,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t - * + * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t * #ctypedef npy_float80 float80_t @@ -1077,7 +1077,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; typedef npy_float32 __pyx_t_5numpy_float32_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":705 - * + * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< * #ctypedef npy_float80 float80_t @@ -1099,7 +1099,7 @@ typedef npy_long __pyx_t_5numpy_int_t; * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< * ctypedef npy_longlong longlong_t - * + * */ typedef npy_longlong __pyx_t_5numpy_long_t; @@ -1107,14 +1107,14 @@ typedef npy_longlong __pyx_t_5numpy_long_t; * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_ulong uint_t */ typedef npy_longlong __pyx_t_5numpy_longlong_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t - * + * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t @@ -1122,11 +1122,11 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; typedef npy_ulong __pyx_t_5numpy_uint_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":719 - * + * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t - * + * */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; @@ -1134,32 +1134,32 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t - * + * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< * ctypedef npy_uintp uintp_t - * + * */ typedef npy_intp __pyx_t_5numpy_intp_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":723 - * + * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_double float_t */ typedef npy_uintp __pyx_t_5numpy_uintp_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t - * + * * ctypedef npy_double float_t # <<<<<<<<<<<<<< * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t @@ -1167,11 +1167,11 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; typedef npy_double __pyx_t_5numpy_float_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":726 - * + * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< * ctypedef npy_longdouble longdouble_t - * + * */ typedef npy_double __pyx_t_5numpy_double_t; @@ -1179,7 +1179,7 @@ typedef npy_double __pyx_t_5numpy_double_t; * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cfloat cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; @@ -1216,7 +1216,7 @@ struct __pyx_memoryviewslice_obj; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t - * + * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t @@ -1224,11 +1224,11 @@ struct __pyx_memoryviewslice_obj; typedef npy_cfloat __pyx_t_5numpy_cfloat_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":730 - * + * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< * ctypedef npy_clongdouble clongdouble_t - * + * */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; @@ -1236,25 +1236,25 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cdouble complex_t */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t - * + * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; /* "View.MemoryView":105 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ struct __pyx_array_obj { @@ -1276,7 +1276,7 @@ struct __pyx_array_obj { /* "View.MemoryView":279 - * + * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< * cdef object name @@ -1289,10 +1289,10 @@ struct __pyx_MemviewEnum_obj { /* "View.MemoryView":330 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ struct __pyx_memoryview_obj { @@ -1312,11 +1312,11 @@ struct __pyx_memoryview_obj { /* "View.MemoryView":965 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ struct __pyx_memoryviewslice_obj { struct __pyx_memoryview_obj __pyx_base; @@ -1329,10 +1329,10 @@ struct __pyx_memoryviewslice_obj { /* "View.MemoryView":105 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ @@ -1343,10 +1343,10 @@ static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; /* "View.MemoryView":330 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ @@ -1363,11 +1363,11 @@ static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; /* "View.MemoryView":965 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ struct __pyx_vtabstruct__memoryviewslice { @@ -2704,8 +2704,8 @@ static PyObject *__pyx_codeobj__34; /* Late includes */ /* "pytesmo/metrics/_fast.pyx":11 - * - * + * + * * cpdef _moments_welford_nd(floating [:,:] X): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -2944,7 +2944,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_5_fast__moments_welford_nd(CYTHON_UN __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) @@ -2953,14 +2953,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_5_fast__moments_welford_nd(CYTHON_UN __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) @@ -3054,16 +3054,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_5_fast__moments_welford_nd(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 11, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -3076,16 +3076,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_5_fast__moments_welford_nd(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 11, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 11, __pyx_L1_error) @@ -3291,7 +3291,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * cdef floating [:,:] C * n = X.shape[0] # <<<<<<<<<<<<<< * d = X.shape[1] - * + * */ __pyx_v_n = (__pyx_v_X.shape[0]); @@ -3299,13 +3299,13 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * cdef floating [:,:] C * n = X.shape[0] * d = X.shape[1] # <<<<<<<<<<<<<< - * + * * if floating is float: */ __pyx_v_d = (__pyx_v_X.shape[1]); /* "pytesmo/metrics/_fast.pyx":37 - * + * * if floating is float: * dtype = np.float32 # <<<<<<<<<<<<<< * else: @@ -3321,7 +3321,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":41 * dtype = np.float64 - * + * * mean = np.zeros(d, dtype=dtype) # <<<<<<<<<<<<<< * oldmean = np.zeros(d, dtype=dtype) * C = np.zeros((d, d), dtype=dtype) @@ -3353,11 +3353,11 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n __pyx_t_5.data = NULL; /* "pytesmo/metrics/_fast.pyx":42 - * + * * mean = np.zeros(d, dtype=dtype) * oldmean = np.zeros(d, dtype=dtype) # <<<<<<<<<<<<<< * C = np.zeros((d, d), dtype=dtype) - * + * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3389,7 +3389,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * mean = np.zeros(d, dtype=dtype) * oldmean = np.zeros(d, dtype=dtype) * C = np.zeros((d, d), dtype=dtype) # <<<<<<<<<<<<<< - * + * * nobs = 0 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) @@ -3430,7 +3430,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":45 * C = np.zeros((d, d), dtype=dtype) - * + * * nobs = 0 # <<<<<<<<<<<<<< * for i in range(n): * nobs += 1 @@ -3438,7 +3438,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n __pyx_v_nobs = 0.0; /* "pytesmo/metrics/_fast.pyx":46 - * + * * nobs = 0 * for i in range(n): # <<<<<<<<<<<<<< * nobs += 1 @@ -3499,7 +3499,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * mean[j] += (X[i, j] - mean[j]) / nobs * for k in range(j, d): # <<<<<<<<<<<<<< * C[j, k] += (X[i, j] - mean[j]) * (X[i, k] - mean[k]) - * + * */ __pyx_t_17 = __pyx_v_d; __pyx_t_18 = __pyx_t_17; @@ -3510,7 +3510,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * mean[j] += (X[i, j] - mean[j]) / nobs * for k in range(j, d): * C[j, k] += (X[i, j] - mean[j]) * (X[i, k] - mean[k]) # <<<<<<<<<<<<<< - * + * * for j in range(d): */ __pyx_t_15 = __pyx_v_i; @@ -3528,7 +3528,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":54 * C[j, k] += (X[i, j] - mean[j]) * (X[i, k] - mean[k]) - * + * * for j in range(d): # <<<<<<<<<<<<<< * for k in range(j, d): * # divide C by nobs to get covariance @@ -3539,7 +3539,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n __pyx_v_j = __pyx_t_9; /* "pytesmo/metrics/_fast.pyx":55 - * + * * for j in range(d): * for k in range(j, d): # <<<<<<<<<<<<<< * # divide C by nobs to get covariance @@ -3566,7 +3566,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * # populate lower half of C * if k != j: # <<<<<<<<<<<<<< * C[k, j] = C[j, k] - * + * */ __pyx_t_24 = ((__pyx_v_k != __pyx_v_j) != 0); if (__pyx_t_24) { @@ -3575,7 +3575,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * # populate lower half of C * if k != j: * C[k, j] = C[j, k] # <<<<<<<<<<<<<< - * + * * return mean, C */ __pyx_t_20 = __pyx_v_j; @@ -3589,7 +3589,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * # populate lower half of C * if k != j: # <<<<<<<<<<<<<< * C[k, j] = C[j, k] - * + * */ } } @@ -3597,7 +3597,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":62 * C[k, j] = C[j, k] - * + * * return mean, C # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); @@ -3618,8 +3618,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n goto __pyx_L0; /* "pytesmo/metrics/_fast.pyx":11 - * - * + * + * * cpdef _moments_welford_nd(floating [:,:] X): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -3749,7 +3749,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * cdef floating [:,:] C * n = X.shape[0] # <<<<<<<<<<<<<< * d = X.shape[1] - * + * */ __pyx_v_n = (__pyx_v_X.shape[0]); @@ -3757,7 +3757,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * cdef floating [:,:] C * n = X.shape[0] * d = X.shape[1] # <<<<<<<<<<<<<< - * + * * if floating is float: */ __pyx_v_d = (__pyx_v_X.shape[1]); @@ -3766,7 +3766,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * dtype = np.float32 * else: * dtype = np.float64 # <<<<<<<<<<<<<< - * + * * mean = np.zeros(d, dtype=dtype) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) @@ -3779,7 +3779,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":41 * dtype = np.float64 - * + * * mean = np.zeros(d, dtype=dtype) # <<<<<<<<<<<<<< * oldmean = np.zeros(d, dtype=dtype) * C = np.zeros((d, d), dtype=dtype) @@ -3811,11 +3811,11 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n __pyx_t_5.data = NULL; /* "pytesmo/metrics/_fast.pyx":42 - * + * * mean = np.zeros(d, dtype=dtype) * oldmean = np.zeros(d, dtype=dtype) # <<<<<<<<<<<<<< * C = np.zeros((d, d), dtype=dtype) - * + * */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3847,7 +3847,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * mean = np.zeros(d, dtype=dtype) * oldmean = np.zeros(d, dtype=dtype) * C = np.zeros((d, d), dtype=dtype) # <<<<<<<<<<<<<< - * + * * nobs = 0 */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) @@ -3888,7 +3888,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":45 * C = np.zeros((d, d), dtype=dtype) - * + * * nobs = 0 # <<<<<<<<<<<<<< * for i in range(n): * nobs += 1 @@ -3896,7 +3896,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n __pyx_v_nobs = 0.0; /* "pytesmo/metrics/_fast.pyx":46 - * + * * nobs = 0 * for i in range(n): # <<<<<<<<<<<<<< * nobs += 1 @@ -3957,7 +3957,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * mean[j] += (X[i, j] - mean[j]) / nobs * for k in range(j, d): # <<<<<<<<<<<<<< * C[j, k] += (X[i, j] - mean[j]) * (X[i, k] - mean[k]) - * + * */ __pyx_t_17 = __pyx_v_d; __pyx_t_18 = __pyx_t_17; @@ -3968,7 +3968,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * mean[j] += (X[i, j] - mean[j]) / nobs * for k in range(j, d): * C[j, k] += (X[i, j] - mean[j]) * (X[i, k] - mean[k]) # <<<<<<<<<<<<<< - * + * * for j in range(d): */ __pyx_t_15 = __pyx_v_i; @@ -3986,7 +3986,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":54 * C[j, k] += (X[i, j] - mean[j]) * (X[i, k] - mean[k]) - * + * * for j in range(d): # <<<<<<<<<<<<<< * for k in range(j, d): * # divide C by nobs to get covariance @@ -3997,7 +3997,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n __pyx_v_j = __pyx_t_9; /* "pytesmo/metrics/_fast.pyx":55 - * + * * for j in range(d): * for k in range(j, d): # <<<<<<<<<<<<<< * # divide C by nobs to get covariance @@ -4024,7 +4024,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * # populate lower half of C * if k != j: # <<<<<<<<<<<<<< * C[k, j] = C[j, k] - * + * */ __pyx_t_24 = ((__pyx_v_k != __pyx_v_j) != 0); if (__pyx_t_24) { @@ -4033,7 +4033,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * # populate lower half of C * if k != j: * C[k, j] = C[j, k] # <<<<<<<<<<<<<< - * + * * return mean, C */ __pyx_t_20 = __pyx_v_j; @@ -4047,7 +4047,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n * # populate lower half of C * if k != j: # <<<<<<<<<<<<<< * C[k, j] = C[j, k] - * + * */ } } @@ -4055,7 +4055,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n /* "pytesmo/metrics/_fast.pyx":62 * C[k, j] = C[j, k] - * + * * return mean, C # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); @@ -4076,8 +4076,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_5_fast__moments_welford_n goto __pyx_L0; /* "pytesmo/metrics/_fast.pyx":11 - * - * + * + * * cpdef _moments_welford_nd(floating [:,:] X): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -4160,10 +4160,10 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_5_fast_4__pyx_fuse_1_moments_welford /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { @@ -4176,10 +4176,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":736 - * + * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); @@ -4191,10 +4191,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ /* function exit code */ @@ -4210,10 +4210,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { @@ -4226,10 +4226,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":739 - * + * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); @@ -4241,10 +4241,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ /* function exit code */ @@ -4260,10 +4260,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { @@ -4276,10 +4276,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":742 - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); @@ -4291,10 +4291,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ /* function exit code */ @@ -4310,10 +4310,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { @@ -4326,10 +4326,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":745 - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); @@ -4341,10 +4341,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ /* function exit code */ @@ -4360,10 +4360,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { @@ -4376,10 +4376,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":748 - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); @@ -4391,10 +4391,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ /* function exit code */ @@ -4410,7 +4410,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -4423,7 +4423,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":751 - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -4445,7 +4445,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":751 - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -4457,8 +4457,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< - * - * + * + * */ /*else*/ { __Pyx_XDECREF(__pyx_r); @@ -4469,7 +4469,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -4484,7 +4484,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -4495,11 +4495,11 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannySetupContext("set_array_base", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":932 - * + * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< * PyArray_SetBaseObject(arr, base) - * + * */ Py_INCREF(__pyx_v_base); @@ -4507,14 +4507,14 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * + * * cdef inline object get_array_base(ndarray arr): */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -4526,7 +4526,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -4540,7 +4540,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannySetupContext("get_array_base", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":936 - * + * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< * if base is NULL: @@ -4563,7 +4563,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py * if base is NULL: * return None # <<<<<<<<<<<<<< * return base - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4582,7 +4582,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py * if base is NULL: * return None * return base # <<<<<<<<<<<<<< - * + * * # Versions of the import_* functions which are more suitable for */ __Pyx_XDECREF(__pyx_r); @@ -4592,7 +4592,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -4673,7 +4673,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { * __pyx_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) { @@ -4687,7 +4687,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { * __pyx_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__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 947, __pyx_L5_except_error) @@ -4739,7 +4739,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -4762,7 +4762,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_RefNannySetupContext("import_umath", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4787,7 +4787,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 951, __pyx_L3_error) /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4805,7 +4805,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { * _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) { @@ -4819,7 +4819,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { * _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__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 953, __pyx_L5_except_error) @@ -4832,7 +4832,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L5_except_error:; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4848,7 +4848,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -4871,7 +4871,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -4894,7 +4894,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_RefNannySetupContext("import_ufunc", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4919,7 +4919,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L3_error) /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4937,7 +4937,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { * _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) { @@ -4951,7 +4951,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef extern from *: */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 959, __pyx_L5_except_error) @@ -4964,7 +4964,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L5_except_error:; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -4980,7 +4980,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -5002,8 +5002,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":969 - * - * + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -5018,15 +5018,15 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":969 - * - * + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -5039,8 +5039,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":984 - * - * + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -5055,15 +5055,15 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":984 - * - * + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -5076,8 +5076,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":999 - * - * + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -5090,15 +5090,15 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":999 - * - * + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -5110,8 +5110,8 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1009 - * - * + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -5124,15 +5124,15 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1009 - * - * + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -5144,8 +5144,8 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1016 - * - * + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -5163,8 +5163,8 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1016 - * - * + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -5177,10 +5177,10 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* Python wrapper */ @@ -5273,10 +5273,10 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } else { /* "View.MemoryView":123 - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< - * + * * cdef int idx */ __pyx_v_allocate_buffer = ((int)1); @@ -5298,10 +5298,10 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* function exit code */ @@ -5340,10 +5340,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":129 * cdef PyObject **p - * + * * self.ndim = len(shape) # <<<<<<<<<<<<<< * self.itemsize = itemsize - * + * */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); @@ -5353,29 +5353,29 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":130 - * + * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< - * + * * if not self.ndim: */ __pyx_v_self->itemsize = __pyx_v_itemsize; /* "View.MemoryView":132 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":133 - * + * * 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__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error) @@ -5386,28 +5386,28 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":132 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ } /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":136 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error) @@ -5418,26 +5418,26 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ } /* "View.MemoryView":138 * 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_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_2 = PyBytes_Check(__pyx_v_format); __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { /* "View.MemoryView":139 - * + * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string @@ -5465,7 +5465,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":138 * 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 @@ -5477,7 +5477,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * 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_ERR(2, 140, __pyx_L1_error) __pyx_t_3 = __pyx_v_format; @@ -5492,8 +5492,8 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< - * - * + * + * */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); @@ -5503,39 +5503,39 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->format = __pyx_t_7; /* "View.MemoryView":144 - * - * + * + * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< * self._strides = self._shape + self.ndim - * + * */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); /* "View.MemoryView":145 - * + * * self._shape = 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":147 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":148 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5545,16 +5545,16 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":147 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ } /* "View.MemoryView":151 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -5576,7 +5576,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_8 = (__pyx_t_8 + 1); /* "View.MemoryView":152 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -5590,7 +5590,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim - * + * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -5615,7 +5615,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __PYX_ERR(2, 153, __pyx_L1_error) /* "View.MemoryView":152 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -5627,14 +5627,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< - * + * * cdef char order */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; /* "View.MemoryView":151 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -5643,7 +5643,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":157 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' @@ -5675,7 +5675,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->mode = __pyx_n_u_fortran; /* "View.MemoryView":157 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' @@ -5730,7 +5730,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * 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, */ /*else*/ { @@ -5747,16 +5747,16 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":166 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) - * + * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< * itemsize, self.ndim, order) - * + * */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); /* "View.MemoryView":169 * itemsize, self.ndim, order) - * + * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< * self.dtype_is_object = format == b'O' * if allocate_buffer: @@ -5764,11 +5764,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->free_data = __pyx_v_allocate_buffer; /* "View.MemoryView":170 - * + * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: - * + * */ __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error) @@ -5779,15 +5779,15 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_4 = (__pyx_v_allocate_buffer != 0); if (__pyx_t_4) { /* "View.MemoryView":174 - * - * + * + * * self.data = malloc(self.len) # <<<<<<<<<<<<<< * if not self.data: * raise MemoryError("unable to allocate array data.") @@ -5795,11 +5795,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); /* "View.MemoryView":175 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); if (unlikely(__pyx_t_4)) { @@ -5808,7 +5808,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error) @@ -5818,17 +5818,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __PYX_ERR(2, 176, __pyx_L1_error) /* "View.MemoryView":175 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ } /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): @@ -5837,7 +5837,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ if (__pyx_t_4) { /* "View.MemoryView":179 - * + * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< * for i in range(self.len / itemsize): @@ -5870,7 +5870,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ (__pyx_v_p[__pyx_v_i]) = Py_None; @@ -5878,7 +5878,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ Py_INCREF(Py_None); @@ -5886,7 +5886,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): @@ -5897,17 +5897,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* function exit code */ @@ -5927,7 +5927,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } /* "View.MemoryView":185 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 @@ -6134,7 +6134,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< * info.readonly = 0 - * + * */ __pyx_t_5 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_5; @@ -6143,14 +6143,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ __pyx_v_info->readonly = 0; /* "View.MemoryView":202 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: @@ -6159,7 +6159,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru if (__pyx_t_1) { /* "View.MemoryView":203 - * + * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< * else: @@ -6170,7 +6170,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":202 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: @@ -6182,7 +6182,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.obj = self */ /*else*/ { @@ -6192,9 +6192,9 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":207 * info.format = NULL - * + * * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); @@ -6204,7 +6204,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":185 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 @@ -6235,7 +6235,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) @@ -6258,7 +6258,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":212 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) @@ -6277,7 +6277,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_v_self->callback_free_data(__pyx_v_self->data); /* "View.MemoryView":212 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) @@ -6329,7 +6329,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< * PyObject_Free(self._shape) - * + * */ free(__pyx_v_self->data); @@ -6347,14 +6347,14 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< - * + * * @property */ PyObject_Free(__pyx_v_self->_shape); /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) @@ -6365,11 +6365,11 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc } /* "View.MemoryView":222 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ /* Python wrapper */ @@ -6398,7 +6398,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< - * + * * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); @@ -6409,11 +6409,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ goto __pyx_L0; /* "View.MemoryView":222 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ /* function exit code */ @@ -6428,7 +6428,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ } /* "View.MemoryView":226 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE @@ -6452,7 +6452,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * 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); @@ -6460,7 +6460,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< - * + * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); @@ -6487,7 +6487,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { goto __pyx_L0; /* "View.MemoryView":226 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE @@ -6509,10 +6509,10 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ /* Python wrapper */ @@ -6534,10 +6534,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":231 - * + * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< - * + * * def __getattr__(self, attr): */ __pyx_r = (__pyx_v_self->_shape[0]); @@ -6545,10 +6545,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ /* function exit code */ @@ -6559,10 +6559,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str /* "View.MemoryView":233 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ /* Python wrapper */ @@ -6589,10 +6589,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( __Pyx_RefNannySetupContext("__getattr__", 0); /* "View.MemoryView":234 - * + * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< - * + * * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); @@ -6607,10 +6607,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( /* "View.MemoryView":233 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ /* function exit code */ @@ -6627,10 +6627,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( /* "View.MemoryView":236 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ /* Python wrapper */ @@ -6657,10 +6657,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":237 - * + * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< - * + * * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); @@ -6675,10 +6675,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ /* "View.MemoryView":236 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ /* function exit code */ @@ -6695,10 +6695,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ /* "View.MemoryView":239 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ /* Python wrapper */ @@ -6724,11 +6724,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc __Pyx_RefNannySetupContext("__setitem__", 0); /* "View.MemoryView":240 - * + * * 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_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6737,10 +6737,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc /* "View.MemoryView":239 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ /* function exit code */ @@ -6869,7 +6869,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct } /* "View.MemoryView":244 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): @@ -6892,7 +6892,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":248 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: @@ -6901,7 +6901,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize if (__pyx_t_1) { /* "View.MemoryView":249 - * + * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: @@ -6935,7 +6935,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":248 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: @@ -6977,7 +6977,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf - * + * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -7001,7 +7001,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< - * + * * return result */ __pyx_v_result->data = __pyx_v_buf; @@ -7010,10 +7010,10 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":255 * result.data = buf - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_result)); @@ -7021,7 +7021,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize goto __pyx_L0; /* "View.MemoryView":244 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): @@ -7141,7 +7141,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ /* Python wrapper */ @@ -7166,7 +7166,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< - * + * * cdef generic = Enum("") */ __Pyx_XDECREF(__pyx_r); @@ -7179,7 +7179,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ /* function exit code */ @@ -7483,7 +7483,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me } /* "View.MemoryView":298 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" @@ -7501,59 +7501,59 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< * cdef size_t offset - * + * */ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); /* "View.MemoryView":304 - * + * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * + * * if offset > 0: */ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); /* "View.MemoryView":306 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ __pyx_t_1 = ((__pyx_v_offset > 0) != 0); if (__pyx_t_1) { /* "View.MemoryView":307 - * + * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< - * + * * return aligned_p */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); /* "View.MemoryView":306 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ } /* "View.MemoryView":309 * aligned_p += alignment - offset - * + * * return aligned_p # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; /* "View.MemoryView":298 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" @@ -7567,7 +7567,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags @@ -7668,7 +7668,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __Pyx_RefNannySetupContext("__cinit__", 0); /* "View.MemoryView":346 - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< * self.flags = flags @@ -7733,7 +7733,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; @@ -7741,7 +7741,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * global __pyx_memoryview_thread_locks_used */ Py_INCREF(Py_None); @@ -7765,7 +7765,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ } /* "View.MemoryView":355 - * + * * 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] @@ -7793,7 +7793,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); /* "View.MemoryView":355 - * + * * 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] @@ -7825,7 +7825,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); if (unlikely(__pyx_t_1)) { @@ -7834,7 +7834,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: * raise MemoryError # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error) @@ -7844,7 +7844,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ } @@ -7859,7 +7859,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":363 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: @@ -7868,7 +7868,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ if (__pyx_t_1) { /* "View.MemoryView":364 - * + * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< * else: @@ -7887,7 +7887,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":363 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: @@ -7899,7 +7899,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * 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*/ { @@ -7909,7 +7909,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":368 * self.dtype_is_object = dtype_is_object - * + * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL @@ -7920,14 +7920,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< - * + * * def __dealloc__(memoryview self): */ __pyx_v_self->typeinfo = NULL; /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags @@ -7946,7 +7946,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":372 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) @@ -7976,7 +7976,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":373 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) @@ -7991,12 +7991,12 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * elif (<__pyx_buffer *> &self.view).obj == Py_None: - * + * */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); /* "View.MemoryView":373 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) @@ -8009,7 +8009,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< - * + * * (<__pyx_buffer *> &self.view).obj = NULL */ __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); @@ -8017,18 +8017,18 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":377 * elif (<__pyx_buffer *> &self.view).obj == Py_None: - * + * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< * Py_DECREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; /* "View.MemoryView":378 - * + * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< - * + * * cdef int i */ Py_DECREF(Py_None); @@ -8037,7 +8037,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< - * + * * (<__pyx_buffer *> &self.view).obj = NULL */ } @@ -8147,7 +8147,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * 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); @@ -8165,7 +8165,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":372 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) @@ -8177,7 +8177,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":393 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf @@ -8205,17 +8205,17 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< - * + * * for dim, idx in enumerate(index): */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); /* "View.MemoryView":397 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { @@ -8263,10 +8263,10 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_t_1 = (__pyx_t_1 + 1); /* "View.MemoryView":398 - * + * * 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_ERR(2, 398, __pyx_L1_error) @@ -8275,27 +8275,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py /* "View.MemoryView":397 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":400 * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * * return itemp # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_itemp; goto __pyx_L0; /* "View.MemoryView":393 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf @@ -8314,8 +8314,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py } /* "View.MemoryView":403 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self @@ -8352,11 +8352,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":404 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); __pyx_t_2 = (__pyx_t_1 != 0); @@ -8366,7 +8366,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< - * + * * have_slices, indices = _unellipsify(index, self.view.ndim) */ __Pyx_XDECREF(__pyx_r); @@ -8375,19 +8375,19 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ goto __pyx_L0; /* "View.MemoryView":404 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ } /* "View.MemoryView":407 * 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_ERR(2, 407, __pyx_L1_error) @@ -8401,8 +8401,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __PYX_ERR(2, 407, __pyx_L1_error) } #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_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 @@ -8421,7 +8421,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_t_5 = 0; /* "View.MemoryView":410 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) @@ -8445,7 +8445,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ goto __pyx_L0; /* "View.MemoryView":410 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) @@ -8458,7 +8458,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< * return self.convert_item_to_object(itemp) - * + * */ /*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 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error) @@ -8468,7 +8468,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< - * + * * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); @@ -8480,8 +8480,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ } /* "View.MemoryView":403 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self @@ -8504,7 +8504,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") @@ -8539,11 +8539,11 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_INCREF(__pyx_v_index); /* "View.MemoryView":417 - * + * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") - * + * */ __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { @@ -8552,7 +8552,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< - * + * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) @@ -8562,19 +8562,19 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __PYX_ERR(2, 418, __pyx_L1_error) /* "View.MemoryView":417 - * + * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") - * + * */ } /* "View.MemoryView":420 * raise TypeError("Cannot assign to read-only memoryview") - * + * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< - * + * * if have_slices: */ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) @@ -8588,8 +8588,8 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __PYX_ERR(2, 420, __pyx_L1_error) } #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_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 @@ -8609,7 +8609,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: @@ -8618,7 +8618,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit if (__pyx_t_1) { /* "View.MemoryView":423 - * + * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: @@ -8683,7 +8683,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: @@ -8695,7 +8695,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< - * + * * cdef is_slice(self, obj): */ /*else*/ { @@ -8707,7 +8707,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") @@ -8732,7 +8732,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":431 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: @@ -8757,13 +8757,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_INCREF(__pyx_v_obj); /* "View.MemoryView":432 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __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) { @@ -8849,7 +8849,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< * return None - * + * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { @@ -8863,7 +8863,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< - * + * * return obj */ __Pyx_XDECREF(__pyx_r); @@ -8898,7 +8898,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ } /* "View.MemoryView":432 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: @@ -8908,9 +8908,9 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":439 * return None - * + * * return obj # <<<<<<<<<<<<<< - * + * * cdef setitem_slice_assignment(self, dst, src): */ __Pyx_XDECREF(__pyx_r); @@ -8920,7 +8920,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":431 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: @@ -8942,7 +8942,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":441 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice @@ -8966,7 +8966,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":445 * 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) @@ -8975,11 +8975,11 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error) /* "View.MemoryView":446 - * + * * 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_ERR(2, 446, __pyx_L1_error) __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error) @@ -8988,7 +8988,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) @@ -9002,7 +9002,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":445 * 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) @@ -9011,7 +9011,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":441 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice @@ -9032,7 +9032,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL @@ -9068,7 +9068,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< * cdef void *item - * + * */ __pyx_v_tmp = NULL; @@ -9076,7 +9076,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< - * + * * if self.view.itemsize > sizeof(array): */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error) @@ -9084,7 +9084,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: @@ -9093,7 +9093,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor if (__pyx_t_2) { /* "View.MemoryView":459 - * + * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< * if tmp == NULL: @@ -9140,7 +9140,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: @@ -9152,7 +9152,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item = tmp * else: * item = array # <<<<<<<<<<<<<< - * + * * try: */ /*else*/ { @@ -9162,7 +9162,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":466 * item = array - * + * * try: # <<<<<<<<<<<<<< * if self.dtype_is_object: * ( item)[0] = value @@ -9170,7 +9170,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /*try:*/ { /* "View.MemoryView":467 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value @@ -9189,7 +9189,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); /* "View.MemoryView":467 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value @@ -9202,8 +9202,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< - * - * + * + * */ /*else*/ { __pyx_t_3 = ((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_3)) __PYX_ERR(2, 470, __pyx_L6_error) @@ -9213,8 +9213,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_L8:; /* "View.MemoryView":474 - * - * + * + * * 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, @@ -9223,7 +9223,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor if (__pyx_t_2) { /* "View.MemoryView":475 - * + * * 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, @@ -9234,8 +9234,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":474 - * - * + * + * * 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, @@ -9256,7 +9256,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< - * + * * cdef setitem_indexed(self, index, value): */ /*finally:*/ { @@ -9301,7 +9301,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL @@ -9322,7 +9322,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":481 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) @@ -9340,11 +9340,11 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ __Pyx_RefNannySetupContext("setitem_indexed", 0); /* "View.MemoryView":482 - * + * * 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 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; @@ -9353,7 +9353,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ * 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_ERR(2, 483, __pyx_L1_error) @@ -9362,7 +9362,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ /* "View.MemoryView":481 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) @@ -9383,7 +9383,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -9416,7 +9416,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem - * + * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9425,7 +9425,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":491 * cdef bytes bytesitem - * + * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) @@ -9436,7 +9436,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -9513,7 +9513,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -9529,7 +9529,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * return result */ /*else:*/ { - __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_10 = strlen(__pyx_v_self->view.format); __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { @@ -9538,7 +9538,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< * return result - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error) @@ -9560,7 +9560,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< - * + * * cdef assign_item_from_object(self, char *itemp, object value): */ __Pyx_XDECREF(__pyx_r); @@ -9613,7 +9613,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_L5_except_error:; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -9634,7 +9634,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -9660,7 +9660,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":501 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -9706,17 +9706,17 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":509 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ - __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "View.MemoryView":510 - * + * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: @@ -9747,7 +9747,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":509 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: @@ -9759,7 +9759,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< - * + * * for i, c in enumerate(bytesvalue): */ /*else*/ { @@ -9822,10 +9822,10 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { @@ -9841,28 +9841,28 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_v_c = (__pyx_t_11[0]); /* "View.MemoryView":515 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ __pyx_v_i = __pyx_t_9; /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ __pyx_t_9 = (__pyx_t_9 + 1); /* "View.MemoryView":515 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; @@ -9871,7 +9871,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":501 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -9898,7 +9898,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie } /* "View.MemoryView":518 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: @@ -9945,7 +9945,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * */ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); if (__pyx_t_2) { @@ -9962,7 +9962,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_ND: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error) @@ -9976,13 +9976,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * */ } /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: @@ -9991,7 +9991,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":523 - * + * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< * else: @@ -10002,7 +10002,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: @@ -10014,7 +10014,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_STRIDES: */ /*else*/ { @@ -10024,7 +10024,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":527 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: @@ -10033,7 +10033,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":528 - * + * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< * else: @@ -10044,7 +10044,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":527 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: @@ -10056,7 +10056,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_INDIRECT: */ /*else*/ { @@ -10066,7 +10066,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":532 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: @@ -10075,7 +10075,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":533 - * + * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< * else: @@ -10086,7 +10086,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":532 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: @@ -10098,7 +10098,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ /*else*/ { @@ -10108,7 +10108,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":537 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: @@ -10117,7 +10117,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":538 - * + * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< * else: @@ -10128,7 +10128,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":537 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: @@ -10140,7 +10140,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.buf = self.view.buf */ /*else*/ { @@ -10150,7 +10150,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":542 * info.format = NULL - * + * * info.buf = self.view.buf # <<<<<<<<<<<<<< * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize @@ -10159,7 +10159,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->buf = __pyx_t_6; /* "View.MemoryView":543 - * + * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< * info.itemsize = self.view.itemsize @@ -10193,7 +10193,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< * info.obj = self - * + * */ __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; @@ -10202,7 +10202,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); @@ -10212,7 +10212,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":518 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: @@ -10242,7 +10242,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } /* "View.MemoryView":553 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) @@ -10291,7 +10291,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * 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 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error) @@ -10299,7 +10299,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10308,7 +10308,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ goto __pyx_L0; /* "View.MemoryView":553 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) @@ -10328,11 +10328,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ } /* "View.MemoryView":559 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ /* Python wrapper */ @@ -10357,7 +10357,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10366,11 +10366,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc goto __pyx_L0; /* "View.MemoryView":559 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ /* function exit code */ @@ -10381,11 +10381,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc } /* "View.MemoryView":563 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ /* Python wrapper */ @@ -10419,7 +10419,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10442,11 +10442,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru goto __pyx_L0; /* "View.MemoryView":563 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ /* function exit code */ @@ -10462,11 +10462,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru } /* "View.MemoryView":567 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ /* Python wrapper */ @@ -10501,7 +10501,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); @@ -10509,9 +10509,9 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st /* "View.MemoryView":570 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * 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_ERR(2, 570, __pyx_L1_error) @@ -10524,16 +10524,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ } /* "View.MemoryView":572 * raise ValueError("Buffer view does not expose strides") - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10556,11 +10556,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st goto __pyx_L0; /* "View.MemoryView":567 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ /* function exit code */ @@ -10576,7 +10576,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st } /* "View.MemoryView":575 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: @@ -10616,7 +10616,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * 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) { @@ -10625,7 +10625,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * 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_XDECREF(__pyx_r); @@ -10643,15 +10643,15 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim - * + * */ } /* "View.MemoryView":579 * return (-1,) * self.view.ndim - * + * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10674,7 +10674,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ goto __pyx_L0; /* "View.MemoryView":575 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: @@ -10694,11 +10694,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ } /* "View.MemoryView":582 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ /* Python wrapper */ @@ -10727,7 +10727,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10738,11 +10738,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc goto __pyx_L0; /* "View.MemoryView":582 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ /* function exit code */ @@ -10757,11 +10757,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc } /* "View.MemoryView":586 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ /* Python wrapper */ @@ -10790,7 +10790,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10801,11 +10801,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s goto __pyx_L0; /* "View.MemoryView":586 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ /* function exit code */ @@ -10820,11 +10820,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s } /* "View.MemoryView":590 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ /* Python wrapper */ @@ -10855,7 +10855,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -10872,11 +10872,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str goto __pyx_L0; /* "View.MemoryView":590 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ /* function exit code */ @@ -10893,7 +10893,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str } /* "View.MemoryView":594 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: @@ -10934,7 +10934,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * 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); @@ -10944,7 +10944,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< - * + * * for length in self.view.shape[:self.view.ndim]: */ __Pyx_INCREF(__pyx_int_1); @@ -10952,10 +10952,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":598 * result = 1 - * + * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< * result *= length - * + * */ __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++) { @@ -10966,10 +10966,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_6 = 0; /* "View.MemoryView":599 - * + * * 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, 599, __pyx_L1_error) @@ -10980,9 +10980,9 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":601 * result *= length - * + * * self._size = result # <<<<<<<<<<<<<< - * + * * return self._size */ __Pyx_INCREF(__pyx_v_result); @@ -10996,15 +10996,15 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 - * + * */ } /* "View.MemoryView":603 * self._size = result - * + * * return self._size # <<<<<<<<<<<<<< - * + * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); @@ -11013,7 +11013,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc goto __pyx_L0; /* "View.MemoryView":594 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: @@ -11035,7 +11035,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":605 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] @@ -11061,11 +11061,11 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":606 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { @@ -11074,26 +11074,26 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< - * + * * return 0 */ __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; /* "View.MemoryView":606 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ } /* "View.MemoryView":609 * return self.view.shape[0] - * + * * return 0 # <<<<<<<<<<<<<< - * + * * def __repr__(self): */ __pyx_r = 0; @@ -11101,7 +11101,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 /* "View.MemoryView":605 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] @@ -11115,7 +11115,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 /* "View.MemoryView":611 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) @@ -11146,11 +11146,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 __Pyx_RefNannySetupContext("__repr__", 0); /* "View.MemoryView":612 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) @@ -11166,18 +11166,18 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< - * + * * def __str__(self): */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "View.MemoryView":612 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11196,7 +11196,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 /* "View.MemoryView":611 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) @@ -11217,10 +11217,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 /* "View.MemoryView":615 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ /* Python wrapper */ @@ -11247,11 +11247,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 __Pyx_RefNannySetupContext("__str__", 0); /* "View.MemoryView":616 - * + * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) @@ -11276,10 +11276,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 /* "View.MemoryView":615 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ /* function exit code */ @@ -11295,8 +11295,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 } /* "View.MemoryView":619 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -11332,7 +11332,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; @@ -11341,7 +11341,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); @@ -11352,8 +11352,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 goto __pyx_L0; /* "View.MemoryView":619 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -11372,7 +11372,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -11408,7 +11408,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; @@ -11417,7 +11417,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def copy(self): */ __Pyx_XDECREF(__pyx_r); @@ -11429,7 +11429,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -11448,7 +11448,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS @@ -11483,14 +11483,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &mslice) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); /* "View.MemoryView":635 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS - * + * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, * self.view.itemsize, @@ -11498,7 +11498,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); /* "View.MemoryView":636 - * + * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, @@ -11509,9 +11509,9 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":641 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< - * + * * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); @@ -11523,7 +11523,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS @@ -11542,7 +11542,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS @@ -11578,14 +11578,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &src) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); /* "View.MemoryView":647 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS - * + * * slice_copy(self, &src) # <<<<<<<<<<<<<< * dst = slice_copy_contig(&src, "fortran", self.view.ndim, * self.view.itemsize, @@ -11593,7 +11593,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); /* "View.MemoryView":648 - * + * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, @@ -11604,10 +11604,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 /* "View.MemoryView":653 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) @@ -11618,7 +11618,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS @@ -11749,7 +11749,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st } /* "View.MemoryView":657 - * + * * @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) @@ -11801,7 +11801,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< * return result - * + * */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; @@ -11809,7 +11809,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_check') */ __Pyx_XDECREF(__pyx_r); @@ -11818,7 +11818,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in goto __pyx_L0; /* "View.MemoryView":657 - * + * * @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) @@ -11840,11 +11840,11 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in } /* "View.MemoryView":663 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { @@ -11857,19 +11857,19 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { * @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, __pyx_memoryview_type); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); __pyx_r = __pyx_t_1; goto __pyx_L0; /* "View.MemoryView":663 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ /* function exit code */ @@ -11880,7 +11880,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { /* "View.MemoryView":666 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with @@ -11919,7 +11919,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: */ - __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_1 = PyTuple_Check(__pyx_v_index); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { @@ -11952,7 +11952,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< - * + * * result = [] */ /*else*/ { @@ -11963,7 +11963,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":676 * tup = index - * + * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False @@ -11974,7 +11974,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_3 = 0; /* "View.MemoryView":677 - * + * * result = [] * have_slices = False # <<<<<<<<<<<<<< * seen_ellipsis = False @@ -12145,10 +12145,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_2 = PySlice_Check(__pyx_v_item); __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_10) { } else { @@ -12164,7 +12164,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error) @@ -12181,16 +12181,16 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * */ } /* "View.MemoryView":691 * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< * result.append(item) - * + * */ __pyx_t_10 = (__pyx_v_have_slices != 0); if (!__pyx_t_10) { @@ -12198,17 +12198,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = __pyx_t_10; goto __pyx_L11_bool_binop_done; } - __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = PySlice_Check(__pyx_v_item); __pyx_t_2 = (__pyx_t_10 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; /* "View.MemoryView":692 - * + * * 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 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) @@ -12228,7 +12228,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":694 * result.append(item) - * + * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) @@ -12237,11 +12237,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":695 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { @@ -12250,7 +12250,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_ERR(2, 696, __pyx_L1_error) @@ -12266,19 +12266,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":695 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ } /* "View.MemoryView":698 * result.extend([slice(None)] * nslices) - * + * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): */ __Pyx_XDECREF(__pyx_r); @@ -12311,7 +12311,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":666 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with @@ -12337,7 +12337,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: @@ -12358,7 +12358,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); /* "View.MemoryView":701 - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: @@ -12374,7 +12374,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { @@ -12383,8 +12383,8 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -12397,14 +12397,14 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ } } /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: @@ -12424,7 +12424,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ } /* "View.MemoryView":710 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim @@ -12478,19 +12478,19 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_suboffset_dim = -1; /* "View.MemoryView":718 - * - * + * + * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< - * + * * cdef _memoryviewslice memviewsliceobj */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); /* "View.MemoryView":722 * cdef _memoryviewslice memviewsliceobj - * + * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ #ifndef CYTHON_WITHOUT_ASSERTIONS @@ -12504,17 +12504,17 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":724 * 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), __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":725 - * + * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice @@ -12537,7 +12537,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":724 * assert memview.view.ndim > 0 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice @@ -12550,7 +12550,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< * p_src = &src - * + * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); @@ -12559,36 +12559,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_p_src = (&__pyx_v_src); } __pyx_L3:; /* "View.MemoryView":735 - * - * + * + * * dst.memview = p_src.memview # <<<<<<<<<<<<<< * dst.data = p_src.data - * + * */ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; /* "View.MemoryView":736 - * + * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; /* "View.MemoryView":741 - * - * + * + * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< * cdef int *p_suboffset_dim = &suboffset_dim * cdef Py_ssize_t start, stop, step @@ -12596,7 +12596,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_p_dst = (&__pyx_v_dst); /* "View.MemoryView":742 - * + * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< * cdef Py_ssize_t start, stop, step @@ -12606,7 +12606,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( @@ -12657,7 +12657,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_6 = (__pyx_t_6 + 1); /* "View.MemoryView":747 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( @@ -12685,7 +12685,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __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 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error) /* "View.MemoryView":747 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( @@ -12779,7 +12779,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -12800,7 +12800,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 762, __pyx_L1_error) @@ -12820,7 +12820,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":764 * 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 @@ -12832,11 +12832,11 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_have_start = __pyx_t_1; /* "View.MemoryView":765 - * + * * 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_ERR(2, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -12848,7 +12848,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 766, __pyx_L1_error) @@ -12859,7 +12859,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":768 * 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, @@ -12870,7 +12870,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); @@ -12879,7 +12879,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( @@ -12889,17 +12889,17 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":776 * 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), __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":777 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, @@ -12926,7 +12926,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) } /* "View.MemoryView":777 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, @@ -12941,7 +12941,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":776 * new_ndim += 1 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, @@ -12953,7 +12953,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) - * + * */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); @@ -12962,8 +12962,8 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -12973,7 +12973,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 782, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); @@ -12982,7 +12982,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } /* "View.MemoryView":710 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim @@ -13004,7 +13004,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } /* "View.MemoryView":807 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, @@ -13024,9 +13024,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":827 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); @@ -13034,7 +13034,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":829 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: @@ -13043,7 +13043,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_1) { /* "View.MemoryView":830 - * + * * if start < 0: * start += shape # <<<<<<<<<<<<<< * if not 0 <= start < shape: @@ -13053,7 +13053,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":829 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: @@ -13079,7 +13079,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * 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, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error) @@ -13094,9 +13094,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":827 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ goto __pyx_L3; @@ -13104,9 +13104,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":835 * else: - * + * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< - * + * * if have_step and step == 0: */ /*else*/ { @@ -13123,10 +13123,10 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":837 * negative_step = have_step != 0 and step < 0 - * + * * if have_step and step == 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) - * + * */ __pyx_t_1 = (__pyx_v_have_step != 0); if (__pyx_t_1) { @@ -13140,26 +13140,26 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":838 - * + * * 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, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error) /* "View.MemoryView":837 * 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) - * + * */ } /* "View.MemoryView":841 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape @@ -13168,7 +13168,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":842 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape @@ -13215,7 +13215,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":842 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape @@ -13286,8 +13286,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L12:; /* "View.MemoryView":841 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape @@ -13329,7 +13329,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< - * + * * if have_stop: */ /*else*/ { @@ -13341,7 +13341,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":857 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape @@ -13350,7 +13350,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":858 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape @@ -13397,7 +13397,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":858 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape @@ -13437,7 +13437,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":857 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape @@ -13479,7 +13479,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< - * + * * if not have_step: */ /*else*/ { @@ -13491,100 +13491,100 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":870 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":871 - * + * * if not have_step: * step = 1 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_step = 1; /* "View.MemoryView":870 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ } /* "View.MemoryView":875 - * + * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< - * + * * if (stop - start) - step * new_shape: */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); /* "View.MemoryView":877 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { /* "View.MemoryView":878 - * + * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< - * + * * if new_shape < 0: */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); /* "View.MemoryView":877 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ } /* "View.MemoryView":880 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":881 - * + * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_new_shape = 0; /* "View.MemoryView":880 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ } /* "View.MemoryView":884 - * - * + * + * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset @@ -13592,11 +13592,11 @@ 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":885 - * + * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< * dst.suboffsets[new_ndim] = suboffset - * + * */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; @@ -13604,16 +13604,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< - * - * + * + * */ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; } __pyx_L3:; /* "View.MemoryView":889 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: @@ -13622,7 +13622,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":890 - * + * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< * else: @@ -13631,8 +13631,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); /* "View.MemoryView":889 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: @@ -13644,7 +13644,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< - * + * * if suboffset >= 0: */ /*else*/ { @@ -13655,7 +13655,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: @@ -13664,7 +13664,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":895 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: @@ -13723,7 +13723,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L26:; /* "View.MemoryView":895 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: @@ -13736,7 +13736,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< - * + * * return 0 */ /*else*/ { @@ -13746,7 +13746,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: @@ -13755,16 +13755,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":904 * suboffset_dim[0] = new_ndim - * + * * return 0 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":807 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, @@ -13788,7 +13788,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":910 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: @@ -13826,14 +13826,14 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< * cdef char *resultp - * + * */ __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":916 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize @@ -13842,7 +13842,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P if (__pyx_t_2) { /* "View.MemoryView":917 - * + * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< * stride = itemsize @@ -13869,7 +13869,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":916 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize @@ -13901,7 +13901,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { @@ -13910,7 +13910,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< - * + * * if index < 0: */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); @@ -13920,7 +13920,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ } } @@ -13928,7 +13928,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: @@ -13937,7 +13937,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P if (__pyx_t_2) { /* "View.MemoryView":926 - * + * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< * if index < 0: @@ -13950,7 +13950,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { @@ -13959,7 +13959,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * 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_ERR(2, 928, __pyx_L1_error) @@ -13979,13 +13979,13 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ } /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: @@ -13994,19 +13994,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":930 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":931 - * + * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * + * * resultp = bufp + index * stride */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) @@ -14023,16 +14023,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":930 * 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":933 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * resultp = bufp + index * stride # <<<<<<<<<<<<<< * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset @@ -14040,11 +14040,11 @@ 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":934 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { @@ -14053,32 +14053,32 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< - * + * * return resultp */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); /* "View.MemoryView":934 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ } /* "View.MemoryView":937 * resultp = ( resultp)[0] + suboffset - * + * * return resultp # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_resultp; goto __pyx_L0; /* "View.MemoryView":910 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: @@ -14097,11 +14097,11 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P } /* "View.MemoryView":943 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { @@ -14128,7 +14128,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< - * + * * cdef Py_ssize_t *shape = memslice.shape */ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; @@ -14136,26 +14136,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":946 * cdef int ndim = memslice.memview.view.ndim - * + * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< * cdef Py_ssize_t *strides = memslice.strides - * + * */ __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; /* "View.MemoryView":947 - * + * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; /* "View.MemoryView":951 - * + * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< * j = ndim - 1 - i @@ -14180,7 +14180,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< * shape[i], shape[j] = shape[j], shape[i] - * + * */ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); @@ -14191,7 +14191,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); @@ -14201,10 +14201,10 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":956 * shape[i], shape[j] = shape[j], shape[i] - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * */ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); if (!__pyx_t_8) { @@ -14218,40 +14218,40 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { if (__pyx_t_7) { /* "View.MemoryView":957 - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< - * + * * return 1 */ __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error) /* "View.MemoryView":956 * 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") - * + * */ } } /* "View.MemoryView":959 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * * return 1 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = 1; goto __pyx_L0; /* "View.MemoryView":943 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ /* function exit code */ @@ -14272,10 +14272,10 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ /* Python wrapper */ @@ -14294,20 +14294,20 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":977 - * + * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< - * + * * cdef convert_item_to_object(self, char *itemp): */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ /* function exit code */ @@ -14316,7 +14316,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) @@ -14333,7 +14333,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor __Pyx_RefNannySetupContext("convert_item_to_object", 0); /* "View.MemoryView":980 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) @@ -14357,7 +14357,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor goto __pyx_L0; /* "View.MemoryView":980 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) @@ -14369,7 +14369,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * 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*/ { @@ -14383,7 +14383,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) @@ -14402,7 +14402,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) @@ -14420,7 +14420,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __Pyx_RefNannySetupContext("assign_item_from_object", 0); /* "View.MemoryView":986 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) @@ -14439,7 +14439,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error) /* "View.MemoryView":986 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) @@ -14452,7 +14452,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< - * + * * @property */ /*else*/ { @@ -14464,7 +14464,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) @@ -14484,11 +14484,11 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo } /* "View.MemoryView":992 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ /* Python wrapper */ @@ -14513,7 +14513,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_XDECREF(__pyx_r); @@ -14522,11 +14522,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ goto __pyx_L0; /* "View.MemoryView":992 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ /* function exit code */ @@ -14650,7 +14650,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS } /* "View.MemoryView":999 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, @@ -14679,20 +14679,20 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1007 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { /* "View.MemoryView":1008 - * + * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -14700,18 +14700,18 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1007 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ } /* "View.MemoryView":1013 - * - * + * + * * 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_ERR(2, 1013, __pyx_L1_error) @@ -14735,28 +14735,28 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1015 * result = _memoryviewslice(None, 0, dtype_is_object) - * + * * result.from_slice = memviewslice # <<<<<<<<<<<<<< * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * */ __pyx_v_result->from_slice = __pyx_v_memviewslice; /* "View.MemoryView":1016 - * + * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< - * + * * result.from_object = ( memviewslice.memview).base */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); /* "View.MemoryView":1018 * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * * result.from_object = ( 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_ERR(2, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14767,10 +14767,10 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_2 = 0; /* "View.MemoryView":1019 - * + * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< - * + * * result.view = memviewslice.memview.view */ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; @@ -14778,7 +14778,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1021 * result.typeinfo = memviewslice.memview.typeinfo - * + * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< * result.view.buf = memviewslice.data * result.view.ndim = ndim @@ -14787,7 +14787,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view = __pyx_t_5; /* "View.MemoryView":1022 - * + * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< * result.view.ndim = ndim @@ -14809,7 +14809,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; @@ -14817,14 +14817,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: */ Py_INCREF(Py_None); /* "View.MemoryView":1027 * Py_INCREF(Py_None) - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: @@ -14833,7 +14833,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl if (__pyx_t_1) { /* "View.MemoryView":1028 - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< * else: @@ -14843,7 +14843,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1027 * Py_INCREF(Py_None) - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: @@ -14855,7 +14855,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< - * + * * result.view.shape = result.from_slice.shape */ /*else*/ { @@ -14865,25 +14865,25 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS_RO - * + * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< * result.view.strides = result.from_slice.strides - * + * */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); /* "View.MemoryView":1033 - * + * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); /* "View.MemoryView":1036 - * - * + * + * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: @@ -14891,7 +14891,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view.suboffsets = NULL; /* "View.MemoryView":1037 - * + * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: @@ -14917,7 +14917,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); @@ -14925,7 +14925,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< - * + * * result.view.len = result.view.itemsize */ goto __pyx_L6_break; @@ -14943,7 +14943,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1042 * break - * + * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< * for length in result.view.shape[:ndim]: * result.view.len *= length @@ -14952,11 +14952,11 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view.len = __pyx_t_9; /* "View.MemoryView":1043 - * + * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< * result.view.len *= length - * + * */ __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++) { @@ -14970,7 +14970,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< - * + * * result.to_object_func = to_object_func */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error) @@ -14985,27 +14985,27 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1046 * result.view.len *= length - * + * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< * result.to_dtype_func = to_dtype_func - * + * */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; /* "View.MemoryView":1047 - * + * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< - * + * * return result */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; /* "View.MemoryView":1049 * result.to_dtype_func = to_dtype_func - * + * * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') */ __Pyx_XDECREF(__pyx_r); @@ -15014,7 +15014,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl goto __pyx_L0; /* "View.MemoryView":999 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, @@ -15036,7 +15036,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } /* "View.MemoryView":1052 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: @@ -15062,7 +15062,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * obj = memview * return &obj.from_slice */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __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) { @@ -15103,7 +15103,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< * return mslice - * + * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); @@ -15112,7 +15112,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_slice_copy') */ __pyx_r = __pyx_v_mslice; @@ -15120,7 +15120,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p } /* "View.MemoryView":1052 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: @@ -15139,7 +15139,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p } /* "View.MemoryView":1063 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim @@ -15161,7 +15161,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem /* "View.MemoryView":1067 * cdef (Py_ssize_t*) shape, strides, suboffsets - * + * * shape = memview.view.shape # <<<<<<<<<<<<<< * strides = memview.view.strides * suboffsets = memview.view.suboffsets @@ -15170,11 +15170,11 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_v_shape = __pyx_t_1; /* "View.MemoryView":1068 - * + * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< * suboffsets = memview.view.suboffsets - * + * */ __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; @@ -15183,7 +15183,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< - * + * * dst.memview = <__pyx_memoryview *> memview */ __pyx_t_1 = __pyx_v_memview->view.suboffsets; @@ -15191,25 +15191,25 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem /* "View.MemoryView":1071 * suboffsets = memview.view.suboffsets - * + * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< * dst.data = memview.view.buf - * + * */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); /* "View.MemoryView":1072 - * + * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< - * + * * for dim in range(memview.view.ndim): */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); /* "View.MemoryView":1074 * dst.data = memview.view.buf - * + * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] @@ -15220,7 +15220,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_v_dim = __pyx_t_4; /* "View.MemoryView":1075 - * + * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< * dst.strides[dim] = strides[dim] @@ -15233,7 +15233,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 - * + * */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); @@ -15241,7 +15241,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object') */ if ((__pyx_v_suboffsets != 0)) { @@ -15253,7 +15253,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem } /* "View.MemoryView":1063 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim @@ -15265,7 +15265,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem } /* "View.MemoryView":1080 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" @@ -15287,7 +15287,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< * return memoryview_copy_from_slice(memview, &memviewslice) - * + * */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); @@ -15295,7 +15295,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); @@ -15306,7 +15306,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx goto __pyx_L0; /* "View.MemoryView":1080 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" @@ -15325,7 +15325,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx } /* "View.MemoryView":1087 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ @@ -15349,17 +15349,17 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1094 * 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), __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":1095 - * + * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func @@ -15380,7 +15380,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1094 * 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 @@ -15393,7 +15393,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL # <<<<<<<<<<<<<< * to_dtype_func = NULL - * + * */ /*else*/ { __pyx_v_to_object_func = NULL; @@ -15402,7 +15402,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, */ __pyx_v_to_dtype_func = NULL; @@ -15411,7 +15411,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1101 * to_dtype_func = NULL - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< * to_object_func, to_dtype_func, * memview.dtype_is_object) @@ -15422,8 +15422,8 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * 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_ERR(2, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -15432,7 +15432,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview goto __pyx_L0; /* "View.MemoryView":1087 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ @@ -15451,8 +15451,8 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview } /* "View.MemoryView":1109 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg @@ -15463,7 +15463,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { int __pyx_t_1; /* "View.MemoryView":1110 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg @@ -15483,7 +15483,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { goto __pyx_L0; /* "View.MemoryView":1110 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg @@ -15495,7 +15495,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { * return -arg * else: * return arg # <<<<<<<<<<<<<< - * + * * @cname('__pyx_get_best_slice_order') */ /*else*/ { @@ -15504,8 +15504,8 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { } /* "View.MemoryView":1109 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg @@ -15517,7 +15517,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { } /* "View.MemoryView":1116 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ @@ -15539,7 +15539,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< * cdef Py_ssize_t f_stride = 0 - * + * */ __pyx_v_c_stride = 0; @@ -15547,14 +15547,14 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ __pyx_v_f_stride = 0; /* "View.MemoryView":1124 * 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] @@ -15563,7 +15563,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1125 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] @@ -15577,7 +15577,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -15585,13 +15585,13 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ goto __pyx_L4_break; /* "View.MemoryView":1125 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] @@ -15603,7 +15603,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1129 * break - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] @@ -15614,7 +15614,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1130 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] @@ -15628,7 +15628,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -15636,13 +15636,13 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ goto __pyx_L7_break; /* "View.MemoryView":1130 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] @@ -15654,7 +15654,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1134 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: @@ -15663,7 +15663,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ if (__pyx_t_2) { /* "View.MemoryView":1135 - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< * else: @@ -15674,7 +15674,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1134 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: @@ -15685,7 +15685,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< - * + * * @cython.cdivision(True) */ /*else*/ { @@ -15694,7 +15694,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } /* "View.MemoryView":1116 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ @@ -15707,7 +15707,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } /* "View.MemoryView":1140 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, @@ -15728,7 +15728,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v Py_ssize_t __pyx_t_6; /* "View.MemoryView":1147 - * + * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_extent = dst_shape[0] @@ -15750,7 +15750,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); @@ -15758,14 +15758,14 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): @@ -15774,7 +15774,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v if (__pyx_t_1) { /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -15809,7 +15809,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_L5_bool_binop_done:; /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -15827,7 +15827,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -15881,7 +15881,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): @@ -15916,7 +15916,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride - * + * */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); @@ -15924,7 +15924,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, */ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); @@ -15933,7 +15933,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_L3:; /* "View.MemoryView":1140 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, @@ -15945,7 +15945,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* "View.MemoryView":1170 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: @@ -15958,13 +15958,13 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< * src.shape, dst.shape, ndim, itemsize) - * + * */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1170 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: @@ -15974,7 +15974,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi } /* "View.MemoryView":1177 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" @@ -15994,7 +15994,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< - * + * * for shape in src.shape[:ndim]: */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; @@ -16002,10 +16002,10 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr /* "View.MemoryView":1181 * cdef Py_ssize_t shape, size = src.memview.view.itemsize - * + * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< * size *= shape - * + * */ __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { @@ -16013,10 +16013,10 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_v_shape = (__pyx_t_2[0]); /* "View.MemoryView":1182 - * + * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< - * + * * return size */ __pyx_v_size = (__pyx_v_size * __pyx_v_shape); @@ -16024,16 +16024,16 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr /* "View.MemoryView":1184 * size *= shape - * + * * return size # <<<<<<<<<<<<<< - * + * * @cname('__pyx_fill_contig_strides_array') */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "View.MemoryView":1177 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" @@ -16046,7 +16046,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr } /* "View.MemoryView":1187 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, @@ -16063,7 +16063,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1196 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride @@ -16072,7 +16072,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ if (__pyx_t_1) { /* "View.MemoryView":1197 - * + * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< * strides[idx] = stride @@ -16104,7 +16104,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1196 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride @@ -16128,7 +16128,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< * stride *= shape[idx] - * + * */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; @@ -16136,7 +16136,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< - * + * * return stride */ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); @@ -16146,16 +16146,16 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1205 * stride *= shape[idx] - * + * * return stride # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_data_to_temp') */ __pyx_r = __pyx_v_stride; goto __pyx_L0; /* "View.MemoryView":1187 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, @@ -16168,7 +16168,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ } /* "View.MemoryView":1208 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, @@ -16193,26 +16193,26 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1219 * cdef void *result - * + * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef size_t size = slice_get_size(src, ndim) - * + * */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1220 - * + * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< - * + * * result = malloc(size) */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); /* "View.MemoryView":1222 * cdef size_t size = slice_get_size(src, ndim) - * + * * result = malloc(size) # <<<<<<<<<<<<<< * if not result: * _err(MemoryError, NULL) @@ -16220,11 +16220,11 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_result = malloc(__pyx_v_size); /* "View.MemoryView":1223 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { @@ -16233,23 +16233,23 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error) /* "View.MemoryView":1223 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ } /* "View.MemoryView":1227 - * - * + * + * * tmpslice.data = result # <<<<<<<<<<<<<< * tmpslice.memview = src.memview * for i in range(ndim): @@ -16257,7 +16257,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_tmpslice->data = ((char *)__pyx_v_result); /* "View.MemoryView":1228 - * + * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< * for i in range(ndim): @@ -16283,7 +16283,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< * tmpslice.suboffsets[i] = -1 - * + * */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); @@ -16291,7 +16291,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * 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]) = -1L; @@ -16299,16 +16299,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1233 * tmpslice.suboffsets[i] = -1 - * + * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< * ndim, order) - * + * */ (void)(__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":1237 - * - * + * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 @@ -16319,11 +16319,11 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1238 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { @@ -16332,24 +16332,24 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< - * + * * if slice_is_contig(src[0], order, ndim): */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; /* "View.MemoryView":1238 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ } } /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: @@ -16358,7 +16358,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, if (__pyx_t_2) { /* "View.MemoryView":1242 - * + * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< * else: @@ -16368,7 +16368,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: @@ -16380,7 +16380,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< - * + * * return result */ /*else*/ { @@ -16390,16 +16390,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1246 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "View.MemoryView":1208 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, @@ -16423,7 +16423,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } /* "View.MemoryView":1251 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: @@ -16449,7 +16449,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent * 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_ERR(2, 1254, __pyx_L1_error) @@ -16475,7 +16475,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent * 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_ERR(2, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -16488,7 +16488,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent __PYX_ERR(2, 1253, __pyx_L1_error) /* "View.MemoryView":1251 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: @@ -16511,11 +16511,11 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent } /* "View.MemoryView":1257 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { @@ -16538,7 +16538,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, * @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_ERR(2, 1258, __pyx_L1_error) @@ -16571,11 +16571,11 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __PYX_ERR(2, 1258, __pyx_L1_error) /* "View.MemoryView":1257 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ /* function exit code */ @@ -16595,7 +16595,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, } /* "View.MemoryView":1261 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: @@ -16672,7 +16672,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_contents') */ /*else*/ { @@ -16681,7 +16681,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { } /* "View.MemoryView":1261 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: @@ -16705,7 +16705,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { } /* "View.MemoryView":1268 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, @@ -16776,13 +16776,13 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice tmp - * + * */ __pyx_v_direct_copy = 0; /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: @@ -16791,7 +16791,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_2) { /* "View.MemoryView":1285 - * + * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< * elif dst_ndim < src_ndim: @@ -16801,7 +16801,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: @@ -16814,7 +16814,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { @@ -16823,7 +16823,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< - * + * * cdef int ndim = max(src_ndim, dst_ndim) */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); @@ -16833,16 +16833,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ } __pyx_L3:; /* "View.MemoryView":1289 * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ __pyx_t_3 = __pyx_v_dst_ndim; @@ -16856,7 +16856,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1291 * cdef int ndim = max(src_ndim, dst_ndim) - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: @@ -16867,7 +16867,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1292 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: @@ -16918,7 +16918,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< - * + * * if src.suboffsets[i] >= 0: */ /*else*/ { @@ -16927,7 +16927,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_L7:; /* "View.MemoryView":1292 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: @@ -16937,38 +16937,38 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":1300 - * + * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< - * + * * if slices_overlap(&src, &dst, ndim, itemsize): */ __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error) /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ } } /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); @@ -16976,73 +16976,73 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1305 - * + * * 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); /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ } /* "View.MemoryView":1307 * order = get_best_order(&dst, ndim) - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp - * + * */ __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; /* "View.MemoryView":1308 - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< - * + * * if not broadcasting: */ __pyx_v_src = __pyx_v_tmp; /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ } /* "View.MemoryView":1310 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1313 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): @@ -17051,7 +17051,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_2) { /* "View.MemoryView":1314 - * + * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< * elif slice_is_contig(src, 'F', ndim): @@ -17060,8 +17060,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); /* "View.MemoryView":1313 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): @@ -17074,7 +17074,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * */ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { @@ -17083,7 +17083,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * 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); @@ -17093,16 +17093,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * 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":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ __pyx_t_2 = (__pyx_v_direct_copy != 0); @@ -17110,7 +17110,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1320 * if direct_copy: - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) @@ -17118,7 +17118,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":1321 - * + * * 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) @@ -17140,7 +17140,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ free(__pyx_v_tmpdata); @@ -17148,7 +17148,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * if order == 'F' == get_best_order(&dst, ndim): */ __pyx_r = 0; @@ -17156,28 +17156,28 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ } /* "View.MemoryView":1310 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":1326 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = (__pyx_v_order == 'F'); if (__pyx_t_2) { @@ -17187,35 +17187,35 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_8) { /* "View.MemoryView":1329 - * - * + * + * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) - * + * */ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error) /* "View.MemoryView":1330 - * + * * 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 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error) /* "View.MemoryView":1326 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":1332 * transpose_memslice(&dst) - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) @@ -17223,11 +17223,11 @@ 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":1333 - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); @@ -17235,32 +17235,32 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * + * * free(tmpdata) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1336 * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ free(__pyx_v_tmpdata); /* "View.MemoryView":1337 - * + * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_broadcast_leading') */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":1268 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, @@ -17284,7 +17284,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } /* "View.MemoryView":1340 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, @@ -17302,14 +17302,14 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); /* "View.MemoryView":1346 * cdef int offset = ndim_other - ndim - * + * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] @@ -17318,7 +17318,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1347 - * + * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< * mslice.strides[i + offset] = mslice.strides[i] @@ -17331,7 +17331,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -17339,7 +17339,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * 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_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); @@ -17347,7 +17347,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic /* "View.MemoryView":1351 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * * for i in range(offset): # <<<<<<<<<<<<<< * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] @@ -17358,7 +17358,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1352 - * + * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< * mslice.strides[i] = mslice.strides[0] @@ -17371,7 +17371,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< * mslice.suboffsets[i] = -1 - * + * */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); @@ -17379,14 +17379,14 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * - * + * + * */ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } /* "View.MemoryView":1340 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, @@ -17397,19 +17397,19 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic } /* "View.MemoryView":1362 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; /* "View.MemoryView":1366 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) @@ -17418,17 +17418,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i if (__pyx_t_1) { /* "View.MemoryView":1367 - * + * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< * dst.strides, ndim, inc) - * + * */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1366 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) @@ -17436,18 +17436,18 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i } /* "View.MemoryView":1362 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ /* function exit code */ } /* "View.MemoryView":1371 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -17465,13 +17465,13 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1371 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -17486,7 +17486,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da } /* "View.MemoryView":1377 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): @@ -17504,7 +17504,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss /* "View.MemoryView":1381 * cdef Py_ssize_t i - * + * * for i in range(shape[0]): # <<<<<<<<<<<<<< * if ndim == 1: * if inc: @@ -17515,7 +17515,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1382 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: @@ -17566,7 +17566,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_L6:; /* "View.MemoryView":1382 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: @@ -17580,7 +17580,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< * ndim - 1, inc) - * + * */ /*else*/ { @@ -17588,7 +17588,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * 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); @@ -17597,16 +17597,16 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss /* "View.MemoryView":1391 * ndim - 1, inc) - * + * * data += strides[0] # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } /* "View.MemoryView":1377 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): @@ -17618,7 +17618,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } /* "View.MemoryView":1397 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, @@ -17649,13 +17649,13 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1397 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, @@ -17666,7 +17666,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst } /* "View.MemoryView":1407 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -17687,7 +17687,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t extent = shape[0] - * + * */ __pyx_v_stride = (__pyx_v_strides[0]); @@ -17695,14 +17695,14 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ __pyx_v_extent = (__pyx_v_shape[0]); /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) @@ -17711,7 +17711,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t if (__pyx_t_1) { /* "View.MemoryView":1415 - * + * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< * memcpy(data, item, itemsize) @@ -17743,7 +17743,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) @@ -17777,8 +17777,8 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } @@ -17786,7 +17786,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_L3:; /* "View.MemoryView":1407 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -19094,8 +19094,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pytesmo/metrics/_fast.pyx":11 - * - * + * + * * cpdef _moments_welford_nd(floating [:,:] X): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -19111,7 +19111,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_umath() except -1: */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 947, __pyx_L1_error) @@ -19122,7 +19122,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_ufunc() except -1: */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 953, __pyx_L1_error) @@ -19130,10 +19130,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__7); /* "View.MemoryView":133 - * + * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * + * * if itemsize <= 0: */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 133, __pyx_L1_error) @@ -19141,10 +19141,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__8); /* "View.MemoryView":136 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 136, __pyx_L1_error) @@ -19152,11 +19152,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__9); /* "View.MemoryView":148 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); @@ -19166,7 +19166,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 176, __pyx_L1_error) @@ -19207,7 +19207,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< - * + * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 418, __pyx_L1_error) @@ -19229,7 +19229,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_ND: */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 520, __pyx_L1_error) @@ -19238,9 +19238,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "View.MemoryView":570 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * 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_ERR(2, 570, __pyx_L1_error) @@ -19251,7 +19251,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * 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__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 577, __pyx_L1_error) @@ -19295,8 +19295,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); @@ -19322,8 +19322,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__25); /* "pytesmo/metrics/_fast.pyx":11 - * - * + * + * * cpdef _moments_welford_nd(floating [:,:] X): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -19335,7 +19335,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "View.MemoryView":286 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") @@ -19345,11 +19345,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__28); /* "View.MemoryView":287 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); @@ -19359,30 +19359,30 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "View.MemoryView":291 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "View.MemoryView":292 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); @@ -19527,7 +19527,7 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else @@ -19812,8 +19812,8 @@ if (!__Pyx_RefNanny) { * from cython cimport floating * from libc.math cimport sqrt, fabs * from scipy.special.cython_special import betainc # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19830,8 +19830,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pytesmo/metrics/_fast.pyx":11 - * - * + * + * * cpdef _moments_welford_nd(floating [:,:] X): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -19869,9 +19869,9 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":209 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * + * * def __dealloc__(array self): */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error) @@ -19882,7 +19882,7 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":286 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") @@ -19895,11 +19895,11 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":287 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19912,8 +19912,8 @@ if (!__Pyx_RefNanny) { * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19923,11 +19923,11 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":291 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19937,11 +19937,11 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":292 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19951,7 +19951,7 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":316 - * + * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ @@ -19978,10 +19978,10 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":549 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19991,10 +19991,10 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":995 * return self.from_object - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -22195,8 +22195,8 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED llx = lla + llb; return PyLong_FromLongLong(llx); #endif - - + + } #endif if (PyFloat_CheckExact(op1)) { diff --git a/src/pytesmo/metrics/_fast_pairwise.c b/src/pytesmo/metrics/_fast_pairwise.c index 3895a5ce..ceb024a7 100644 --- a/src/pytesmo/metrics/_fast_pairwise.c +++ b/src/pytesmo/metrics/_fast_pairwise.c @@ -645,7 +645,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "numpy/ufuncobject.h" /* NumPy API declarations from "numpy/__init__.pxd" */ - + #include "numpy/npy_math.h" #include #include "pythread.h" @@ -997,7 +997,7 @@ typedef struct { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. - * + * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t @@ -1005,7 +1005,7 @@ typedef struct { typedef npy_int8 __pyx_t_5numpy_int8_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":691 - * + * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< * ctypedef npy_int32 int32_t @@ -1033,7 +1033,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t - * + * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t @@ -1041,7 +1041,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; typedef npy_uint8 __pyx_t_5numpy_uint8_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":698 - * + * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< * ctypedef npy_uint32 uint32_t @@ -1069,7 +1069,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t - * + * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t * #ctypedef npy_float80 float80_t @@ -1077,7 +1077,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; typedef npy_float32 __pyx_t_5numpy_float32_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":705 - * + * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< * #ctypedef npy_float80 float80_t @@ -1099,7 +1099,7 @@ typedef npy_long __pyx_t_5numpy_int_t; * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< * ctypedef npy_longlong longlong_t - * + * */ typedef npy_longlong __pyx_t_5numpy_long_t; @@ -1107,14 +1107,14 @@ typedef npy_longlong __pyx_t_5numpy_long_t; * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_ulong uint_t */ typedef npy_longlong __pyx_t_5numpy_longlong_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t - * + * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t @@ -1122,11 +1122,11 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; typedef npy_ulong __pyx_t_5numpy_uint_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":719 - * + * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t - * + * */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; @@ -1134,32 +1134,32 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t - * + * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< * ctypedef npy_uintp uintp_t - * + * */ typedef npy_intp __pyx_t_5numpy_intp_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":723 - * + * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_double float_t */ typedef npy_uintp __pyx_t_5numpy_uintp_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t - * + * * ctypedef npy_double float_t # <<<<<<<<<<<<<< * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t @@ -1167,11 +1167,11 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; typedef npy_double __pyx_t_5numpy_float_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":726 - * + * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< * ctypedef npy_longdouble longdouble_t - * + * */ typedef npy_double __pyx_t_5numpy_double_t; @@ -1179,7 +1179,7 @@ typedef npy_double __pyx_t_5numpy_double_t; * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cfloat cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; @@ -1216,7 +1216,7 @@ struct __pyx_memoryviewslice_obj; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t - * + * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t @@ -1224,11 +1224,11 @@ struct __pyx_memoryviewslice_obj; typedef npy_cfloat __pyx_t_5numpy_cfloat_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":730 - * + * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< * ctypedef npy_clongdouble clongdouble_t - * + * */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; @@ -1236,25 +1236,25 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cdouble complex_t */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t - * + * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; /* "View.MemoryView":105 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ struct __pyx_array_obj { @@ -1276,7 +1276,7 @@ struct __pyx_array_obj { /* "View.MemoryView":279 - * + * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< * cdef object name @@ -1289,10 +1289,10 @@ struct __pyx_MemviewEnum_obj { /* "View.MemoryView":330 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ struct __pyx_memoryview_obj { @@ -1312,11 +1312,11 @@ struct __pyx_memoryview_obj { /* "View.MemoryView":965 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ struct __pyx_memoryviewslice_obj { struct __pyx_memoryview_obj __pyx_base; @@ -1329,10 +1329,10 @@ struct __pyx_memoryviewslice_obj { /* "View.MemoryView":105 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ @@ -1343,10 +1343,10 @@ static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; /* "View.MemoryView":330 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ @@ -1363,11 +1363,11 @@ static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; /* "View.MemoryView":965 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ struct __pyx_vtabstruct__memoryviewslice { @@ -2906,8 +2906,8 @@ static PyObject *__pyx_codeobj__57; /* Late includes */ /* "pytesmo/metrics/_fast_pairwise.pyx":11 - * - * + * + * * cpdef _moments_welford(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -3146,7 +3146,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise__moments_welford(CY __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) @@ -3155,14 +3155,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise__moments_welford(CY __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 11, __pyx_L1_error) @@ -3256,16 +3256,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise__moments_welford(CY __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 11, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -3278,16 +3278,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise__moments_welford(CY __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 11, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 11, __pyx_L1_error) @@ -3480,15 +3480,15 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments * cdef floating mx, my, mxold, myold, M2x, M2y, C * cdef floating nobs * n = len(x) # <<<<<<<<<<<<<< - * + * * mx = my = M2x = M2y = C = 0 */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":32 * n = len(x) - * + * * mx = my = M2x = M2y = C = 0 # <<<<<<<<<<<<<< * nobs = 0 * for i in range(n): @@ -3500,7 +3500,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments __pyx_v_C = 0.0; /* "pytesmo/metrics/_fast_pairwise.pyx":33 - * + * * mx = my = M2x = M2y = C = 0 * nobs = 0 # <<<<<<<<<<<<<< * for i in range(n): @@ -3594,7 +3594,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments * M2y += (y[i] - my) * (y[i] - myold) * C += (x[i] - mx) * (y[i] - myold) # <<<<<<<<<<<<<< * return mx, my, M2x/n, M2y/n, C/n - * + * */ __pyx_t_5 = __pyx_v_i; __pyx_t_6 = __pyx_v_i; @@ -3605,8 +3605,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments * M2y += (y[i] - my) * (y[i] - myold) * C += (x[i] - mx) * (y[i] - myold) * return mx, my, M2x/n, M2y/n, C/n # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_mx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error) @@ -3641,8 +3641,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":11 - * - * + * + * * cpdef _moments_welford(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -3795,15 +3795,15 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments * cdef floating mx, my, mxold, myold, M2x, M2y, C * cdef floating nobs * n = len(x) # <<<<<<<<<<<<<< - * + * * mx = my = M2x = M2y = C = 0 */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":32 * n = len(x) - * + * * mx = my = M2x = M2y = C = 0 # <<<<<<<<<<<<<< * nobs = 0 * for i in range(n): @@ -3815,7 +3815,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments __pyx_v_C = 0.0; /* "pytesmo/metrics/_fast_pairwise.pyx":33 - * + * * mx = my = M2x = M2y = C = 0 * nobs = 0 # <<<<<<<<<<<<<< * for i in range(n): @@ -3909,7 +3909,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments * M2y += (y[i] - my) * (y[i] - myold) * C += (x[i] - mx) * (y[i] - myold) # <<<<<<<<<<<<<< * return mx, my, M2x/n, M2y/n, C/n - * + * */ __pyx_t_5 = __pyx_v_i; __pyx_t_6 = __pyx_v_i; @@ -3920,8 +3920,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments * M2y += (y[i] - my) * (y[i] - myold) * C += (x[i] - mx) * (y[i] - myold) * return mx, my, M2x/n, M2y/n, C/n # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_mx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error) @@ -3956,8 +3956,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":11 - * - * + * + * * cpdef _moments_welford(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -4075,8 +4075,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_28__pyx_fuse_1_mome } /* "pytesmo/metrics/_fast_pairwise.pyx":48 - * - * + * + * * cpdef bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Difference of the mean values. @@ -4315,7 +4315,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_2bias(CYTHON_UNUSED __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error) @@ -4324,14 +4324,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_2bias(CYTHON_UNUSED __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 48, __pyx_L1_error) @@ -4425,16 +4425,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_2bias(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 48, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -4447,16 +4447,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_2bias(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 48, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 48, __pyx_L1_error) @@ -4649,7 +4649,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P * for i in range(n): * b += x[i] - y[i] */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":68 @@ -4669,7 +4669,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P * for i in range(n): * b += x[i] - y[i] # <<<<<<<<<<<<<< * return b / n - * + * */ __pyx_t_5 = __pyx_v_i; __pyx_t_6 = __pyx_v_i; @@ -4680,8 +4680,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P * for i in range(n): * b += x[i] - y[i] * return b / n # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble((__pyx_v_b / ((float)__pyx_v_n))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 70, __pyx_L1_error) @@ -4691,8 +4691,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":48 - * - * + * + * * cpdef bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Difference of the mean values. @@ -4840,7 +4840,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P * for i in range(n): * b += x[i] - y[i] */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":68 @@ -4860,7 +4860,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P * for i in range(n): * b += x[i] - y[i] # <<<<<<<<<<<<<< * return b / n - * + * */ __pyx_t_5 = __pyx_v_i; __pyx_t_6 = __pyx_v_i; @@ -4871,8 +4871,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P * for i in range(n): * b += x[i] - y[i] * return b / n # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble((__pyx_v_b / ((double)__pyx_v_n))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 70, __pyx_L1_error) @@ -4882,8 +4882,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__P goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":48 - * - * + * + * * cpdef bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Difference of the mean values. @@ -4996,8 +4996,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_34__pyx_fuse_1bias( } /* "pytesmo/metrics/_fast_pairwise.pyx":73 - * - * + * + * * cpdef RSS(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Residual sum of squares. @@ -5236,7 +5236,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_4RSS(CYTHON_UNUSED __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) @@ -5245,14 +5245,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_4RSS(CYTHON_UNUSED __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) @@ -5346,16 +5346,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_4RSS(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 73, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -5368,16 +5368,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_4RSS(CYTHON_UNUSED __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 73, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 73, __pyx_L1_error) @@ -5570,7 +5570,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py * for i in range(n): * sum += (x[i] - y[i])**2 */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":92 @@ -5590,7 +5590,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py * for i in range(n): * sum += (x[i] - y[i])**2 # <<<<<<<<<<<<<< * return sum - * + * */ __pyx_t_5 = __pyx_v_i; __pyx_t_6 = __pyx_v_i; @@ -5601,8 +5601,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py * for i in range(n): * sum += (x[i] - y[i])**2 * return sum # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_sum); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error) @@ -5612,8 +5612,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":73 - * - * + * + * * cpdef RSS(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Residual sum of squares. @@ -5761,7 +5761,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py * for i in range(n): * sum += (x[i] - y[i])**2 */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":92 @@ -5781,7 +5781,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py * for i in range(n): * sum += (x[i] - y[i])**2 # <<<<<<<<<<<<<< * return sum - * + * */ __pyx_t_5 = __pyx_v_i; __pyx_t_6 = __pyx_v_i; @@ -5792,8 +5792,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py * for i in range(n): * sum += (x[i] - y[i])**2 * return sum # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyFloat_FromDouble(__pyx_v_sum); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error) @@ -5803,8 +5803,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_RSS(__Py goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":73 - * - * + * + * * cpdef RSS(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Residual sum of squares. @@ -5917,8 +5917,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_40__pyx_fuse_1RSS(C } /* "pytesmo/metrics/_fast_pairwise.pyx":97 - * - * + * + * * cpdef mse_corr(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Correlation component of MSE. @@ -6157,7 +6157,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_6mse_corr(CYTHON_UN __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) @@ -6166,14 +6166,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_6mse_corr(CYTHON_UN __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) @@ -6267,16 +6267,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_6mse_corr(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 97, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -6289,16 +6289,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_6mse_corr(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 97, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 97, __pyx_L1_error) @@ -6488,7 +6488,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) # <<<<<<<<<<<<<< * return _mse_corr_from_moments(mx, my, varx, vary, cov) - * + * */ __pyx_t_1 = __pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments_welford(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6502,17 +6502,17 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - __pyx_t_5 = PyList_GET_ITEM(sequence, 3); - __pyx_t_6 = PyList_GET_ITEM(sequence, 4); + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); @@ -6574,8 +6574,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) * return _mse_corr_from_moments(mx, my, varx, vary, cov) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_corr_from_moments(__pyx_v_mx, __pyx_v_my, __pyx_v_varx, __pyx_v_vary, __pyx_v_cov, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) @@ -6585,8 +6585,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":97 - * - * + * + * * cpdef mse_corr(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Correlation component of MSE. @@ -6737,7 +6737,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) # <<<<<<<<<<<<<< * return _mse_corr_from_moments(mx, my, varx, vary, cov) - * + * */ __pyx_t_1 = __pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments_welford(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6751,17 +6751,17 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - __pyx_t_5 = PyList_GET_ITEM(sequence, 3); - __pyx_t_6 = PyList_GET_ITEM(sequence, 4); + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); @@ -6823,8 +6823,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) * return _mse_corr_from_moments(mx, my, varx, vary, cov) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_corr_from_moments(__pyx_v_mx, __pyx_v_my, __pyx_v_varx, __pyx_v_vary, __pyx_v_cov, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) @@ -6834,8 +6834,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_corr goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":97 - * - * + * + * * cpdef mse_corr(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Correlation component of MSE. @@ -6954,8 +6954,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_46__pyx_fuse_1mse_c } /* "pytesmo/metrics/_fast_pairwise.pyx":132 - * - * + * + * * cpdef _mse_corr_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -7184,7 +7184,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_8_mse_corr_from_mom } __pyx_L6:; while (1) { - __pyx_t_2 = PyFloat_Check(__pyx_v_arg); + __pyx_t_2 = PyFloat_Check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); 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, 132, __pyx_L1_error) @@ -7357,8 +7357,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_cor * floating mx, floating my, floating vx, floating vy, floating cov * ): * return 2 * sqrt(vx) * sqrt(vy) - 2 * cov # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((((2.0 * sqrt(__pyx_v_vx)) * sqrt(__pyx_v_vy)) - (2.0 * __pyx_v_cov))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) @@ -7368,8 +7368,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_cor goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":132 - * - * + * + * * cpdef _mse_corr_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -7525,8 +7525,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_cor * floating mx, floating my, floating vx, floating vy, floating cov * ): * return 2 * sqrt(vx) * sqrt(vy) - 2 * cov # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble((((2.0 * sqrt(__pyx_v_vx)) * sqrt(__pyx_v_vy)) - (2.0 * __pyx_v_cov))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) @@ -7536,8 +7536,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_cor goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":132 - * - * + * + * * cpdef _mse_corr_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -7679,8 +7679,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_52__pyx_fuse_1_mse_ } /* "pytesmo/metrics/_fast_pairwise.pyx":139 - * - * + * + * * cpdef mse_var(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Variance component of MSE. @@ -7919,7 +7919,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_10mse_var(CYTHON_UN __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) @@ -7928,14 +7928,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_10mse_var(CYTHON_UN __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) @@ -8029,16 +8029,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_10mse_var(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 139, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -8051,16 +8051,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_10mse_var(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 139, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 139, __pyx_L1_error) @@ -8250,7 +8250,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) # <<<<<<<<<<<<<< * return _mse_var_from_moments(mx, my, varx, vary, cov) - * + * */ __pyx_t_1 = __pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments_welford(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8264,17 +8264,17 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - __pyx_t_5 = PyList_GET_ITEM(sequence, 3); - __pyx_t_6 = PyList_GET_ITEM(sequence, 4); + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); @@ -8336,8 +8336,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) * return _mse_var_from_moments(mx, my, varx, vary, cov) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_var_from_moments(__pyx_v_mx, __pyx_v_my, __pyx_v_varx, __pyx_v_vary, __pyx_v_cov, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) @@ -8347,8 +8347,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":139 - * - * + * + * * cpdef mse_var(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Variance component of MSE. @@ -8499,7 +8499,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) # <<<<<<<<<<<<<< * return _mse_var_from_moments(mx, my, varx, vary, cov) - * + * */ __pyx_t_1 = __pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments_welford(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8513,17 +8513,17 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - __pyx_t_5 = PyList_GET_ITEM(sequence, 3); - __pyx_t_6 = PyList_GET_ITEM(sequence, 4); + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); @@ -8585,8 +8585,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) * return _mse_var_from_moments(mx, my, varx, vary, cov) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_var_from_moments(__pyx_v_mx, __pyx_v_my, __pyx_v_varx, __pyx_v_vary, __pyx_v_cov, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) @@ -8596,8 +8596,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_var( goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":139 - * - * + * + * * cpdef mse_var(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Variance component of MSE. @@ -8716,8 +8716,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_58__pyx_fuse_1mse_v } /* "pytesmo/metrics/_fast_pairwise.pyx":174 - * - * + * + * * cpdef _mse_var_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -8946,7 +8946,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_12_mse_var_from_mom } __pyx_L6:; while (1) { - __pyx_t_2 = PyFloat_Check(__pyx_v_arg); + __pyx_t_2 = PyFloat_Check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); 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, 174, __pyx_L1_error) @@ -9119,8 +9119,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_var * floating mx, floating my, floating vx, floating vy, floating cov * ): * return (sqrt(vx) - sqrt(vy)) ** 2 # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(pow((sqrt(__pyx_v_vx) - sqrt(__pyx_v_vy)), 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) @@ -9130,8 +9130,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_var goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":174 - * - * + * + * * cpdef _mse_var_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -9287,8 +9287,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_var * floating mx, floating my, floating vx, floating vy, floating cov * ): * return (sqrt(vx) - sqrt(vy)) ** 2 # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(pow((sqrt(__pyx_v_vx) - sqrt(__pyx_v_vy)), 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) @@ -9298,8 +9298,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_var goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":174 - * - * + * + * * cpdef _mse_var_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -9441,8 +9441,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_64__pyx_fuse_1_mse_ } /* "pytesmo/metrics/_fast_pairwise.pyx":180 - * - * + * + * * cpdef mse_bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Bias component of MSE. @@ -9681,7 +9681,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_14mse_bias(CYTHON_U __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) @@ -9690,14 +9690,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_14mse_bias(CYTHON_U __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) @@ -9791,16 +9791,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_14mse_bias(CYTHON_U __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 180, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -9813,16 +9813,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_14mse_bias(CYTHON_U __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 180, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 180, __pyx_L1_error) @@ -9995,8 +9995,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_bias * Bias component of MSE. * """ * return bias(x, y) ** 2 # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) @@ -10009,8 +10009,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_bias goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":180 - * - * + * + * * cpdef mse_bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Bias component of MSE. @@ -10139,8 +10139,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_bias * Bias component of MSE. * """ * return bias(x, y) ** 2 # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_bias(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) @@ -10153,8 +10153,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_bias goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":180 - * - * + * + * * cpdef mse_bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Bias component of MSE. @@ -10268,8 +10268,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_70__pyx_fuse_1mse_b } /* "pytesmo/metrics/_fast_pairwise.pyx":212 - * - * + * + * * cpdef _mse_bias_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -10498,7 +10498,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_16_mse_bias_from_mo } __pyx_L6:; while (1) { - __pyx_t_2 = PyFloat_Check(__pyx_v_arg); + __pyx_t_2 = PyFloat_Check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); 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, 212, __pyx_L1_error) @@ -10671,8 +10671,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_bia * floating mx, floating my, floating vx, floating vy, floating cov * ): * return (mx - my) ** 2 # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(powf((__pyx_v_mx - __pyx_v_my), 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) @@ -10682,8 +10682,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_bia goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":212 - * - * + * + * * cpdef _mse_bias_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -10839,8 +10839,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_bia * floating mx, floating my, floating vx, floating vy, floating cov * ): * return (mx - my) ** 2 # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(pow((__pyx_v_mx - __pyx_v_my), 2.0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) @@ -10850,8 +10850,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__mse_bia goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":212 - * - * + * + * * cpdef _mse_bias_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -11233,7 +11233,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_18mse_decomposition __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error) @@ -11242,14 +11242,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_18mse_decomposition __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error) @@ -11343,16 +11343,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_18mse_decomposition __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 224, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -11365,16 +11365,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_18mse_decomposition __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 224, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 224, __pyx_L1_error) @@ -11567,7 +11567,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco * """ * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) # <<<<<<<<<<<<<< - * + * * # decompositions */ __pyx_t_1 = __pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments_welford(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) @@ -11582,17 +11582,17 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - __pyx_t_5 = PyList_GET_ITEM(sequence, 3); - __pyx_t_6 = PyList_GET_ITEM(sequence, 4); + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); @@ -11651,7 +11651,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco __pyx_v_cov = __pyx_t_13; /* "pytesmo/metrics/_fast_pairwise.pyx":269 - * + * * # decompositions * mse_corr = _mse_corr_from_moments(mx, my, varx, vary, cov) # <<<<<<<<<<<<<< * mse_var = _mse_var_from_moments(mx, my, varx, vary, cov) @@ -11691,7 +11691,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco * mse_bias = _mse_bias_from_moments(mx, my, varx, vary, cov) * mse = mse_corr + mse_var + mse_bias # <<<<<<<<<<<<<< * return mse, mse_corr, mse_bias, mse_var - * + * */ __pyx_t_1 = PyNumber_Add(__pyx_v_mse_corr, __pyx_v_mse_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -11705,8 +11705,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco * mse_bias = _mse_bias_from_moments(mx, my, varx, vary, cov) * mse = mse_corr + mse_var + mse_bias * return mse, mse_corr, mse_bias, mse_var # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) @@ -11887,7 +11887,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco * """ * cdef floating mx, my, varx, vary, cov * mx, my, varx, vary, cov = _moments_welford(x, y) # <<<<<<<<<<<<<< - * + * * # decompositions */ __pyx_t_1 = __pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__moments_welford(__pyx_v_x, __pyx_v_y, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) @@ -11902,17 +11902,17 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - __pyx_t_5 = PyList_GET_ITEM(sequence, 3); - __pyx_t_6 = PyList_GET_ITEM(sequence, 4); + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = PyList_GET_ITEM(sequence, 2); + __pyx_t_5 = PyList_GET_ITEM(sequence, 3); + __pyx_t_6 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); @@ -11971,7 +11971,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco __pyx_v_cov = __pyx_t_13; /* "pytesmo/metrics/_fast_pairwise.pyx":269 - * + * * # decompositions * mse_corr = _mse_corr_from_moments(mx, my, varx, vary, cov) # <<<<<<<<<<<<<< * mse_var = _mse_var_from_moments(mx, my, varx, vary, cov) @@ -12011,7 +12011,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco * mse_bias = _mse_bias_from_moments(mx, my, varx, vary, cov) * mse = mse_corr + mse_var + mse_bias # <<<<<<<<<<<<<< * return mse, mse_corr, mse_bias, mse_var - * + * */ __pyx_t_1 = PyNumber_Add(__pyx_v_mse_corr, __pyx_v_mse_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12025,8 +12025,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_mse_deco * mse_bias = _mse_bias_from_moments(mx, my, varx, vary, cov) * mse = mse_corr + mse_var + mse_bias * return mse, mse_corr, mse_bias, mse_var # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error) @@ -12172,8 +12172,8 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_82__pyx_fuse_1mse_d } /* "pytesmo/metrics/_fast_pairwise.pyx":276 - * - * + * + * * cpdef _ubrmsd(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Unbiased root-mean-square deviation (uRMSD). @@ -12412,7 +12412,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_20_ubrmsd(CYTHON_UN __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) @@ -12421,14 +12421,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_20_ubrmsd(CYTHON_UN __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) @@ -12522,16 +12522,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_20_ubrmsd(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 276, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -12544,16 +12544,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_20_ubrmsd(CYTHON_UN __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 276, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 276, __pyx_L1_error) @@ -12748,7 +12748,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * cdef floating mx = 0, my = 0 * cdef floating sum = 0 # <<<<<<<<<<<<<< * cdef int i, n = len(x) - * + * */ __pyx_v_sum = 0.0; @@ -12756,27 +12756,27 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * cdef floating mx = 0, my = 0 * cdef floating sum = 0 * cdef int i, n = len(x) # <<<<<<<<<<<<<< - * + * * if n == 0: */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":306 * cdef int i, n = len(x) - * + * * if n == 0: # <<<<<<<<<<<<<< * return NAN - * + * */ __pyx_t_2 = ((__pyx_v_n == 0) != 0); if (__pyx_t_2) { /* "pytesmo/metrics/_fast_pairwise.pyx":307 - * + * * if n == 0: * return NAN # <<<<<<<<<<<<<< - * + * * # calculate means */ __Pyx_XDECREF(__pyx_r); @@ -12788,15 +12788,15 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( /* "pytesmo/metrics/_fast_pairwise.pyx":306 * cdef int i, n = len(x) - * + * * if n == 0: # <<<<<<<<<<<<<< * return NAN - * + * */ } /* "pytesmo/metrics/_fast_pairwise.pyx":310 - * + * * # calculate means * for i in range(n): # <<<<<<<<<<<<<< * mx += x[i] @@ -12833,7 +12833,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * my += y[i] * mx /= n # <<<<<<<<<<<<<< * my /= n - * + * */ __pyx_v_mx = (__pyx_v_mx / __pyx_v_n); @@ -12841,13 +12841,13 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * my += y[i] * mx /= n * my /= n # <<<<<<<<<<<<<< - * + * * # get unbiased values */ __pyx_v_my = (__pyx_v_my / __pyx_v_n); /* "pytesmo/metrics/_fast_pairwise.pyx":317 - * + * * # get unbiased values * for i in range(n): # <<<<<<<<<<<<<< * sum += ((x[i] - mx) - (y[i] - my))**2 @@ -12863,7 +12863,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * for i in range(n): * sum += ((x[i] - mx) - (y[i] - my))**2 # <<<<<<<<<<<<<< * return sqrt(sum / n) - * + * */ __pyx_t_7 = __pyx_v_i; __pyx_t_8 = __pyx_v_i; @@ -12874,8 +12874,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * for i in range(n): * sum += ((x[i] - mx) - (y[i] - my))**2 * return sqrt(sum / n) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyFloat_FromDouble(sqrt((__pyx_v_sum / ((float)__pyx_v_n)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) @@ -12885,8 +12885,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":276 - * - * + * + * * cpdef _ubrmsd(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Unbiased root-mean-square deviation (uRMSD). @@ -13036,7 +13036,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * cdef floating mx = 0, my = 0 * cdef floating sum = 0 # <<<<<<<<<<<<<< * cdef int i, n = len(x) - * + * */ __pyx_v_sum = 0.0; @@ -13044,27 +13044,27 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * cdef floating mx = 0, my = 0 * cdef floating sum = 0 * cdef int i, n = len(x) # <<<<<<<<<<<<<< - * + * * if n == 0: */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_x); __pyx_v_n = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":306 * cdef int i, n = len(x) - * + * * if n == 0: # <<<<<<<<<<<<<< * return NAN - * + * */ __pyx_t_2 = ((__pyx_v_n == 0) != 0); if (__pyx_t_2) { /* "pytesmo/metrics/_fast_pairwise.pyx":307 - * + * * if n == 0: * return NAN # <<<<<<<<<<<<<< - * + * * # calculate means */ __Pyx_XDECREF(__pyx_r); @@ -13076,15 +13076,15 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( /* "pytesmo/metrics/_fast_pairwise.pyx":306 * cdef int i, n = len(x) - * + * * if n == 0: # <<<<<<<<<<<<<< * return NAN - * + * */ } /* "pytesmo/metrics/_fast_pairwise.pyx":310 - * + * * # calculate means * for i in range(n): # <<<<<<<<<<<<<< * mx += x[i] @@ -13121,7 +13121,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * my += y[i] * mx /= n # <<<<<<<<<<<<<< * my /= n - * + * */ __pyx_v_mx = (__pyx_v_mx / __pyx_v_n); @@ -13129,13 +13129,13 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * my += y[i] * mx /= n * my /= n # <<<<<<<<<<<<<< - * + * * # get unbiased values */ __pyx_v_my = (__pyx_v_my / __pyx_v_n); /* "pytesmo/metrics/_fast_pairwise.pyx":317 - * + * * # get unbiased values * for i in range(n): # <<<<<<<<<<<<<< * sum += ((x[i] - mx) - (y[i] - my))**2 @@ -13151,7 +13151,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * for i in range(n): * sum += ((x[i] - mx) - (y[i] - my))**2 # <<<<<<<<<<<<<< * return sqrt(sum / n) - * + * */ __pyx_t_7 = __pyx_v_i; __pyx_t_8 = __pyx_v_i; @@ -13162,8 +13162,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( * for i in range(n): * sum += ((x[i] - mx) - (y[i] - my))**2 * return sqrt(sum / n) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyFloat_FromDouble(sqrt((__pyx_v_sum / ((double)__pyx_v_n)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) @@ -13173,8 +13173,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__ubrmsd( goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":276 - * - * + * + * * cpdef _ubrmsd(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Unbiased root-mean-square deviation (uRMSD). @@ -13287,11 +13287,11 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_88__pyx_fuse_1_ubrm } /* "pytesmo/metrics/_fast_pairwise.pyx":322 - * - * + * + * * cpdef _pearsonr_from_moments(floating varx, floating vary, floating cov, int n): # <<<<<<<<<<<<<< * cdef floating R, p_R, t_squared, df, z - * + * */ /* Python wrapper */ @@ -13517,7 +13517,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_22_pearsonr_from_mo } __pyx_L6:; while (1) { - __pyx_t_2 = PyFloat_Check(__pyx_v_arg); + __pyx_t_2 = PyFloat_Check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); 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, 322, __pyx_L1_error) @@ -13704,15 +13704,15 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson /* "pytesmo/metrics/_fast_pairwise.pyx":325 * cdef floating R, p_R, t_squared, df, z - * + * * R = cov / sqrt(varx * vary) # <<<<<<<<<<<<<< - * + * * # p-value for R */ __pyx_v_R = (((double)__pyx_v_cov) / sqrt((__pyx_v_varx * __pyx_v_vary))); /* "pytesmo/metrics/_fast_pairwise.pyx":328 - * + * * # p-value for R * if fabs(R) == 1.0: # <<<<<<<<<<<<<< * p_R = 0.0 @@ -13731,7 +13731,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson __pyx_v_p_R = 0.0; /* "pytesmo/metrics/_fast_pairwise.pyx":328 - * + * * # p-value for R * if fabs(R) == 1.0: # <<<<<<<<<<<<<< * p_R = 0.0 @@ -13780,7 +13780,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson * z = min(float(df) / (df + t_squared), 1.0) * p_R = betainc(0.5*df, 0.5, z) # <<<<<<<<<<<<<< * return R, p_R - * + * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_betainc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -13850,8 +13850,8 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson * z = min(float(df) / (df + t_squared), 1.0) * p_R = betainc(0.5*df, 0.5, z) * return R, p_R # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_R); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error) @@ -13871,11 +13871,11 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":322 - * - * + * + * * cpdef _pearsonr_from_moments(floating varx, floating vary, floating cov, int n): # <<<<<<<<<<<<<< * cdef floating R, p_R, t_squared, df, z - * + * */ /* function exit code */ @@ -14035,15 +14035,15 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson /* "pytesmo/metrics/_fast_pairwise.pyx":325 * cdef floating R, p_R, t_squared, df, z - * + * * R = cov / sqrt(varx * vary) # <<<<<<<<<<<<<< - * + * * # p-value for R */ __pyx_v_R = (__pyx_v_cov / sqrt((__pyx_v_varx * __pyx_v_vary))); /* "pytesmo/metrics/_fast_pairwise.pyx":328 - * + * * # p-value for R * if fabs(R) == 1.0: # <<<<<<<<<<<<<< * p_R = 0.0 @@ -14062,7 +14062,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson __pyx_v_p_R = 0.0; /* "pytesmo/metrics/_fast_pairwise.pyx":328 - * + * * # p-value for R * if fabs(R) == 1.0: # <<<<<<<<<<<<<< * p_R = 0.0 @@ -14111,7 +14111,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson * z = min(float(df) / (df + t_squared), 1.0) * p_R = betainc(0.5*df, 0.5, z) # <<<<<<<<<<<<<< * return R, p_R - * + * */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_betainc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -14181,8 +14181,8 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson * z = min(float(df) / (df + t_squared), 1.0) * p_R = betainc(0.5*df, 0.5, z) * return R, p_R # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyFloat_FromDouble(__pyx_v_R); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error) @@ -14202,11 +14202,11 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise__pearson goto __pyx_L0; /* "pytesmo/metrics/_fast_pairwise.pyx":322 - * - * + * + * * cpdef _pearsonr_from_moments(floating varx, floating vary, floating cov, int n): # <<<<<<<<<<<<<< * cdef floating R, p_R, t_squared, df, z - * + * */ /* function exit code */ @@ -14579,7 +14579,7 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_24rolling_pr_rmsd(C __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) @@ -14588,14 +14588,14 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_24rolling_pr_rmsd(C __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) @@ -14689,16 +14689,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_24rolling_pr_rmsd(C __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 341, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -14711,16 +14711,16 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_24rolling_pr_rmsd(C __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 341, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 341, __pyx_L1_error) @@ -14950,12 +14950,12 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ /* "pytesmo/metrics/_fast_pairwise.pyx":380 * cdef floating [:] rmsd_view - * + * * n_ts = len(timestamps) # <<<<<<<<<<<<<< * # allocate numpy arrays of the correct dtype for returning * if floating is float: */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_timestamps); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_timestamps); __pyx_v_n_ts = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":383 @@ -15083,7 +15083,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * # work on memoryviews instead of on arrays directly * pr_view = pr_arr # <<<<<<<<<<<<<< * rmsd_view = rmsd_arr - * + * */ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(((PyObject *)__pyx_v_pr_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_v_pr_view = __pyx_t_13; @@ -15094,7 +15094,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * # work on memoryviews instead of on arrays directly * pr_view = pr_arr * rmsd_view = rmsd_arr # <<<<<<<<<<<<<< - * + * * mx = my = msd = M2x = M2y = C = 0 */ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(((PyObject *)__pyx_v_rmsd_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 392, __pyx_L1_error) @@ -15104,7 +15104,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ /* "pytesmo/metrics/_fast_pairwise.pyx":394 * rmsd_view = rmsd_arr - * + * * mx = my = msd = M2x = M2y = C = 0 # <<<<<<<<<<<<<< * lower = 0 * upper = -1 @@ -15117,7 +15117,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ __pyx_v_C = 0.0; /* "pytesmo/metrics/_fast_pairwise.pyx":395 - * + * * mx = my = msd = M2x = M2y = C = 0 * lower = 0 # <<<<<<<<<<<<<< * upper = -1 @@ -15160,7 +15160,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * for i in range(n_ts): * lold = lower # <<<<<<<<<<<<<< * uold = upper - * + * */ __pyx_v_lold = __pyx_v_lower; @@ -15168,13 +15168,13 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * for i in range(n_ts): * lold = lower * uold = upper # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_uold = __pyx_v_upper; /* "pytesmo/metrics/_fast_pairwise.pyx":404 - * + * * # find interval * if center: # <<<<<<<<<<<<<< * # find new start @@ -15209,7 +15209,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * lower = j * if timestamps[j] >= timestamps[i] - window_size: # <<<<<<<<<<<<<< * break - * + * */ __pyx_t_21 = __pyx_v_j; __pyx_t_22 = __pyx_v_i; @@ -15220,7 +15220,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * lower = j * if timestamps[j] >= timestamps[i] - window_size: * break # <<<<<<<<<<<<<< - * + * * # find new end: */ goto __pyx_L7_break; @@ -15230,14 +15230,14 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * lower = j * if timestamps[j] >= timestamps[i] - window_size: # <<<<<<<<<<<<<< * break - * + * */ } } __pyx_L7_break:; /* "pytesmo/metrics/_fast_pairwise.pyx":416 - * + * * # if we're not at the end yet * if timestamps[n_ts - 1] > timestamps[i] + window_size: # <<<<<<<<<<<<<< * if i == 0: @@ -15330,7 +15330,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ __pyx_L12_break:; /* "pytesmo/metrics/_fast_pairwise.pyx":416 - * + * * # if we're not at the end yet * if timestamps[n_ts - 1] > timestamps[i] + window_size: # <<<<<<<<<<<<<< * if i == 0: @@ -15343,7 +15343,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * break * else: * upper = n_ts - 1 # <<<<<<<<<<<<<< - * + * * else: */ /*else*/ { @@ -15352,7 +15352,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ __pyx_L9:; /* "pytesmo/metrics/_fast_pairwise.pyx":404 - * + * * # find interval * if center: # <<<<<<<<<<<<<< * # find new start @@ -15362,7 +15362,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ } /* "pytesmo/metrics/_fast_pairwise.pyx":432 - * + * * else: * for j in range(lower, n_ts): # <<<<<<<<<<<<<< * lower = j @@ -15400,7 +15400,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * if timestamps[j] > timestamps[i] - window_size: * break # <<<<<<<<<<<<<< * upper = i - * + * */ goto __pyx_L15_break; @@ -15419,15 +15419,15 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * if timestamps[j] > timestamps[i] - window_size: * break * upper = i # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_upper = __pyx_v_i; } __pyx_L5:; /* "pytesmo/metrics/_fast_pairwise.pyx":444 - * + * * # first, add the new terms with Welford's algorithm * for j in range(uold+1, upper+1): # <<<<<<<<<<<<<< * mxold = mx @@ -15512,7 +15512,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x += (x[j] - mx) * (x[j] - mxold) * M2y += (y[j] - my) * (y[j] - myold) # <<<<<<<<<<<<<< * C += (x[j] - mx) * (y[j] - myold) - * + * */ __pyx_t_21 = __pyx_v_j; __pyx_t_22 = __pyx_v_j; @@ -15522,7 +15522,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x += (x[j] - mx) * (x[j] - mxold) * M2y += (y[j] - my) * (y[j] - myold) * C += (x[j] - mx) * (y[j] - myold) # <<<<<<<<<<<<<< - * + * * # now subtract the ones that fell out the window */ __pyx_t_22 = __pyx_v_j; @@ -15616,7 +15616,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x -= (x[j] - mxold) * (x[j] - mx) * M2y -= (y[j] - myold) * (y[j] - my) # <<<<<<<<<<<<<< * C -= (x[j] - mxold) * (y[j] - my) - * + * */ __pyx_t_21 = __pyx_v_j; __pyx_t_22 = __pyx_v_j; @@ -15626,7 +15626,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x -= (x[j] - mxold) * (x[j] - mx) * M2y -= (y[j] - myold) * (y[j] - my) * C -= (x[j] - mxold) * (y[j] - my) # <<<<<<<<<<<<<< - * + * * # check if we have enough observations */ __pyx_t_22 = __pyx_v_j; @@ -15635,7 +15635,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ } /* "pytesmo/metrics/_fast_pairwise.pyx":470 - * + * * # check if we have enough observations * num_obs = upper - lower + 1 # <<<<<<<<<<<<<< * if num_obs == 0 or num_obs < min_periods: @@ -15731,11 +15731,11 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); @@ -15790,7 +15790,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x, M2y, C, num_obs * ) * rmsd_view[i] = sqrt(msd) # <<<<<<<<<<<<<< - * + * * return pr_arr, rmsd_arr */ __pyx_t_21 = __pyx_v_i; @@ -15801,7 +15801,7 @@ static PyObject *__pyx_fuse_0__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ /* "pytesmo/metrics/_fast_pairwise.pyx":483 * rmsd_view[i] = sqrt(msd) - * + * * return pr_arr, rmsd_arr # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); @@ -16071,12 +16071,12 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ /* "pytesmo/metrics/_fast_pairwise.pyx":380 * cdef floating [:] rmsd_view - * + * * n_ts = len(timestamps) # <<<<<<<<<<<<<< * # allocate numpy arrays of the correct dtype for returning * if floating is float: */ - __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_timestamps); + __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_timestamps); __pyx_v_n_ts = __pyx_t_1; /* "pytesmo/metrics/_fast_pairwise.pyx":386 @@ -16204,7 +16204,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * # work on memoryviews instead of on arrays directly * pr_view = pr_arr # <<<<<<<<<<<<<< * rmsd_view = rmsd_arr - * + * */ __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(((PyObject *)__pyx_v_pr_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_v_pr_view = __pyx_t_13; @@ -16215,7 +16215,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * # work on memoryviews instead of on arrays directly * pr_view = pr_arr * rmsd_view = rmsd_arr # <<<<<<<<<<<<<< - * + * * mx = my = msd = M2x = M2y = C = 0 */ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(((PyObject *)__pyx_v_rmsd_arr), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 392, __pyx_L1_error) @@ -16225,7 +16225,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ /* "pytesmo/metrics/_fast_pairwise.pyx":394 * rmsd_view = rmsd_arr - * + * * mx = my = msd = M2x = M2y = C = 0 # <<<<<<<<<<<<<< * lower = 0 * upper = -1 @@ -16238,7 +16238,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ __pyx_v_C = 0.0; /* "pytesmo/metrics/_fast_pairwise.pyx":395 - * + * * mx = my = msd = M2x = M2y = C = 0 * lower = 0 # <<<<<<<<<<<<<< * upper = -1 @@ -16281,7 +16281,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * for i in range(n_ts): * lold = lower # <<<<<<<<<<<<<< * uold = upper - * + * */ __pyx_v_lold = __pyx_v_lower; @@ -16289,13 +16289,13 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * for i in range(n_ts): * lold = lower * uold = upper # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_uold = __pyx_v_upper; /* "pytesmo/metrics/_fast_pairwise.pyx":404 - * + * * # find interval * if center: # <<<<<<<<<<<<<< * # find new start @@ -16330,7 +16330,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * lower = j * if timestamps[j] >= timestamps[i] - window_size: # <<<<<<<<<<<<<< * break - * + * */ __pyx_t_21 = __pyx_v_j; __pyx_t_22 = __pyx_v_i; @@ -16341,7 +16341,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * lower = j * if timestamps[j] >= timestamps[i] - window_size: * break # <<<<<<<<<<<<<< - * + * * # find new end: */ goto __pyx_L7_break; @@ -16351,14 +16351,14 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * lower = j * if timestamps[j] >= timestamps[i] - window_size: # <<<<<<<<<<<<<< * break - * + * */ } } __pyx_L7_break:; /* "pytesmo/metrics/_fast_pairwise.pyx":416 - * + * * # if we're not at the end yet * if timestamps[n_ts - 1] > timestamps[i] + window_size: # <<<<<<<<<<<<<< * if i == 0: @@ -16451,7 +16451,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ __pyx_L12_break:; /* "pytesmo/metrics/_fast_pairwise.pyx":416 - * + * * # if we're not at the end yet * if timestamps[n_ts - 1] > timestamps[i] + window_size: # <<<<<<<<<<<<<< * if i == 0: @@ -16464,7 +16464,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * break * else: * upper = n_ts - 1 # <<<<<<<<<<<<<< - * + * * else: */ /*else*/ { @@ -16473,7 +16473,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ __pyx_L9:; /* "pytesmo/metrics/_fast_pairwise.pyx":404 - * + * * # find interval * if center: # <<<<<<<<<<<<<< * # find new start @@ -16483,7 +16483,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ } /* "pytesmo/metrics/_fast_pairwise.pyx":432 - * + * * else: * for j in range(lower, n_ts): # <<<<<<<<<<<<<< * lower = j @@ -16521,7 +16521,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * if timestamps[j] > timestamps[i] - window_size: * break # <<<<<<<<<<<<<< * upper = i - * + * */ goto __pyx_L15_break; @@ -16540,15 +16540,15 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * if timestamps[j] > timestamps[i] - window_size: * break * upper = i # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_upper = __pyx_v_i; } __pyx_L5:; /* "pytesmo/metrics/_fast_pairwise.pyx":444 - * + * * # first, add the new terms with Welford's algorithm * for j in range(uold+1, upper+1): # <<<<<<<<<<<<<< * mxold = mx @@ -16633,7 +16633,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x += (x[j] - mx) * (x[j] - mxold) * M2y += (y[j] - my) * (y[j] - myold) # <<<<<<<<<<<<<< * C += (x[j] - mx) * (y[j] - myold) - * + * */ __pyx_t_21 = __pyx_v_j; __pyx_t_22 = __pyx_v_j; @@ -16643,7 +16643,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x += (x[j] - mx) * (x[j] - mxold) * M2y += (y[j] - my) * (y[j] - myold) * C += (x[j] - mx) * (y[j] - myold) # <<<<<<<<<<<<<< - * + * * # now subtract the ones that fell out the window */ __pyx_t_22 = __pyx_v_j; @@ -16737,7 +16737,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x -= (x[j] - mxold) * (x[j] - mx) * M2y -= (y[j] - myold) * (y[j] - my) # <<<<<<<<<<<<<< * C -= (x[j] - mxold) * (y[j] - my) - * + * */ __pyx_t_21 = __pyx_v_j; __pyx_t_22 = __pyx_v_j; @@ -16747,7 +16747,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x -= (x[j] - mxold) * (x[j] - mx) * M2y -= (y[j] - myold) * (y[j] - my) * C -= (x[j] - mxold) * (y[j] - my) # <<<<<<<<<<<<<< - * + * * # check if we have enough observations */ __pyx_t_22 = __pyx_v_j; @@ -16756,7 +16756,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ } /* "pytesmo/metrics/_fast_pairwise.pyx":470 - * + * * # check if we have enough observations * num_obs = upper - lower + 1 # <<<<<<<<<<<<<< * if num_obs == 0 or num_obs < min_periods: @@ -16852,11 +16852,11 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); @@ -16911,7 +16911,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ * M2x, M2y, C, num_obs * ) * rmsd_view[i] = sqrt(msd) # <<<<<<<<<<<<<< - * + * * return pr_arr, rmsd_arr */ __pyx_t_21 = __pyx_v_i; @@ -16922,7 +16922,7 @@ static PyObject *__pyx_fuse_1__pyx_f_7pytesmo_7metrics_14_fast_pairwise_rolling_ /* "pytesmo/metrics/_fast_pairwise.pyx":483 * rmsd_view[i] = sqrt(msd) - * + * * return pr_arr, rmsd_arr # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); @@ -17121,10 +17121,10 @@ static PyObject *__pyx_pf_7pytesmo_7metrics_14_fast_pairwise_100__pyx_fuse_1roll /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { @@ -17137,10 +17137,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":736 - * + * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); @@ -17152,10 +17152,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ /* function exit code */ @@ -17171,10 +17171,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { @@ -17187,10 +17187,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":739 - * + * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); @@ -17202,10 +17202,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ /* function exit code */ @@ -17221,10 +17221,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { @@ -17237,10 +17237,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":742 - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); @@ -17252,10 +17252,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ /* function exit code */ @@ -17271,10 +17271,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { @@ -17287,10 +17287,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":745 - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); @@ -17302,10 +17302,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ /* function exit code */ @@ -17321,10 +17321,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { @@ -17337,10 +17337,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":748 - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); @@ -17352,10 +17352,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ /* function exit code */ @@ -17371,7 +17371,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -17384,7 +17384,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":751 - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -17406,7 +17406,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":751 - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -17418,8 +17418,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< - * - * + * + * */ /*else*/ { __Pyx_XDECREF(__pyx_r); @@ -17430,7 +17430,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -17445,7 +17445,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -17456,11 +17456,11 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannySetupContext("set_array_base", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":932 - * + * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< * PyArray_SetBaseObject(arr, base) - * + * */ Py_INCREF(__pyx_v_base); @@ -17468,14 +17468,14 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * + * * cdef inline object get_array_base(ndarray arr): */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -17487,7 +17487,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -17501,7 +17501,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannySetupContext("get_array_base", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":936 - * + * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< * if base is NULL: @@ -17524,7 +17524,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py * if base is NULL: * return None # <<<<<<<<<<<<<< * return base - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -17543,7 +17543,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py * if base is NULL: * return None * return base # <<<<<<<<<<<<<< - * + * * # Versions of the import_* functions which are more suitable for */ __Pyx_XDECREF(__pyx_r); @@ -17553,7 +17553,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -17634,7 +17634,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { * __pyx_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) { @@ -17648,7 +17648,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { * __pyx_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__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 947, __pyx_L5_except_error) @@ -17700,7 +17700,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -17723,7 +17723,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_RefNannySetupContext("import_umath", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -17748,7 +17748,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 951, __pyx_L3_error) /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -17766,7 +17766,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { * _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) { @@ -17780,7 +17780,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { * _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__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 953, __pyx_L5_except_error) @@ -17793,7 +17793,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L5_except_error:; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -17809,7 +17809,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -17832,7 +17832,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -17855,7 +17855,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_RefNannySetupContext("import_ufunc", 0); /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -17880,7 +17880,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L3_error) /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -17898,7 +17898,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { * _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) { @@ -17912,7 +17912,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef extern from *: */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 959, __pyx_L5_except_error) @@ -17925,7 +17925,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L5_except_error:; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -17941,7 +17941,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -17963,8 +17963,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":969 - * - * + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -17979,15 +17979,15 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":969 - * - * + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -18000,8 +18000,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":984 - * - * + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -18016,15 +18016,15 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":984 - * - * + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -18037,8 +18037,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":999 - * - * + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -18051,15 +18051,15 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":999 - * - * + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -18071,8 +18071,8 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1009 - * - * + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -18085,15 +18085,15 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1009 - * - * + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -18105,8 +18105,8 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject } /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1016 - * - * + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -18124,8 +18124,8 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec goto __pyx_L0; /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1016 - * - * + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -18138,10 +18138,10 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* Python wrapper */ @@ -18234,10 +18234,10 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } else { /* "View.MemoryView":123 - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< - * + * * cdef int idx */ __pyx_v_allocate_buffer = ((int)1); @@ -18259,10 +18259,10 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* function exit code */ @@ -18301,10 +18301,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":129 * cdef PyObject **p - * + * * self.ndim = len(shape) # <<<<<<<<<<<<<< * self.itemsize = itemsize - * + * */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); @@ -18314,29 +18314,29 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":130 - * + * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< - * + * * if not self.ndim: */ __pyx_v_self->itemsize = __pyx_v_itemsize; /* "View.MemoryView":132 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":133 - * + * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * + * * if itemsize <= 0: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error) @@ -18347,28 +18347,28 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":132 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ } /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":136 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error) @@ -18379,26 +18379,26 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ } /* "View.MemoryView":138 * 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_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_2 = PyBytes_Check(__pyx_v_format); __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { /* "View.MemoryView":139 - * + * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string @@ -18426,7 +18426,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":138 * 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 @@ -18438,7 +18438,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * 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_ERR(2, 140, __pyx_L1_error) __pyx_t_3 = __pyx_v_format; @@ -18453,8 +18453,8 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< - * - * + * + * */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); @@ -18464,39 +18464,39 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->format = __pyx_t_7; /* "View.MemoryView":144 - * - * + * + * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< * self._strides = self._shape + self.ndim - * + * */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); /* "View.MemoryView":145 - * + * * self._shape = 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":147 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":148 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -18506,16 +18506,16 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":147 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ } /* "View.MemoryView":151 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -18537,7 +18537,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_8 = (__pyx_t_8 + 1); /* "View.MemoryView":152 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -18551,7 +18551,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim - * + * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -18576,7 +18576,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __PYX_ERR(2, 153, __pyx_L1_error) /* "View.MemoryView":152 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -18588,14 +18588,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< - * + * * cdef char order */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; /* "View.MemoryView":151 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -18604,7 +18604,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":157 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' @@ -18636,7 +18636,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->mode = __pyx_n_u_fortran; /* "View.MemoryView":157 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' @@ -18691,7 +18691,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * 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, */ /*else*/ { @@ -18708,16 +18708,16 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":166 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) - * + * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< * itemsize, self.ndim, order) - * + * */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); /* "View.MemoryView":169 * itemsize, self.ndim, order) - * + * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< * self.dtype_is_object = format == b'O' * if allocate_buffer: @@ -18725,11 +18725,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->free_data = __pyx_v_allocate_buffer; /* "View.MemoryView":170 - * + * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: - * + * */ __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error) @@ -18740,15 +18740,15 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_4 = (__pyx_v_allocate_buffer != 0); if (__pyx_t_4) { /* "View.MemoryView":174 - * - * + * + * * self.data = malloc(self.len) # <<<<<<<<<<<<<< * if not self.data: * raise MemoryError("unable to allocate array data.") @@ -18756,11 +18756,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); /* "View.MemoryView":175 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); if (unlikely(__pyx_t_4)) { @@ -18769,7 +18769,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error) @@ -18779,17 +18779,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __PYX_ERR(2, 176, __pyx_L1_error) /* "View.MemoryView":175 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ } /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): @@ -18798,7 +18798,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ if (__pyx_t_4) { /* "View.MemoryView":179 - * + * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< * for i in range(self.len / itemsize): @@ -18831,7 +18831,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ (__pyx_v_p[__pyx_v_i]) = Py_None; @@ -18839,7 +18839,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ Py_INCREF(Py_None); @@ -18847,7 +18847,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): @@ -18858,17 +18858,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* function exit code */ @@ -18888,7 +18888,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } /* "View.MemoryView":185 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 @@ -19095,7 +19095,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< * info.readonly = 0 - * + * */ __pyx_t_5 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_5; @@ -19104,14 +19104,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ __pyx_v_info->readonly = 0; /* "View.MemoryView":202 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: @@ -19120,7 +19120,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru if (__pyx_t_1) { /* "View.MemoryView":203 - * + * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< * else: @@ -19131,7 +19131,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":202 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: @@ -19143,7 +19143,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.obj = self */ /*else*/ { @@ -19153,9 +19153,9 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":207 * info.format = NULL - * + * * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); @@ -19165,7 +19165,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":185 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 @@ -19196,7 +19196,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) @@ -19219,7 +19219,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":212 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) @@ -19238,7 +19238,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_v_self->callback_free_data(__pyx_v_self->data); /* "View.MemoryView":212 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) @@ -19290,7 +19290,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< * PyObject_Free(self._shape) - * + * */ free(__pyx_v_self->data); @@ -19308,14 +19308,14 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< - * + * * @property */ PyObject_Free(__pyx_v_self->_shape); /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) @@ -19326,11 +19326,11 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc } /* "View.MemoryView":222 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ /* Python wrapper */ @@ -19359,7 +19359,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< - * + * * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); @@ -19370,11 +19370,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ goto __pyx_L0; /* "View.MemoryView":222 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ /* function exit code */ @@ -19389,7 +19389,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ } /* "View.MemoryView":226 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE @@ -19413,7 +19413,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * 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); @@ -19421,7 +19421,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< - * + * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); @@ -19448,7 +19448,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { goto __pyx_L0; /* "View.MemoryView":226 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE @@ -19470,10 +19470,10 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ /* Python wrapper */ @@ -19495,10 +19495,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":231 - * + * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< - * + * * def __getattr__(self, attr): */ __pyx_r = (__pyx_v_self->_shape[0]); @@ -19506,10 +19506,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ /* function exit code */ @@ -19520,10 +19520,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str /* "View.MemoryView":233 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ /* Python wrapper */ @@ -19550,10 +19550,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( __Pyx_RefNannySetupContext("__getattr__", 0); /* "View.MemoryView":234 - * + * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< - * + * * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); @@ -19568,10 +19568,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( /* "View.MemoryView":233 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ /* function exit code */ @@ -19588,10 +19588,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( /* "View.MemoryView":236 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ /* Python wrapper */ @@ -19618,10 +19618,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":237 - * + * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< - * + * * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); @@ -19636,10 +19636,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ /* "View.MemoryView":236 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ /* function exit code */ @@ -19656,10 +19656,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ /* "View.MemoryView":239 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ /* Python wrapper */ @@ -19685,11 +19685,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc __Pyx_RefNannySetupContext("__setitem__", 0); /* "View.MemoryView":240 - * + * * 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_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19698,10 +19698,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc /* "View.MemoryView":239 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ /* function exit code */ @@ -19830,7 +19830,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct } /* "View.MemoryView":244 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): @@ -19853,7 +19853,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":248 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: @@ -19862,7 +19862,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize if (__pyx_t_1) { /* "View.MemoryView":249 - * + * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: @@ -19896,7 +19896,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":248 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: @@ -19938,7 +19938,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf - * + * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -19962,7 +19962,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< - * + * * return result */ __pyx_v_result->data = __pyx_v_buf; @@ -19971,10 +19971,10 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":255 * result.data = buf - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_result)); @@ -19982,7 +19982,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize goto __pyx_L0; /* "View.MemoryView":244 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): @@ -20102,7 +20102,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ /* Python wrapper */ @@ -20127,7 +20127,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< - * + * * cdef generic = Enum("") */ __Pyx_XDECREF(__pyx_r); @@ -20140,7 +20140,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ /* function exit code */ @@ -20444,7 +20444,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me } /* "View.MemoryView":298 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" @@ -20462,59 +20462,59 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< * cdef size_t offset - * + * */ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); /* "View.MemoryView":304 - * + * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * + * * if offset > 0: */ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); /* "View.MemoryView":306 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ __pyx_t_1 = ((__pyx_v_offset > 0) != 0); if (__pyx_t_1) { /* "View.MemoryView":307 - * + * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< - * + * * return aligned_p */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); /* "View.MemoryView":306 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ } /* "View.MemoryView":309 * aligned_p += alignment - offset - * + * * return aligned_p # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; /* "View.MemoryView":298 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" @@ -20528,7 +20528,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags @@ -20629,7 +20629,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __Pyx_RefNannySetupContext("__cinit__", 0); /* "View.MemoryView":346 - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< * self.flags = flags @@ -20694,7 +20694,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; @@ -20702,7 +20702,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * global __pyx_memoryview_thread_locks_used */ Py_INCREF(Py_None); @@ -20726,7 +20726,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ } /* "View.MemoryView":355 - * + * * 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] @@ -20754,7 +20754,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); /* "View.MemoryView":355 - * + * * 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] @@ -20786,7 +20786,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); if (unlikely(__pyx_t_1)) { @@ -20795,7 +20795,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: * raise MemoryError # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error) @@ -20805,7 +20805,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ } @@ -20820,7 +20820,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":363 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: @@ -20829,7 +20829,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ if (__pyx_t_1) { /* "View.MemoryView":364 - * + * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< * else: @@ -20848,7 +20848,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":363 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: @@ -20860,7 +20860,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * 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*/ { @@ -20870,7 +20870,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":368 * self.dtype_is_object = dtype_is_object - * + * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL @@ -20881,14 +20881,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< - * + * * def __dealloc__(memoryview self): */ __pyx_v_self->typeinfo = NULL; /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags @@ -20907,7 +20907,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":372 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) @@ -20937,7 +20937,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":373 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) @@ -20952,12 +20952,12 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * elif (<__pyx_buffer *> &self.view).obj == Py_None: - * + * */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); /* "View.MemoryView":373 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) @@ -20970,7 +20970,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< - * + * * (<__pyx_buffer *> &self.view).obj = NULL */ __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); @@ -20978,18 +20978,18 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":377 * elif (<__pyx_buffer *> &self.view).obj == Py_None: - * + * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< * Py_DECREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; /* "View.MemoryView":378 - * + * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< - * + * * cdef int i */ Py_DECREF(Py_None); @@ -20998,7 +20998,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< - * + * * (<__pyx_buffer *> &self.view).obj = NULL */ } @@ -21108,7 +21108,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * 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); @@ -21126,7 +21126,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":372 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) @@ -21138,7 +21138,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":393 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf @@ -21166,17 +21166,17 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< - * + * * for dim, idx in enumerate(index): */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); /* "View.MemoryView":397 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { @@ -21224,10 +21224,10 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_t_1 = (__pyx_t_1 + 1); /* "View.MemoryView":398 - * + * * 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_ERR(2, 398, __pyx_L1_error) @@ -21236,27 +21236,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py /* "View.MemoryView":397 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":400 * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * * return itemp # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_itemp; goto __pyx_L0; /* "View.MemoryView":393 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf @@ -21275,8 +21275,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py } /* "View.MemoryView":403 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self @@ -21313,11 +21313,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":404 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); __pyx_t_2 = (__pyx_t_1 != 0); @@ -21327,7 +21327,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< - * + * * have_slices, indices = _unellipsify(index, self.view.ndim) */ __Pyx_XDECREF(__pyx_r); @@ -21336,19 +21336,19 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ goto __pyx_L0; /* "View.MemoryView":404 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ } /* "View.MemoryView":407 * 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_ERR(2, 407, __pyx_L1_error) @@ -21362,8 +21362,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __PYX_ERR(2, 407, __pyx_L1_error) } #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_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 @@ -21382,7 +21382,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_t_5 = 0; /* "View.MemoryView":410 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) @@ -21406,7 +21406,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ goto __pyx_L0; /* "View.MemoryView":410 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) @@ -21419,7 +21419,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< * return self.convert_item_to_object(itemp) - * + * */ /*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 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error) @@ -21429,7 +21429,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< - * + * * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); @@ -21441,8 +21441,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ } /* "View.MemoryView":403 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self @@ -21465,7 +21465,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") @@ -21500,11 +21500,11 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_INCREF(__pyx_v_index); /* "View.MemoryView":417 - * + * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") - * + * */ __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { @@ -21513,7 +21513,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< - * + * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) @@ -21523,19 +21523,19 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __PYX_ERR(2, 418, __pyx_L1_error) /* "View.MemoryView":417 - * + * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") - * + * */ } /* "View.MemoryView":420 * raise TypeError("Cannot assign to read-only memoryview") - * + * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< - * + * * if have_slices: */ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) @@ -21549,8 +21549,8 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __PYX_ERR(2, 420, __pyx_L1_error) } #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_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 @@ -21570,7 +21570,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: @@ -21579,7 +21579,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit if (__pyx_t_1) { /* "View.MemoryView":423 - * + * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: @@ -21644,7 +21644,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: @@ -21656,7 +21656,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< - * + * * cdef is_slice(self, obj): */ /*else*/ { @@ -21668,7 +21668,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") @@ -21693,7 +21693,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":431 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: @@ -21718,13 +21718,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_INCREF(__pyx_v_obj); /* "View.MemoryView":432 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __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) { @@ -21810,7 +21810,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< * return None - * + * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { @@ -21824,7 +21824,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< - * + * * return obj */ __Pyx_XDECREF(__pyx_r); @@ -21859,7 +21859,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ } /* "View.MemoryView":432 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: @@ -21869,9 +21869,9 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":439 * return None - * + * * return obj # <<<<<<<<<<<<<< - * + * * cdef setitem_slice_assignment(self, dst, src): */ __Pyx_XDECREF(__pyx_r); @@ -21881,7 +21881,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":431 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: @@ -21903,7 +21903,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":441 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice @@ -21927,7 +21927,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":445 * 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) @@ -21936,11 +21936,11 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error) /* "View.MemoryView":446 - * + * * 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_ERR(2, 446, __pyx_L1_error) __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error) @@ -21949,7 +21949,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) @@ -21963,7 +21963,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":445 * 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) @@ -21972,7 +21972,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":441 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice @@ -21993,7 +21993,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL @@ -22029,7 +22029,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< * cdef void *item - * + * */ __pyx_v_tmp = NULL; @@ -22037,7 +22037,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< - * + * * if self.view.itemsize > sizeof(array): */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error) @@ -22045,7 +22045,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: @@ -22054,7 +22054,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor if (__pyx_t_2) { /* "View.MemoryView":459 - * + * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< * if tmp == NULL: @@ -22101,7 +22101,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: @@ -22113,7 +22113,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item = tmp * else: * item = array # <<<<<<<<<<<<<< - * + * * try: */ /*else*/ { @@ -22123,7 +22123,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":466 * item = array - * + * * try: # <<<<<<<<<<<<<< * if self.dtype_is_object: * ( item)[0] = value @@ -22131,7 +22131,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /*try:*/ { /* "View.MemoryView":467 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value @@ -22150,7 +22150,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); /* "View.MemoryView":467 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value @@ -22163,8 +22163,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< - * - * + * + * */ /*else*/ { __pyx_t_3 = ((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_3)) __PYX_ERR(2, 470, __pyx_L6_error) @@ -22174,8 +22174,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_L8:; /* "View.MemoryView":474 - * - * + * + * * 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, @@ -22184,7 +22184,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor if (__pyx_t_2) { /* "View.MemoryView":475 - * + * * 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, @@ -22195,8 +22195,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":474 - * - * + * + * * 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, @@ -22217,7 +22217,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< - * + * * cdef setitem_indexed(self, index, value): */ /*finally:*/ { @@ -22262,7 +22262,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL @@ -22283,7 +22283,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":481 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) @@ -22301,11 +22301,11 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ __Pyx_RefNannySetupContext("setitem_indexed", 0); /* "View.MemoryView":482 - * + * * 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 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; @@ -22314,7 +22314,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ * 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_ERR(2, 483, __pyx_L1_error) @@ -22323,7 +22323,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ /* "View.MemoryView":481 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) @@ -22344,7 +22344,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -22377,7 +22377,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem - * + * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -22386,7 +22386,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":491 * cdef bytes bytesitem - * + * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) @@ -22397,7 +22397,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -22474,7 +22474,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -22490,7 +22490,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * return result */ /*else:*/ { - __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_10 = strlen(__pyx_v_self->view.format); __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { @@ -22499,7 +22499,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< * return result - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error) @@ -22521,7 +22521,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< - * + * * cdef assign_item_from_object(self, char *itemp, object value): */ __Pyx_XDECREF(__pyx_r); @@ -22574,7 +22574,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_L5_except_error:; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -22595,7 +22595,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -22621,7 +22621,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":501 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -22667,17 +22667,17 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":509 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ - __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "View.MemoryView":510 - * + * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: @@ -22708,7 +22708,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":509 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: @@ -22720,7 +22720,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< - * + * * for i, c in enumerate(bytesvalue): */ /*else*/ { @@ -22783,10 +22783,10 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { @@ -22802,28 +22802,28 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_v_c = (__pyx_t_11[0]); /* "View.MemoryView":515 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ __pyx_v_i = __pyx_t_9; /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ __pyx_t_9 = (__pyx_t_9 + 1); /* "View.MemoryView":515 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; @@ -22832,7 +22832,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":501 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -22859,7 +22859,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie } /* "View.MemoryView":518 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: @@ -22906,7 +22906,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * */ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); if (__pyx_t_2) { @@ -22923,7 +22923,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_ND: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error) @@ -22937,13 +22937,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * */ } /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: @@ -22952,7 +22952,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":523 - * + * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< * else: @@ -22963,7 +22963,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: @@ -22975,7 +22975,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_STRIDES: */ /*else*/ { @@ -22985,7 +22985,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":527 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: @@ -22994,7 +22994,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":528 - * + * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< * else: @@ -23005,7 +23005,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":527 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: @@ -23017,7 +23017,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_INDIRECT: */ /*else*/ { @@ -23027,7 +23027,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":532 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: @@ -23036,7 +23036,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":533 - * + * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< * else: @@ -23047,7 +23047,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":532 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: @@ -23059,7 +23059,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ /*else*/ { @@ -23069,7 +23069,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":537 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: @@ -23078,7 +23078,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":538 - * + * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< * else: @@ -23089,7 +23089,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":537 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: @@ -23101,7 +23101,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.buf = self.view.buf */ /*else*/ { @@ -23111,7 +23111,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":542 * info.format = NULL - * + * * info.buf = self.view.buf # <<<<<<<<<<<<<< * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize @@ -23120,7 +23120,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->buf = __pyx_t_6; /* "View.MemoryView":543 - * + * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< * info.itemsize = self.view.itemsize @@ -23154,7 +23154,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< * info.obj = self - * + * */ __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; @@ -23163,7 +23163,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); @@ -23173,7 +23173,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":518 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: @@ -23203,7 +23203,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } /* "View.MemoryView":553 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) @@ -23252,7 +23252,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * 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 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error) @@ -23260,7 +23260,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23269,7 +23269,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ goto __pyx_L0; /* "View.MemoryView":553 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) @@ -23289,11 +23289,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ } /* "View.MemoryView":559 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ /* Python wrapper */ @@ -23318,7 +23318,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23327,11 +23327,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc goto __pyx_L0; /* "View.MemoryView":559 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ /* function exit code */ @@ -23342,11 +23342,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc } /* "View.MemoryView":563 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ /* Python wrapper */ @@ -23380,7 +23380,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23403,11 +23403,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru goto __pyx_L0; /* "View.MemoryView":563 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ /* function exit code */ @@ -23423,11 +23423,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru } /* "View.MemoryView":567 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ /* Python wrapper */ @@ -23462,7 +23462,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); @@ -23470,9 +23470,9 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st /* "View.MemoryView":570 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error) @@ -23485,16 +23485,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ } /* "View.MemoryView":572 * raise ValueError("Buffer view does not expose strides") - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23517,11 +23517,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st goto __pyx_L0; /* "View.MemoryView":567 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ /* function exit code */ @@ -23537,7 +23537,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st } /* "View.MemoryView":575 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: @@ -23577,7 +23577,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * 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) { @@ -23586,7 +23586,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * 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_XDECREF(__pyx_r); @@ -23604,15 +23604,15 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim - * + * */ } /* "View.MemoryView":579 * return (-1,) * self.view.ndim - * + * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23635,7 +23635,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ goto __pyx_L0; /* "View.MemoryView":575 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: @@ -23655,11 +23655,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ } /* "View.MemoryView":582 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ /* Python wrapper */ @@ -23688,7 +23688,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23699,11 +23699,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc goto __pyx_L0; /* "View.MemoryView":582 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ /* function exit code */ @@ -23718,11 +23718,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc } /* "View.MemoryView":586 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ /* Python wrapper */ @@ -23751,7 +23751,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23762,11 +23762,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s goto __pyx_L0; /* "View.MemoryView":586 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ /* function exit code */ @@ -23781,11 +23781,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s } /* "View.MemoryView":590 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ /* Python wrapper */ @@ -23816,7 +23816,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -23833,11 +23833,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str goto __pyx_L0; /* "View.MemoryView":590 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ /* function exit code */ @@ -23854,7 +23854,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str } /* "View.MemoryView":594 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: @@ -23895,7 +23895,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * 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); @@ -23905,7 +23905,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< - * + * * for length in self.view.shape[:self.view.ndim]: */ __Pyx_INCREF(__pyx_int_1); @@ -23913,10 +23913,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":598 * result = 1 - * + * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< * result *= length - * + * */ __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++) { @@ -23927,10 +23927,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_6 = 0; /* "View.MemoryView":599 - * + * * 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, 599, __pyx_L1_error) @@ -23941,9 +23941,9 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":601 * result *= length - * + * * self._size = result # <<<<<<<<<<<<<< - * + * * return self._size */ __Pyx_INCREF(__pyx_v_result); @@ -23957,15 +23957,15 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 - * + * */ } /* "View.MemoryView":603 * self._size = result - * + * * return self._size # <<<<<<<<<<<<<< - * + * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); @@ -23974,7 +23974,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc goto __pyx_L0; /* "View.MemoryView":594 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: @@ -23996,7 +23996,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":605 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] @@ -24022,11 +24022,11 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":606 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { @@ -24035,26 +24035,26 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< - * + * * return 0 */ __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; /* "View.MemoryView":606 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ } /* "View.MemoryView":609 * return self.view.shape[0] - * + * * return 0 # <<<<<<<<<<<<<< - * + * * def __repr__(self): */ __pyx_r = 0; @@ -24062,7 +24062,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 /* "View.MemoryView":605 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] @@ -24076,7 +24076,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 /* "View.MemoryView":611 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) @@ -24107,11 +24107,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 __Pyx_RefNannySetupContext("__repr__", 0); /* "View.MemoryView":612 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) @@ -24127,18 +24127,18 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< - * + * * def __str__(self): */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "View.MemoryView":612 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -24157,7 +24157,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 /* "View.MemoryView":611 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) @@ -24178,10 +24178,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 /* "View.MemoryView":615 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ /* Python wrapper */ @@ -24208,11 +24208,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 __Pyx_RefNannySetupContext("__str__", 0); /* "View.MemoryView":616 - * + * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) @@ -24237,10 +24237,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 /* "View.MemoryView":615 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ /* function exit code */ @@ -24256,8 +24256,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 } /* "View.MemoryView":619 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -24293,7 +24293,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; @@ -24302,7 +24302,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); @@ -24313,8 +24313,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 goto __pyx_L0; /* "View.MemoryView":619 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -24333,7 +24333,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -24369,7 +24369,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; @@ -24378,7 +24378,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def copy(self): */ __Pyx_XDECREF(__pyx_r); @@ -24390,7 +24390,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -24409,7 +24409,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS @@ -24444,14 +24444,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &mslice) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); /* "View.MemoryView":635 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS - * + * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, * self.view.itemsize, @@ -24459,7 +24459,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); /* "View.MemoryView":636 - * + * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, @@ -24470,9 +24470,9 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":641 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< - * + * * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); @@ -24484,7 +24484,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS @@ -24503,7 +24503,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS @@ -24539,14 +24539,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &src) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); /* "View.MemoryView":647 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS - * + * * slice_copy(self, &src) # <<<<<<<<<<<<<< * dst = slice_copy_contig(&src, "fortran", self.view.ndim, * self.view.itemsize, @@ -24554,7 +24554,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); /* "View.MemoryView":648 - * + * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, @@ -24565,10 +24565,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 /* "View.MemoryView":653 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) @@ -24579,7 +24579,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS @@ -24710,7 +24710,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st } /* "View.MemoryView":657 - * + * * @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) @@ -24762,7 +24762,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< * return result - * + * */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; @@ -24770,7 +24770,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_check') */ __Pyx_XDECREF(__pyx_r); @@ -24779,7 +24779,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in goto __pyx_L0; /* "View.MemoryView":657 - * + * * @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) @@ -24801,11 +24801,11 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in } /* "View.MemoryView":663 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { @@ -24818,19 +24818,19 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { * @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, __pyx_memoryview_type); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); __pyx_r = __pyx_t_1; goto __pyx_L0; /* "View.MemoryView":663 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ /* function exit code */ @@ -24841,7 +24841,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { /* "View.MemoryView":666 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with @@ -24880,7 +24880,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: */ - __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_1 = PyTuple_Check(__pyx_v_index); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { @@ -24913,7 +24913,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< - * + * * result = [] */ /*else*/ { @@ -24924,7 +24924,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":676 * tup = index - * + * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False @@ -24935,7 +24935,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_3 = 0; /* "View.MemoryView":677 - * + * * result = [] * have_slices = False # <<<<<<<<<<<<<< * seen_ellipsis = False @@ -25106,10 +25106,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_2 = PySlice_Check(__pyx_v_item); __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_10) { } else { @@ -25125,7 +25125,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error) @@ -25142,16 +25142,16 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * */ } /* "View.MemoryView":691 * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< * result.append(item) - * + * */ __pyx_t_10 = (__pyx_v_have_slices != 0); if (!__pyx_t_10) { @@ -25159,17 +25159,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = __pyx_t_10; goto __pyx_L11_bool_binop_done; } - __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = PySlice_Check(__pyx_v_item); __pyx_t_2 = (__pyx_t_10 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; /* "View.MemoryView":692 - * + * * 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 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) @@ -25189,7 +25189,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":694 * result.append(item) - * + * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) @@ -25198,11 +25198,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":695 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { @@ -25211,7 +25211,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_ERR(2, 696, __pyx_L1_error) @@ -25227,19 +25227,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":695 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ } /* "View.MemoryView":698 * result.extend([slice(None)] * nslices) - * + * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): */ __Pyx_XDECREF(__pyx_r); @@ -25272,7 +25272,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":666 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with @@ -25298,7 +25298,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: @@ -25319,7 +25319,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); /* "View.MemoryView":701 - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: @@ -25335,7 +25335,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { @@ -25344,8 +25344,8 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -25358,14 +25358,14 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ } } /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: @@ -25385,7 +25385,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ } /* "View.MemoryView":710 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim @@ -25439,19 +25439,19 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_suboffset_dim = -1; /* "View.MemoryView":718 - * - * + * + * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< - * + * * cdef _memoryviewslice memviewsliceobj */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); /* "View.MemoryView":722 * cdef _memoryviewslice memviewsliceobj - * + * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ #ifndef CYTHON_WITHOUT_ASSERTIONS @@ -25465,17 +25465,17 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":724 * 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), __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":725 - * + * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice @@ -25498,7 +25498,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":724 * assert memview.view.ndim > 0 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice @@ -25511,7 +25511,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< * p_src = &src - * + * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); @@ -25520,36 +25520,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_p_src = (&__pyx_v_src); } __pyx_L3:; /* "View.MemoryView":735 - * - * + * + * * dst.memview = p_src.memview # <<<<<<<<<<<<<< * dst.data = p_src.data - * + * */ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; /* "View.MemoryView":736 - * + * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; /* "View.MemoryView":741 - * - * + * + * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< * cdef int *p_suboffset_dim = &suboffset_dim * cdef Py_ssize_t start, stop, step @@ -25557,7 +25557,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_p_dst = (&__pyx_v_dst); /* "View.MemoryView":742 - * + * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< * cdef Py_ssize_t start, stop, step @@ -25567,7 +25567,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( @@ -25618,7 +25618,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_6 = (__pyx_t_6 + 1); /* "View.MemoryView":747 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( @@ -25646,7 +25646,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __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 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error) /* "View.MemoryView":747 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( @@ -25740,7 +25740,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -25761,7 +25761,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 762, __pyx_L1_error) @@ -25781,7 +25781,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":764 * 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 @@ -25793,11 +25793,11 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_have_start = __pyx_t_1; /* "View.MemoryView":765 - * + * * 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_ERR(2, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -25809,7 +25809,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 766, __pyx_L1_error) @@ -25820,7 +25820,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":768 * 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, @@ -25831,7 +25831,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); @@ -25840,7 +25840,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( @@ -25850,17 +25850,17 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":776 * 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), __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":777 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, @@ -25887,7 +25887,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) } /* "View.MemoryView":777 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, @@ -25902,7 +25902,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":776 * new_ndim += 1 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, @@ -25914,7 +25914,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) - * + * */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); @@ -25923,8 +25923,8 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -25934,7 +25934,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 782, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); @@ -25943,7 +25943,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } /* "View.MemoryView":710 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim @@ -25965,7 +25965,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } /* "View.MemoryView":807 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, @@ -25985,9 +25985,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":827 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); @@ -25995,7 +25995,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":829 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: @@ -26004,7 +26004,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_1) { /* "View.MemoryView":830 - * + * * if start < 0: * start += shape # <<<<<<<<<<<<<< * if not 0 <= start < shape: @@ -26014,7 +26014,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":829 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: @@ -26040,7 +26040,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * 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, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error) @@ -26055,9 +26055,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":827 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ goto __pyx_L3; @@ -26065,9 +26065,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":835 * else: - * + * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< - * + * * if have_step and step == 0: */ /*else*/ { @@ -26084,10 +26084,10 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":837 * negative_step = have_step != 0 and step < 0 - * + * * if have_step and step == 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) - * + * */ __pyx_t_1 = (__pyx_v_have_step != 0); if (__pyx_t_1) { @@ -26101,26 +26101,26 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":838 - * + * * 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, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error) /* "View.MemoryView":837 * 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) - * + * */ } /* "View.MemoryView":841 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape @@ -26129,7 +26129,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":842 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape @@ -26176,7 +26176,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":842 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape @@ -26247,8 +26247,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L12:; /* "View.MemoryView":841 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape @@ -26290,7 +26290,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< - * + * * if have_stop: */ /*else*/ { @@ -26302,7 +26302,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":857 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape @@ -26311,7 +26311,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":858 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape @@ -26358,7 +26358,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":858 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape @@ -26398,7 +26398,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":857 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape @@ -26440,7 +26440,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< - * + * * if not have_step: */ /*else*/ { @@ -26452,100 +26452,100 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":870 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":871 - * + * * if not have_step: * step = 1 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_step = 1; /* "View.MemoryView":870 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ } /* "View.MemoryView":875 - * + * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< - * + * * if (stop - start) - step * new_shape: */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); /* "View.MemoryView":877 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { /* "View.MemoryView":878 - * + * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< - * + * * if new_shape < 0: */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); /* "View.MemoryView":877 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ } /* "View.MemoryView":880 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":881 - * + * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_new_shape = 0; /* "View.MemoryView":880 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ } /* "View.MemoryView":884 - * - * + * + * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset @@ -26553,11 +26553,11 @@ 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":885 - * + * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< * dst.suboffsets[new_ndim] = suboffset - * + * */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; @@ -26565,16 +26565,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< - * - * + * + * */ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; } __pyx_L3:; /* "View.MemoryView":889 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: @@ -26583,7 +26583,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":890 - * + * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< * else: @@ -26592,8 +26592,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); /* "View.MemoryView":889 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: @@ -26605,7 +26605,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< - * + * * if suboffset >= 0: */ /*else*/ { @@ -26616,7 +26616,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: @@ -26625,7 +26625,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":895 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: @@ -26684,7 +26684,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L26:; /* "View.MemoryView":895 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: @@ -26697,7 +26697,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< - * + * * return 0 */ /*else*/ { @@ -26707,7 +26707,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: @@ -26716,16 +26716,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":904 * suboffset_dim[0] = new_ndim - * + * * return 0 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":807 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, @@ -26749,7 +26749,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":910 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: @@ -26787,14 +26787,14 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< * cdef char *resultp - * + * */ __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":916 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize @@ -26803,7 +26803,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P if (__pyx_t_2) { /* "View.MemoryView":917 - * + * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< * stride = itemsize @@ -26830,7 +26830,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":916 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize @@ -26862,7 +26862,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { @@ -26871,7 +26871,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< - * + * * if index < 0: */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); @@ -26881,7 +26881,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ } } @@ -26889,7 +26889,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: @@ -26898,7 +26898,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P if (__pyx_t_2) { /* "View.MemoryView":926 - * + * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< * if index < 0: @@ -26911,7 +26911,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { @@ -26920,7 +26920,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * 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_ERR(2, 928, __pyx_L1_error) @@ -26940,13 +26940,13 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ } /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: @@ -26955,19 +26955,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":930 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":931 - * + * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * + * * resultp = bufp + index * stride */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) @@ -26984,16 +26984,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":930 * 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":933 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * resultp = bufp + index * stride # <<<<<<<<<<<<<< * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset @@ -27001,11 +27001,11 @@ 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":934 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { @@ -27014,32 +27014,32 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< - * + * * return resultp */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); /* "View.MemoryView":934 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ } /* "View.MemoryView":937 * resultp = ( resultp)[0] + suboffset - * + * * return resultp # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_resultp; goto __pyx_L0; /* "View.MemoryView":910 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: @@ -27058,11 +27058,11 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P } /* "View.MemoryView":943 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { @@ -27089,7 +27089,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< - * + * * cdef Py_ssize_t *shape = memslice.shape */ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; @@ -27097,26 +27097,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":946 * cdef int ndim = memslice.memview.view.ndim - * + * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< * cdef Py_ssize_t *strides = memslice.strides - * + * */ __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; /* "View.MemoryView":947 - * + * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; /* "View.MemoryView":951 - * + * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< * j = ndim - 1 - i @@ -27141,7 +27141,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< * shape[i], shape[j] = shape[j], shape[i] - * + * */ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); @@ -27152,7 +27152,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); @@ -27162,10 +27162,10 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":956 * shape[i], shape[j] = shape[j], shape[i] - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * */ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); if (!__pyx_t_8) { @@ -27179,40 +27179,40 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { if (__pyx_t_7) { /* "View.MemoryView":957 - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< - * + * * return 1 */ __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error) /* "View.MemoryView":956 * 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") - * + * */ } } /* "View.MemoryView":959 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * * return 1 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = 1; goto __pyx_L0; /* "View.MemoryView":943 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ /* function exit code */ @@ -27233,10 +27233,10 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ /* Python wrapper */ @@ -27255,20 +27255,20 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":977 - * + * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< - * + * * cdef convert_item_to_object(self, char *itemp): */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ /* function exit code */ @@ -27277,7 +27277,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) @@ -27294,7 +27294,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor __Pyx_RefNannySetupContext("convert_item_to_object", 0); /* "View.MemoryView":980 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) @@ -27318,7 +27318,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor goto __pyx_L0; /* "View.MemoryView":980 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) @@ -27330,7 +27330,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * 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*/ { @@ -27344,7 +27344,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) @@ -27363,7 +27363,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) @@ -27381,7 +27381,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __Pyx_RefNannySetupContext("assign_item_from_object", 0); /* "View.MemoryView":986 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) @@ -27400,7 +27400,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error) /* "View.MemoryView":986 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) @@ -27413,7 +27413,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< - * + * * @property */ /*else*/ { @@ -27425,7 +27425,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) @@ -27445,11 +27445,11 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo } /* "View.MemoryView":992 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ /* Python wrapper */ @@ -27474,7 +27474,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_XDECREF(__pyx_r); @@ -27483,11 +27483,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ goto __pyx_L0; /* "View.MemoryView":992 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ /* function exit code */ @@ -27611,7 +27611,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS } /* "View.MemoryView":999 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, @@ -27640,20 +27640,20 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1007 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { /* "View.MemoryView":1008 - * + * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -27661,18 +27661,18 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1007 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ } /* "View.MemoryView":1013 - * - * + * + * * 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_ERR(2, 1013, __pyx_L1_error) @@ -27696,28 +27696,28 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1015 * result = _memoryviewslice(None, 0, dtype_is_object) - * + * * result.from_slice = memviewslice # <<<<<<<<<<<<<< * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * */ __pyx_v_result->from_slice = __pyx_v_memviewslice; /* "View.MemoryView":1016 - * + * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< - * + * * result.from_object = ( memviewslice.memview).base */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); /* "View.MemoryView":1018 * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * * result.from_object = ( 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_ERR(2, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -27728,10 +27728,10 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_2 = 0; /* "View.MemoryView":1019 - * + * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< - * + * * result.view = memviewslice.memview.view */ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; @@ -27739,7 +27739,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1021 * result.typeinfo = memviewslice.memview.typeinfo - * + * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< * result.view.buf = memviewslice.data * result.view.ndim = ndim @@ -27748,7 +27748,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view = __pyx_t_5; /* "View.MemoryView":1022 - * + * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< * result.view.ndim = ndim @@ -27770,7 +27770,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; @@ -27778,14 +27778,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: */ Py_INCREF(Py_None); /* "View.MemoryView":1027 * Py_INCREF(Py_None) - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: @@ -27794,7 +27794,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl if (__pyx_t_1) { /* "View.MemoryView":1028 - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< * else: @@ -27804,7 +27804,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1027 * Py_INCREF(Py_None) - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: @@ -27816,7 +27816,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< - * + * * result.view.shape = result.from_slice.shape */ /*else*/ { @@ -27826,25 +27826,25 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS_RO - * + * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< * result.view.strides = result.from_slice.strides - * + * */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); /* "View.MemoryView":1033 - * + * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); /* "View.MemoryView":1036 - * - * + * + * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: @@ -27852,7 +27852,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view.suboffsets = NULL; /* "View.MemoryView":1037 - * + * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: @@ -27878,7 +27878,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); @@ -27886,7 +27886,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< - * + * * result.view.len = result.view.itemsize */ goto __pyx_L6_break; @@ -27904,7 +27904,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1042 * break - * + * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< * for length in result.view.shape[:ndim]: * result.view.len *= length @@ -27913,11 +27913,11 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view.len = __pyx_t_9; /* "View.MemoryView":1043 - * + * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< * result.view.len *= length - * + * */ __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++) { @@ -27931,7 +27931,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< - * + * * result.to_object_func = to_object_func */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error) @@ -27946,27 +27946,27 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1046 * result.view.len *= length - * + * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< * result.to_dtype_func = to_dtype_func - * + * */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; /* "View.MemoryView":1047 - * + * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< - * + * * return result */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; /* "View.MemoryView":1049 * result.to_dtype_func = to_dtype_func - * + * * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') */ __Pyx_XDECREF(__pyx_r); @@ -27975,7 +27975,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl goto __pyx_L0; /* "View.MemoryView":999 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, @@ -27997,7 +27997,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } /* "View.MemoryView":1052 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: @@ -28023,7 +28023,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * obj = memview * return &obj.from_slice */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __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) { @@ -28064,7 +28064,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< * return mslice - * + * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); @@ -28073,7 +28073,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_slice_copy') */ __pyx_r = __pyx_v_mslice; @@ -28081,7 +28081,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p } /* "View.MemoryView":1052 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: @@ -28100,7 +28100,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p } /* "View.MemoryView":1063 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim @@ -28122,7 +28122,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem /* "View.MemoryView":1067 * cdef (Py_ssize_t*) shape, strides, suboffsets - * + * * shape = memview.view.shape # <<<<<<<<<<<<<< * strides = memview.view.strides * suboffsets = memview.view.suboffsets @@ -28131,11 +28131,11 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_v_shape = __pyx_t_1; /* "View.MemoryView":1068 - * + * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< * suboffsets = memview.view.suboffsets - * + * */ __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; @@ -28144,7 +28144,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< - * + * * dst.memview = <__pyx_memoryview *> memview */ __pyx_t_1 = __pyx_v_memview->view.suboffsets; @@ -28152,25 +28152,25 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem /* "View.MemoryView":1071 * suboffsets = memview.view.suboffsets - * + * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< * dst.data = memview.view.buf - * + * */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); /* "View.MemoryView":1072 - * + * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< - * + * * for dim in range(memview.view.ndim): */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); /* "View.MemoryView":1074 * dst.data = memview.view.buf - * + * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] @@ -28181,7 +28181,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_v_dim = __pyx_t_4; /* "View.MemoryView":1075 - * + * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< * dst.strides[dim] = strides[dim] @@ -28194,7 +28194,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 - * + * */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); @@ -28202,7 +28202,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object') */ if ((__pyx_v_suboffsets != 0)) { @@ -28214,7 +28214,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem } /* "View.MemoryView":1063 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim @@ -28226,7 +28226,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem } /* "View.MemoryView":1080 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" @@ -28248,7 +28248,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< * return memoryview_copy_from_slice(memview, &memviewslice) - * + * */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); @@ -28256,7 +28256,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); @@ -28267,7 +28267,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx goto __pyx_L0; /* "View.MemoryView":1080 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" @@ -28286,7 +28286,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx } /* "View.MemoryView":1087 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ @@ -28310,17 +28310,17 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1094 * 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), __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":1095 - * + * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func @@ -28341,7 +28341,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1094 * 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 @@ -28354,7 +28354,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL # <<<<<<<<<<<<<< * to_dtype_func = NULL - * + * */ /*else*/ { __pyx_v_to_object_func = NULL; @@ -28363,7 +28363,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, */ __pyx_v_to_dtype_func = NULL; @@ -28372,7 +28372,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1101 * to_dtype_func = NULL - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< * to_object_func, to_dtype_func, * memview.dtype_is_object) @@ -28383,8 +28383,8 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * 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_ERR(2, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -28393,7 +28393,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview goto __pyx_L0; /* "View.MemoryView":1087 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ @@ -28412,8 +28412,8 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview } /* "View.MemoryView":1109 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg @@ -28424,7 +28424,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { int __pyx_t_1; /* "View.MemoryView":1110 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg @@ -28444,7 +28444,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { goto __pyx_L0; /* "View.MemoryView":1110 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg @@ -28456,7 +28456,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { * return -arg * else: * return arg # <<<<<<<<<<<<<< - * + * * @cname('__pyx_get_best_slice_order') */ /*else*/ { @@ -28465,8 +28465,8 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { } /* "View.MemoryView":1109 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg @@ -28478,7 +28478,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { } /* "View.MemoryView":1116 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ @@ -28500,7 +28500,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< * cdef Py_ssize_t f_stride = 0 - * + * */ __pyx_v_c_stride = 0; @@ -28508,14 +28508,14 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ __pyx_v_f_stride = 0; /* "View.MemoryView":1124 * 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] @@ -28524,7 +28524,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1125 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] @@ -28538,7 +28538,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -28546,13 +28546,13 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ goto __pyx_L4_break; /* "View.MemoryView":1125 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] @@ -28564,7 +28564,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1129 * break - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] @@ -28575,7 +28575,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1130 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] @@ -28589,7 +28589,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -28597,13 +28597,13 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ goto __pyx_L7_break; /* "View.MemoryView":1130 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] @@ -28615,7 +28615,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1134 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: @@ -28624,7 +28624,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ if (__pyx_t_2) { /* "View.MemoryView":1135 - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< * else: @@ -28635,7 +28635,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1134 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: @@ -28646,7 +28646,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< - * + * * @cython.cdivision(True) */ /*else*/ { @@ -28655,7 +28655,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } /* "View.MemoryView":1116 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ @@ -28668,7 +28668,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } /* "View.MemoryView":1140 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, @@ -28689,7 +28689,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v Py_ssize_t __pyx_t_6; /* "View.MemoryView":1147 - * + * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_extent = dst_shape[0] @@ -28711,7 +28711,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); @@ -28719,14 +28719,14 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): @@ -28735,7 +28735,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v if (__pyx_t_1) { /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -28770,7 +28770,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_L5_bool_binop_done:; /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -28788,7 +28788,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -28842,7 +28842,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): @@ -28877,7 +28877,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride - * + * */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); @@ -28885,7 +28885,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, */ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); @@ -28894,7 +28894,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_L3:; /* "View.MemoryView":1140 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, @@ -28906,7 +28906,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* "View.MemoryView":1170 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: @@ -28919,13 +28919,13 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< * src.shape, dst.shape, ndim, itemsize) - * + * */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1170 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: @@ -28935,7 +28935,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi } /* "View.MemoryView":1177 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" @@ -28955,7 +28955,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< - * + * * for shape in src.shape[:ndim]: */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; @@ -28963,10 +28963,10 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr /* "View.MemoryView":1181 * cdef Py_ssize_t shape, size = src.memview.view.itemsize - * + * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< * size *= shape - * + * */ __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { @@ -28974,10 +28974,10 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_v_shape = (__pyx_t_2[0]); /* "View.MemoryView":1182 - * + * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< - * + * * return size */ __pyx_v_size = (__pyx_v_size * __pyx_v_shape); @@ -28985,16 +28985,16 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr /* "View.MemoryView":1184 * size *= shape - * + * * return size # <<<<<<<<<<<<<< - * + * * @cname('__pyx_fill_contig_strides_array') */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "View.MemoryView":1177 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" @@ -29007,7 +29007,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr } /* "View.MemoryView":1187 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, @@ -29024,7 +29024,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1196 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride @@ -29033,7 +29033,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ if (__pyx_t_1) { /* "View.MemoryView":1197 - * + * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< * strides[idx] = stride @@ -29065,7 +29065,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1196 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride @@ -29089,7 +29089,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< * stride *= shape[idx] - * + * */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; @@ -29097,7 +29097,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< - * + * * return stride */ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); @@ -29107,16 +29107,16 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1205 * stride *= shape[idx] - * + * * return stride # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_data_to_temp') */ __pyx_r = __pyx_v_stride; goto __pyx_L0; /* "View.MemoryView":1187 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, @@ -29129,7 +29129,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ } /* "View.MemoryView":1208 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, @@ -29154,26 +29154,26 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1219 * cdef void *result - * + * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef size_t size = slice_get_size(src, ndim) - * + * */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1220 - * + * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< - * + * * result = malloc(size) */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); /* "View.MemoryView":1222 * cdef size_t size = slice_get_size(src, ndim) - * + * * result = malloc(size) # <<<<<<<<<<<<<< * if not result: * _err(MemoryError, NULL) @@ -29181,11 +29181,11 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_result = malloc(__pyx_v_size); /* "View.MemoryView":1223 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { @@ -29194,23 +29194,23 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error) /* "View.MemoryView":1223 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ } /* "View.MemoryView":1227 - * - * + * + * * tmpslice.data = result # <<<<<<<<<<<<<< * tmpslice.memview = src.memview * for i in range(ndim): @@ -29218,7 +29218,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_tmpslice->data = ((char *)__pyx_v_result); /* "View.MemoryView":1228 - * + * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< * for i in range(ndim): @@ -29244,7 +29244,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< * tmpslice.suboffsets[i] = -1 - * + * */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); @@ -29252,7 +29252,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * 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]) = -1L; @@ -29260,16 +29260,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1233 * tmpslice.suboffsets[i] = -1 - * + * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< * ndim, order) - * + * */ (void)(__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":1237 - * - * + * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 @@ -29280,11 +29280,11 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1238 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { @@ -29293,24 +29293,24 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< - * + * * if slice_is_contig(src[0], order, ndim): */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; /* "View.MemoryView":1238 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ } } /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: @@ -29319,7 +29319,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, if (__pyx_t_2) { /* "View.MemoryView":1242 - * + * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< * else: @@ -29329,7 +29329,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: @@ -29341,7 +29341,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< - * + * * return result */ /*else*/ { @@ -29351,16 +29351,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1246 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "View.MemoryView":1208 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, @@ -29384,7 +29384,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } /* "View.MemoryView":1251 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: @@ -29410,7 +29410,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent * 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_ERR(2, 1254, __pyx_L1_error) @@ -29436,7 +29436,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent * 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_ERR(2, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -29449,7 +29449,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent __PYX_ERR(2, 1253, __pyx_L1_error) /* "View.MemoryView":1251 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: @@ -29472,11 +29472,11 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent } /* "View.MemoryView":1257 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { @@ -29499,7 +29499,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, * @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_ERR(2, 1258, __pyx_L1_error) @@ -29532,11 +29532,11 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __PYX_ERR(2, 1258, __pyx_L1_error) /* "View.MemoryView":1257 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ /* function exit code */ @@ -29556,7 +29556,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, } /* "View.MemoryView":1261 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: @@ -29633,7 +29633,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_contents') */ /*else*/ { @@ -29642,7 +29642,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { } /* "View.MemoryView":1261 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: @@ -29666,7 +29666,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { } /* "View.MemoryView":1268 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, @@ -29737,13 +29737,13 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice tmp - * + * */ __pyx_v_direct_copy = 0; /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: @@ -29752,7 +29752,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_2) { /* "View.MemoryView":1285 - * + * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< * elif dst_ndim < src_ndim: @@ -29762,7 +29762,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: @@ -29775,7 +29775,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { @@ -29784,7 +29784,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< - * + * * cdef int ndim = max(src_ndim, dst_ndim) */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); @@ -29794,16 +29794,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ } __pyx_L3:; /* "View.MemoryView":1289 * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ __pyx_t_3 = __pyx_v_dst_ndim; @@ -29817,7 +29817,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1291 * cdef int ndim = max(src_ndim, dst_ndim) - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: @@ -29828,7 +29828,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1292 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: @@ -29879,7 +29879,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< - * + * * if src.suboffsets[i] >= 0: */ /*else*/ { @@ -29888,7 +29888,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_L7:; /* "View.MemoryView":1292 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: @@ -29898,38 +29898,38 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":1300 - * + * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< - * + * * if slices_overlap(&src, &dst, ndim, itemsize): */ __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error) /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ } } /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); @@ -29937,73 +29937,73 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1305 - * + * * 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); /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ } /* "View.MemoryView":1307 * order = get_best_order(&dst, ndim) - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp - * + * */ __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; /* "View.MemoryView":1308 - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< - * + * * if not broadcasting: */ __pyx_v_src = __pyx_v_tmp; /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ } /* "View.MemoryView":1310 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1313 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): @@ -30012,7 +30012,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_2) { /* "View.MemoryView":1314 - * + * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< * elif slice_is_contig(src, 'F', ndim): @@ -30021,8 +30021,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); /* "View.MemoryView":1313 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): @@ -30035,7 +30035,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * */ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { @@ -30044,7 +30044,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * 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); @@ -30054,16 +30054,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * 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":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ __pyx_t_2 = (__pyx_v_direct_copy != 0); @@ -30071,7 +30071,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1320 * if direct_copy: - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) @@ -30079,7 +30079,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":1321 - * + * * 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) @@ -30101,7 +30101,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ free(__pyx_v_tmpdata); @@ -30109,7 +30109,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * if order == 'F' == get_best_order(&dst, ndim): */ __pyx_r = 0; @@ -30117,28 +30117,28 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ } /* "View.MemoryView":1310 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":1326 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = (__pyx_v_order == 'F'); if (__pyx_t_2) { @@ -30148,35 +30148,35 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_8) { /* "View.MemoryView":1329 - * - * + * + * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) - * + * */ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error) /* "View.MemoryView":1330 - * + * * 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 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error) /* "View.MemoryView":1326 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":1332 * transpose_memslice(&dst) - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) @@ -30184,11 +30184,11 @@ 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":1333 - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); @@ -30196,32 +30196,32 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * + * * free(tmpdata) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1336 * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ free(__pyx_v_tmpdata); /* "View.MemoryView":1337 - * + * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_broadcast_leading') */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":1268 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, @@ -30245,7 +30245,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } /* "View.MemoryView":1340 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, @@ -30263,14 +30263,14 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); /* "View.MemoryView":1346 * cdef int offset = ndim_other - ndim - * + * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] @@ -30279,7 +30279,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1347 - * + * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< * mslice.strides[i + offset] = mslice.strides[i] @@ -30292,7 +30292,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -30300,7 +30300,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * 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_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); @@ -30308,7 +30308,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic /* "View.MemoryView":1351 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * * for i in range(offset): # <<<<<<<<<<<<<< * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] @@ -30319,7 +30319,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1352 - * + * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< * mslice.strides[i] = mslice.strides[0] @@ -30332,7 +30332,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< * mslice.suboffsets[i] = -1 - * + * */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); @@ -30340,14 +30340,14 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * - * + * + * */ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } /* "View.MemoryView":1340 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, @@ -30358,19 +30358,19 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic } /* "View.MemoryView":1362 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; /* "View.MemoryView":1366 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) @@ -30379,17 +30379,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i if (__pyx_t_1) { /* "View.MemoryView":1367 - * + * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< * dst.strides, ndim, inc) - * + * */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1366 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) @@ -30397,18 +30397,18 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i } /* "View.MemoryView":1362 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ /* function exit code */ } /* "View.MemoryView":1371 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -30426,13 +30426,13 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1371 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -30447,7 +30447,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da } /* "View.MemoryView":1377 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): @@ -30465,7 +30465,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss /* "View.MemoryView":1381 * cdef Py_ssize_t i - * + * * for i in range(shape[0]): # <<<<<<<<<<<<<< * if ndim == 1: * if inc: @@ -30476,7 +30476,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1382 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: @@ -30527,7 +30527,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_L6:; /* "View.MemoryView":1382 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: @@ -30541,7 +30541,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< * ndim - 1, inc) - * + * */ /*else*/ { @@ -30549,7 +30549,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * 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); @@ -30558,16 +30558,16 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss /* "View.MemoryView":1391 * ndim - 1, inc) - * + * * data += strides[0] # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } /* "View.MemoryView":1377 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): @@ -30579,7 +30579,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } /* "View.MemoryView":1397 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, @@ -30610,13 +30610,13 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1397 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, @@ -30627,7 +30627,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst } /* "View.MemoryView":1407 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -30648,7 +30648,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t extent = shape[0] - * + * */ __pyx_v_stride = (__pyx_v_strides[0]); @@ -30656,14 +30656,14 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ __pyx_v_extent = (__pyx_v_shape[0]); /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) @@ -30672,7 +30672,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t if (__pyx_t_1) { /* "View.MemoryView":1415 - * + * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< * memcpy(data, item, itemsize) @@ -30704,7 +30704,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) @@ -30738,8 +30738,8 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } @@ -30747,7 +30747,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_L3:; /* "View.MemoryView":1407 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -32104,8 +32104,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "pytesmo/metrics/_fast_pairwise.pyx":11 - * - * + * + * * cpdef _moments_welford(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -32121,7 +32121,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_umath() except -1: */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 947, __pyx_L1_error) @@ -32132,7 +32132,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_ufunc() except -1: */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 953, __pyx_L1_error) @@ -32140,10 +32140,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__6); /* "View.MemoryView":133 - * + * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * + * * if itemsize <= 0: */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 133, __pyx_L1_error) @@ -32151,10 +32151,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__7); /* "View.MemoryView":136 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 136, __pyx_L1_error) @@ -32162,11 +32162,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__8); /* "View.MemoryView":148 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); @@ -32176,7 +32176,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 176, __pyx_L1_error) @@ -32217,7 +32217,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< - * + * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 418, __pyx_L1_error) @@ -32239,7 +32239,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_ND: */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 520, __pyx_L1_error) @@ -32248,9 +32248,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "View.MemoryView":570 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 570, __pyx_L1_error) @@ -32261,7 +32261,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * 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__18 = PyTuple_New(1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 577, __pyx_L1_error) @@ -32305,8 +32305,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * 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_ERR(2, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); @@ -32332,8 +32332,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__24); /* "pytesmo/metrics/_fast_pairwise.pyx":11 - * - * + * + * * cpdef _moments_welford(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -32344,8 +32344,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0_moments_welford, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 11, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":48 - * - * + * + * * cpdef bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Difference of the mean values. @@ -32356,8 +32356,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0bias, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 48, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":73 - * - * + * + * * cpdef RSS(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Residual sum of squares. @@ -32368,8 +32368,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0RSS, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 73, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":97 - * - * + * + * * cpdef mse_corr(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Correlation component of MSE. @@ -32380,8 +32380,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0mse_corr, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 97, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":132 - * - * + * + * * cpdef _mse_corr_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -32392,8 +32392,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0_mse_corr_from_momen, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 132, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":139 - * - * + * + * * cpdef mse_var(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Variance component of MSE. @@ -32404,8 +32404,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0mse_var, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 139, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":174 - * - * + * + * * cpdef _mse_var_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -32416,8 +32416,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0_mse_var_from_moment, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 174, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":180 - * - * + * + * * cpdef mse_bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Bias component of MSE. @@ -32428,8 +32428,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0mse_bias, 180, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 180, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":212 - * - * + * + * * cpdef _mse_bias_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -32452,8 +32452,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0mse_decomposition, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 224, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":276 - * - * + * + * * cpdef _ubrmsd(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Unbiased root-mean-square deviation (uRMSD). @@ -32464,11 +32464,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pytesmo_metrics__fast_pairwi, __pyx_n_s_pyx_fuse_0_ubrmsd, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 276, __pyx_L1_error) /* "pytesmo/metrics/_fast_pairwise.pyx":322 - * - * + * + * * cpdef _pearsonr_from_moments(floating varx, floating vary, floating cov, int n): # <<<<<<<<<<<<<< * cdef floating R, p_R, t_squared, df, z - * + * */ __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_varx, __pyx_n_s_vary, __pyx_n_s_cov, __pyx_n_s_n); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); @@ -32489,7 +32489,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "View.MemoryView":286 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") @@ -32499,11 +32499,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__51); /* "View.MemoryView":287 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); @@ -32513,30 +32513,30 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "View.MemoryView":291 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "View.MemoryView":292 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); @@ -32686,7 +32686,7 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else @@ -32971,8 +32971,8 @@ if (!__Pyx_RefNanny) { * from cython cimport floating * from libc.math cimport sqrt, fabs * from scipy.special.cython_special import betainc # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -32989,8 +32989,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":11 - * - * + * + * * cpdef _moments_welford(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Calculates means, variances, and covariance of the given input array using @@ -33017,8 +33017,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":48 - * - * + * + * * cpdef bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Difference of the mean values. @@ -33045,8 +33045,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":73 - * - * + * + * * cpdef RSS(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * """ * Residual sum of squares. @@ -33073,8 +33073,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":97 - * - * + * + * * cpdef mse_corr(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Correlation component of MSE. @@ -33101,8 +33101,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":132 - * - * + * + * * cpdef _mse_corr_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -33129,8 +33129,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":139 - * - * + * + * * cpdef mse_var(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Variance component of MSE. @@ -33157,8 +33157,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":174 - * - * + * + * * cpdef _mse_var_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -33185,8 +33185,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":180 - * - * + * + * * cpdef mse_bias(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Bias component of MSE. @@ -33213,8 +33213,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":212 - * - * + * + * * cpdef _mse_bias_from_moments( # <<<<<<<<<<<<<< * floating mx, floating my, floating vx, floating vy, floating cov * ): @@ -33269,8 +33269,8 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":276 - * - * + * + * * cpdef _ubrmsd(floating [:] x, floating [:] y): # <<<<<<<<<<<<<< * r""" * Unbiased root-mean-square deviation (uRMSD). @@ -33297,11 +33297,11 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pytesmo/metrics/_fast_pairwise.pyx":322 - * - * + * + * * cpdef _pearsonr_from_moments(floating varx, floating vary, floating cov, int n): # <<<<<<<<<<<<<< * cdef floating R, p_R, t_squared, df, z - * + * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -33364,9 +33364,9 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":209 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * + * * def __dealloc__(array self): */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 209, __pyx_L1_error) @@ -33377,7 +33377,7 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":286 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") @@ -33390,11 +33390,11 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":287 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -33407,8 +33407,8 @@ if (!__Pyx_RefNanny) { * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -33418,11 +33418,11 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":291 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -33432,11 +33432,11 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":292 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -33446,7 +33446,7 @@ if (!__Pyx_RefNanny) { __pyx_t_1 = 0; /* "View.MemoryView":316 - * + * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ @@ -33473,10 +33473,10 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":549 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -33486,10 +33486,10 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":995 * return self.from_object - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -36256,8 +36256,8 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED llx = lla + llb; return PyLong_FromLongLong(llx); #endif - - + + } #endif if (PyFloat_CheckExact(op1)) { diff --git a/src/pytesmo/metrics/deprecated.py b/src/pytesmo/metrics/deprecated.py index 2f0afa43..833a90cb 100644 --- a/src/pytesmo/metrics/deprecated.py +++ b/src/pytesmo/metrics/deprecated.py @@ -13,7 +13,7 @@ __all__ = [] -@deprecated +@deprecated() def tcol_error(x, y, z): """ DEPRECATED: Use ``pytesmo.metrics.tcol_metrics`` instead. @@ -68,7 +68,7 @@ def tcol_error(x, y, z): @np.errstate(invalid="ignore") -@deprecated +@deprecated() def tcol_snr(x, y, z, ref_ind=0): """ DEPRECATED: Use the function `tcol_metrics` instead. @@ -195,7 +195,7 @@ def tcol_snr(x, y, z, ref_ind=0): return snr, np.sqrt(err_var) * beta, beta -@deprecated +@deprecated() def mse(x, y, ddof=0): """ DEPRECATED: use `msd`, `msd_corr`, `msd_bias`, or `msd_var` for the @@ -245,7 +245,7 @@ def mse(x, y, ddof=0): return mse, mse_corr, mse_bias, mse_var -@deprecated +@deprecated() def pearsonr(x, y): """ DEPRECATED: use :func:`pytesmo.metrics.pearson_r` instead if you want @@ -275,7 +275,7 @@ def pearsonr(x, y): @np.errstate(invalid="ignore") -@deprecated +@deprecated() def pearsonr_recursive( x, y, n_old=0, sum_xi_yi=0, sum_xi=0, sum_yi=0, sum_x2=0, sum_y2=0 ): @@ -336,7 +336,7 @@ def pearsonr_recursive( return r, (n_new, sum_xi_yi, sum_xi, sum_yi, sum_x2, sum_y2) -@deprecated +@deprecated() def pearson_conf(r, n, c=95): """ DEPRECATED: use :func:`pytesmo.metrics.pearson_r` instead. @@ -376,7 +376,7 @@ def pearson_conf(r, n, c=95): return np.tanh(z_lower), np.tanh(z_upper) -@deprecated +@deprecated() def spearmanr(x, y): """ DEPRECATED: use :func:`pytesmo.metrics.spearman_r` instead if you @@ -407,7 +407,7 @@ def spearmanr(x, y): return stats.spearmanr(x, y) -@deprecated +@deprecated() def kendalltau(x, y): """ DEPRECATED: use :func:`pytesmo.metrics.kendall_tau` instead if you want @@ -479,8 +479,8 @@ def rolling_pr_rmsd(timestamps, data, window_size, center, min_periods): if n_obs == 0 or n_obs < min_periods: pr_arr[i, :] = np.nan else: - sub1 = data[idx[0]:idx[-1]+1, 0] - sub2 = data[idx[0]:idx[-1]+1, 1] + sub1 = data[idx[0]: idx[-1] + 1, 0] + sub2 = data[idx[0]: idx[-1] + 1, 1] # pearson r pr_arr[i, 0] = np.corrcoef(sub1, sub2)[0, 1] @@ -489,15 +489,19 @@ def rolling_pr_rmsd(timestamps, data, window_size, center, min_periods): if np.abs(pr_arr[i, 0]) == 1.0: pr_arr[i, 1] = 0.0 else: - df = n_obs - 2. - t_squared = pr_arr[i, 0]*pr_arr[i, 0] * \ - (df / ((1.0 - pr_arr[i, 0]) * (1.0 + pr_arr[i, 0]))) + df = n_obs - 2.0 + t_squared = ( + pr_arr[i, 0] + * pr_arr[i, 0] + * (df / ((1.0 - pr_arr[i, 0]) * (1.0 + pr_arr[i, 0]))) + ) x = df / (df + t_squared) x = np.ma.where(x < 1.0, x, 1.0) - pr_arr[i, 1] = betainc(0.5*df, 0.5, x) + pr_arr[i, 1] = betainc(0.5 * df, 0.5, x) # rmsd rmsd_arr[i] = np.sqrt( - np.sum((sub1 - sub2) ** 2) / (sub1.size - ddof)) + np.sum((sub1 - sub2) ** 2) / (sub1.size - ddof) + ) return pr_arr, rmsd_arr diff --git a/src/pytesmo/scaling.py b/src/pytesmo/scaling.py index 6aeb98ec..c10d04ab 100644 --- a/src/pytesmo/scaling.py +++ b/src/pytesmo/scaling.py @@ -250,7 +250,7 @@ def mean_std(src, ref, **kwargs): return ((src - np.mean(src)) / np.std(src)) * np.std(ref) + np.mean(ref) -@utils.deprecated +@utils.deprecated() def lin_cdf_match( src, ref, @@ -347,7 +347,7 @@ def lin_cdf_match_stored_params( ) -@utils.deprecated +@utils.deprecated() def cdf_match( src, ref, min_val=None, max_val=None, nbins=100, minobs=None, **kwargs ): diff --git a/src/pytesmo/time_series/filters.c b/src/pytesmo/time_series/filters.c index bfbc6b92..6c7835c6 100644 --- a/src/pytesmo/time_series/filters.c +++ b/src/pytesmo/time_series/filters.c @@ -10,14 +10,14 @@ ] ], "depends": [ - "/tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h", - "/tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h", - "/tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h", - "/tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h", - "/tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h" + "/home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h", + "/home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h", + "/home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h", + "/home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h", + "/home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h" ], "include_dirs": [ - "/tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/core/include" + "/home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/core/include" ], "name": "pytesmo.time_series.filters", "sources": [ @@ -644,7 +644,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "numpy/ufuncobject.h" /* NumPy API declarations from "numpy/__init__.pxd" */ - + #include #include "pythread.h" #include @@ -993,17 +993,17 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #define __Pyx_FastGilFuncInit() -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":690 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":690 * # in Cython to enable them only on the right systems. - * + * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":691 - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":691 + * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< * ctypedef npy_int32 int32_t @@ -1011,7 +1011,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":692 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -1020,7 +1020,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":693 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":693 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1029,17 +1029,17 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":697 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":697 * #ctypedef npy_int128 int128_t - * + * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":698 - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":698 + * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< * ctypedef npy_uint32 uint32_t @@ -1047,7 +1047,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":699 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1056,7 +1056,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":700 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":700 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1065,17 +1065,17 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":704 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":704 * #ctypedef npy_uint128 uint128_t - * + * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t * #ctypedef npy_float80 float80_t */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":705 - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":705 + * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< * #ctypedef npy_float80 float80_t @@ -1083,7 +1083,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":714 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":714 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1092,92 +1092,92 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":715 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":715 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< * ctypedef npy_longlong longlong_t - * + * */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":716 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":716 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_ulong uint_t */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":718 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":718 * ctypedef npy_longlong longlong_t - * + * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":719 - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":719 + * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t - * + * */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":720 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":720 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":722 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":722 * ctypedef npy_ulonglong ulonglong_t - * + * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< * ctypedef npy_uintp uintp_t - * + * */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":723 - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":723 + * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_double float_t */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":725 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":725 * ctypedef npy_uintp uintp_t - * + * * ctypedef npy_double float_t # <<<<<<<<<<<<<< * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":726 - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":726 + * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< * ctypedef npy_longdouble longdouble_t - * + * */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":727 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":727 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cfloat cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; @@ -1212,38 +1212,38 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":729 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":729 * ctypedef npy_longdouble longdouble_t - * + * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":730 - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":730 + * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< * ctypedef npy_clongdouble clongdouble_t - * + * */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":731 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":731 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * + * * ctypedef npy_cdouble complex_t */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":733 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":733 * ctypedef npy_clongdouble clongdouble_t - * + * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; @@ -1305,10 +1305,10 @@ struct __pyx_defaults7 { }; /* "View.MemoryView":105 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ struct __pyx_array_obj { @@ -1330,7 +1330,7 @@ struct __pyx_array_obj { /* "View.MemoryView":279 - * + * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< * cdef object name @@ -1343,10 +1343,10 @@ struct __pyx_MemviewEnum_obj { /* "View.MemoryView":330 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ struct __pyx_memoryview_obj { @@ -1366,11 +1366,11 @@ struct __pyx_memoryview_obj { /* "View.MemoryView":965 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ struct __pyx_memoryviewslice_obj { struct __pyx_memoryview_obj __pyx_base; @@ -1383,10 +1383,10 @@ struct __pyx_memoryviewslice_obj { /* "View.MemoryView":105 - * + * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< - * + * * cdef: */ @@ -1397,10 +1397,10 @@ static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; /* "View.MemoryView":330 - * + * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< - * + * * cdef object obj */ @@ -1417,11 +1417,11 @@ static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; /* "View.MemoryView":965 - * + * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" - * + * */ struct __pyx_vtabstruct__memoryviewslice { @@ -3064,7 +3064,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_exp_filter(CYTHON_UNUS __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) @@ -3073,14 +3073,14 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_exp_filter(CYTHON_UNUS __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 49, __pyx_L1_error) @@ -3174,16 +3174,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_exp_filter(CYTHON_UNUS __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 49, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -3196,16 +3196,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_exp_filter(CYTHON_UNUS __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 49, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 49, __pyx_L1_error) @@ -3561,7 +3561,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); + __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; @@ -3607,16 +3607,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU * cdef double last_filtered_var * cdef unsigned int i * cdef int found_index = -1 # <<<<<<<<<<<<<< - * + * * filtered.fill(np.nan) */ __pyx_v_found_index = -1; /* "pytesmo/time_series/filters.pyx":79 * cdef int found_index = -1 - * + * * filtered.fill(np.nan) # <<<<<<<<<<<<<< - * + * * # find the first non nan value in the time series */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_filtered), __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) @@ -3646,9 +3646,9 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":83 * # find the first non nan value in the time series - * + * * for i in range(in_jd.shape[0]): # <<<<<<<<<<<<<< - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) */ __pyx_t_7 = (__pyx_v_in_jd.shape[0]); @@ -3658,7 +3658,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":85 * for i in range(in_jd.shape[0]): - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) # <<<<<<<<<<<<<< * if not is_nan: * last_jd_var = in_jd[i] @@ -3677,7 +3677,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU __pyx_v_is_nan = __pyx_t_10; /* "pytesmo/time_series/filters.pyx":86 - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) * if not is_nan: # <<<<<<<<<<<<<< * last_jd_var = in_jd[i] @@ -3722,7 +3722,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU * filtered[i] = in_data[i] * found_index = i # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_found_index = __pyx_v_i; @@ -3730,13 +3730,13 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU * filtered[i] = in_data[i] * found_index = i * break # <<<<<<<<<<<<<< - * + * * if found_index > -1: */ goto __pyx_L4_break; /* "pytesmo/time_series/filters.pyx":86 - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) * if not is_nan: # <<<<<<<<<<<<<< * last_jd_var = in_jd[i] @@ -3748,9 +3748,9 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":94 * break - * + * * if found_index > -1: # <<<<<<<<<<<<<< - * + * * for index in range(found_index + 1, in_jd.shape[0]): */ __pyx_t_10 = ((__pyx_v_found_index > -1L) != 0); @@ -3758,7 +3758,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":96 * if found_index > -1: - * + * * for index in range(found_index + 1, in_jd.shape[0]): # <<<<<<<<<<<<<< * is_nan = (in_data[index] == nan) or isnan(in_data[index]) * if not is_nan: @@ -3769,7 +3769,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU __pyx_v_index = __pyx_t_13; /* "pytesmo/time_series/filters.pyx":97 - * + * * for index in range(found_index + 1, in_jd.shape[0]): * is_nan = (in_data[index] == nan) or isnan(in_data[index]) # <<<<<<<<<<<<<< * if not is_nan: @@ -3850,7 +3850,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU * ) * last_jd_var = in_jd[index] # <<<<<<<<<<<<<< * last_filtered_var = filtered[index] - * + * */ __pyx_t_14 = __pyx_v_index; __pyx_v_last_jd_var = (*((float *) ( /* dim=0 */ (__pyx_v_in_jd.data + __pyx_t_14 * __pyx_v_in_jd.strides[0]) ))); @@ -3859,7 +3859,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU * ) * last_jd_var = in_jd[index] * last_filtered_var = filtered[index] # <<<<<<<<<<<<<< - * + * * return filtered */ __pyx_t_14 = __pyx_v_index; @@ -3877,19 +3877,19 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_4exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":94 * break - * + * * if found_index > -1: # <<<<<<<<<<<<<< - * + * * for index in range(found_index + 1, in_jd.shape[0]): */ } /* "pytesmo/time_series/filters.pyx":109 * last_filtered_var = filtered[index] - * + * * return filtered # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_filtered)); @@ -4129,7 +4129,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); + __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; @@ -4175,16 +4175,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU * cdef double last_filtered_var * cdef unsigned int i * cdef int found_index = -1 # <<<<<<<<<<<<<< - * + * * filtered.fill(np.nan) */ __pyx_v_found_index = -1; /* "pytesmo/time_series/filters.pyx":79 * cdef int found_index = -1 - * + * * filtered.fill(np.nan) # <<<<<<<<<<<<<< - * + * * # find the first non nan value in the time series */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_filtered), __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) @@ -4214,9 +4214,9 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":83 * # find the first non nan value in the time series - * + * * for i in range(in_jd.shape[0]): # <<<<<<<<<<<<<< - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) */ __pyx_t_7 = (__pyx_v_in_jd.shape[0]); @@ -4226,7 +4226,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":85 * for i in range(in_jd.shape[0]): - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) # <<<<<<<<<<<<<< * if not is_nan: * last_jd_var = in_jd[i] @@ -4245,7 +4245,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU __pyx_v_is_nan = __pyx_t_10; /* "pytesmo/time_series/filters.pyx":86 - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) * if not is_nan: # <<<<<<<<<<<<<< * last_jd_var = in_jd[i] @@ -4290,7 +4290,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU * filtered[i] = in_data[i] * found_index = i # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_found_index = __pyx_v_i; @@ -4298,13 +4298,13 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU * filtered[i] = in_data[i] * found_index = i * break # <<<<<<<<<<<<<< - * + * * if found_index > -1: */ goto __pyx_L4_break; /* "pytesmo/time_series/filters.pyx":86 - * + * * is_nan = (in_data[i] == nan) or isnan(in_data[i]) * if not is_nan: # <<<<<<<<<<<<<< * last_jd_var = in_jd[i] @@ -4316,9 +4316,9 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":94 * break - * + * * if found_index > -1: # <<<<<<<<<<<<<< - * + * * for index in range(found_index + 1, in_jd.shape[0]): */ __pyx_t_10 = ((__pyx_v_found_index > -1L) != 0); @@ -4326,7 +4326,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":96 * if found_index > -1: - * + * * for index in range(found_index + 1, in_jd.shape[0]): # <<<<<<<<<<<<<< * is_nan = (in_data[index] == nan) or isnan(in_data[index]) * if not is_nan: @@ -4337,7 +4337,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU __pyx_v_index = __pyx_t_13; /* "pytesmo/time_series/filters.pyx":97 - * + * * for index in range(found_index + 1, in_jd.shape[0]): * is_nan = (in_data[index] == nan) or isnan(in_data[index]) # <<<<<<<<<<<<<< * if not is_nan: @@ -4418,7 +4418,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU * ) * last_jd_var = in_jd[index] # <<<<<<<<<<<<<< * last_filtered_var = filtered[index] - * + * */ __pyx_t_14 = __pyx_v_index; __pyx_v_last_jd_var = (*((double *) ( /* dim=0 */ (__pyx_v_in_jd.data + __pyx_t_14 * __pyx_v_in_jd.strides[0]) ))); @@ -4427,7 +4427,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU * ) * last_jd_var = in_jd[index] * last_filtered_var = filtered[index] # <<<<<<<<<<<<<< - * + * * return filtered */ __pyx_t_14 = __pyx_v_index; @@ -4445,19 +4445,19 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_6exp_filter(CYTHON_UNU /* "pytesmo/time_series/filters.pyx":94 * break - * + * * if found_index > -1: # <<<<<<<<<<<<<< - * + * * for index in range(found_index + 1, in_jd.shape[0]): */ } /* "pytesmo/time_series/filters.pyx":109 * last_filtered_var = filtered[index] - * + * * return filtered # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_filtered)); @@ -4741,7 +4741,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_2boxcar_filter(CYTHON_ __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_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) @@ -4750,14 +4750,14 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_2boxcar_filter(CYTHON_ __pyx_t_6 = 0; goto __pyx_L12; } - __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); + __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_arg_base = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray); + __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_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) @@ -4851,16 +4851,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_2boxcar_filter(CYTHON_ __pyx_t_3 = __pyx_t_2; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 115, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + PyErr_Clear(); } } __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0); @@ -4873,16 +4873,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_2boxcar_filter(CYTHON_ __pyx_t_3 = __pyx_t_2; __pyx_L26_bool_binop_done:; if (__pyx_t_3) { - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_arg, 0); __pyx_v_memslice = __pyx_t_8; __pyx_t_3 = (__pyx_v_memslice.memview != 0); if (__pyx_t_3) { - __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1); + __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, 115, __pyx_L1_error) goto __pyx_L10_break; } /*else*/ { - PyErr_Clear(); + 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, 115, __pyx_L1_error) @@ -5282,7 +5282,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); + __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; @@ -5329,7 +5329,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON * cdef double sum = 0 * cdef double limit = window / 2.0 # <<<<<<<<<<<<<< * cdef int nobs = 0 - * + * */ __pyx_v_limit = (((double)__pyx_v_window) / 2.0); @@ -5337,16 +5337,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON * cdef double sum = 0 * cdef double limit = window / 2.0 * cdef int nobs = 0 # <<<<<<<<<<<<<< - * + * * filtered.fill(np.nan) */ __pyx_v_nobs = 0; /* "pytesmo/time_series/filters.pyx":144 * cdef int nobs = 0 - * + * * filtered.fill(np.nan) # <<<<<<<<<<<<<< - * + * * for i in range(in_jd.shape[0]): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_filtered), __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) @@ -5376,7 +5376,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":146 * filtered.fill(np.nan) - * + * * for i in range(in_jd.shape[0]): # <<<<<<<<<<<<<< * is_nan = (in_data[i] == nan) or isnan(in_data[i]) * if (not is_nan) or fillna: @@ -5387,7 +5387,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON __pyx_v_i = __pyx_t_9; /* "pytesmo/time_series/filters.pyx":147 - * + * * for i in range(in_jd.shape[0]): * is_nan = (in_data[i] == nan) or isnan(in_data[i]) # <<<<<<<<<<<<<< * if (not is_nan) or fillna: @@ -5538,7 +5538,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON * nobs = nobs + 1 * else: * break # <<<<<<<<<<<<<< - * + * * for j in range(i, -1, -1): */ /*else*/ { @@ -5559,7 +5559,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":161 * break - * + * * for j in range(i, -1, -1): # <<<<<<<<<<<<<< * if i != j: * is_nan = (in_data[j] == nan) or isnan(in_data[j]) @@ -5568,7 +5568,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON __pyx_v_j = __pyx_t_14; /* "pytesmo/time_series/filters.pyx":162 - * + * * for j in range(i, -1, -1): * if i != j: # <<<<<<<<<<<<<< * is_nan = (in_data[j] == nan) or isnan(in_data[j]) @@ -5661,7 +5661,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON * nobs = nobs + 1 * else: * break # <<<<<<<<<<<<<< - * + * * if nobs >= min_obs: */ /*else*/ { @@ -5679,7 +5679,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON } /* "pytesmo/time_series/filters.pyx":162 - * + * * for j in range(i, -1, -1): * if i != j: # <<<<<<<<<<<<<< * is_nan = (in_data[j] == nan) or isnan(in_data[j]) @@ -5691,19 +5691,19 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":172 * break - * + * * if nobs >= min_obs: # <<<<<<<<<<<<<< * filtered[i] = sum / nobs - * + * */ __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_min_obs) != 0); if (__pyx_t_10) { /* "pytesmo/time_series/filters.pyx":173 - * + * * if nobs >= min_obs: * filtered[i] = sum / nobs # <<<<<<<<<<<<<< - * + * * return filtered */ __pyx_t_4 = __pyx_v_i; @@ -5711,10 +5711,10 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":172 * break - * + * * if nobs >= min_obs: # <<<<<<<<<<<<<< * filtered[i] = sum / nobs - * + * */ } @@ -5730,7 +5730,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_10boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":175 * filtered[i] = sum / nobs - * + * * return filtered # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); @@ -6015,7 +6015,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); + __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_in_data); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; @@ -6062,7 +6062,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON * cdef double sum = 0 * cdef double limit = window / 2.0 # <<<<<<<<<<<<<< * cdef int nobs = 0 - * + * */ __pyx_v_limit = (((double)__pyx_v_window) / 2.0); @@ -6070,16 +6070,16 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON * cdef double sum = 0 * cdef double limit = window / 2.0 * cdef int nobs = 0 # <<<<<<<<<<<<<< - * + * * filtered.fill(np.nan) */ __pyx_v_nobs = 0; /* "pytesmo/time_series/filters.pyx":144 * cdef int nobs = 0 - * + * * filtered.fill(np.nan) # <<<<<<<<<<<<<< - * + * * for i in range(in_jd.shape[0]): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_filtered), __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) @@ -6109,7 +6109,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":146 * filtered.fill(np.nan) - * + * * for i in range(in_jd.shape[0]): # <<<<<<<<<<<<<< * is_nan = (in_data[i] == nan) or isnan(in_data[i]) * if (not is_nan) or fillna: @@ -6120,7 +6120,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON __pyx_v_i = __pyx_t_9; /* "pytesmo/time_series/filters.pyx":147 - * + * * for i in range(in_jd.shape[0]): * is_nan = (in_data[i] == nan) or isnan(in_data[i]) # <<<<<<<<<<<<<< * if (not is_nan) or fillna: @@ -6271,7 +6271,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON * nobs = nobs + 1 * else: * break # <<<<<<<<<<<<<< - * + * * for j in range(i, -1, -1): */ /*else*/ { @@ -6292,7 +6292,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":161 * break - * + * * for j in range(i, -1, -1): # <<<<<<<<<<<<<< * if i != j: * is_nan = (in_data[j] == nan) or isnan(in_data[j]) @@ -6301,7 +6301,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON __pyx_v_j = __pyx_t_14; /* "pytesmo/time_series/filters.pyx":162 - * + * * for j in range(i, -1, -1): * if i != j: # <<<<<<<<<<<<<< * is_nan = (in_data[j] == nan) or isnan(in_data[j]) @@ -6394,7 +6394,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON * nobs = nobs + 1 * else: * break # <<<<<<<<<<<<<< - * + * * if nobs >= min_obs: */ /*else*/ { @@ -6412,7 +6412,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON } /* "pytesmo/time_series/filters.pyx":162 - * + * * for j in range(i, -1, -1): * if i != j: # <<<<<<<<<<<<<< * is_nan = (in_data[j] == nan) or isnan(in_data[j]) @@ -6424,19 +6424,19 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":172 * break - * + * * if nobs >= min_obs: # <<<<<<<<<<<<<< * filtered[i] = sum / nobs - * + * */ __pyx_t_10 = ((__pyx_v_nobs >= __pyx_v_min_obs) != 0); if (__pyx_t_10) { /* "pytesmo/time_series/filters.pyx":173 - * + * * if nobs >= min_obs: * filtered[i] = sum / nobs # <<<<<<<<<<<<<< - * + * * return filtered */ __pyx_t_4 = __pyx_v_i; @@ -6444,10 +6444,10 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":172 * break - * + * * if nobs >= min_obs: # <<<<<<<<<<<<<< * filtered[i] = sum / nobs - * + * */ } @@ -6463,7 +6463,7 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON /* "pytesmo/time_series/filters.pyx":175 * filtered[i] = sum / nobs - * + * * return filtered # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); @@ -6505,12 +6505,12 @@ static PyObject *__pyx_pf_7pytesmo_11time_series_7filters_12boxcar_filter(CYTHON return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":735 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { @@ -6522,11 +6522,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":736 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":736 + * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); @@ -6536,12 +6536,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":735 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":735 * ctypedef npy_cdouble complex_t - * + * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(1, a) - * + * */ /* function exit code */ @@ -6555,12 +6555,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":738 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { @@ -6572,11 +6572,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":739 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":739 + * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); @@ -6586,12 +6586,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":738 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":738 * return PyArray_MultiIterNew(1, a) - * + * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(2, a, b) - * + * */ /* function exit code */ @@ -6605,12 +6605,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":741 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { @@ -6622,11 +6622,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":742 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":742 + * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); @@ -6636,12 +6636,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":741 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":741 * return PyArray_MultiIterNew(2, a, b) - * + * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(3, a, b, c) - * + * */ /* function exit code */ @@ -6655,12 +6655,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":744 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { @@ -6672,11 +6672,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":745 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":745 + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); @@ -6686,12 +6686,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":744 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":744 * return PyArray_MultiIterNew(3, a, b, c) - * + * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(4, a, b, c, d) - * + * */ /* function exit code */ @@ -6705,12 +6705,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":747 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { @@ -6722,11 +6722,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":748 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":748 + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): */ __Pyx_XDECREF(__pyx_r); @@ -6736,12 +6736,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":747 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":747 * return PyArray_MultiIterNew(4, a, b, c, d) - * + * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * */ /* function exit code */ @@ -6755,9 +6755,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":750 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -6769,8 +6769,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":751 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -6779,7 +6779,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); if (__pyx_t_1) { - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":752 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":752 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -6791,8 +6791,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":751 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":751 + * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< * return d.subarray.shape @@ -6800,12 +6800,12 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":754 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":754 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< - * - * + * + * */ /*else*/ { __Pyx_XDECREF(__pyx_r); @@ -6814,9 +6814,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":750 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":750 * return PyArray_MultiIterNew(5, a, b, c, d, e) - * + * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape @@ -6829,9 +6829,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":931 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -6841,27 +6841,27 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":932 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":932 + * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< * PyArray_SetBaseObject(arr, base) - * + * */ Py_INCREF(__pyx_v_base); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":933 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":933 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< - * + * * cdef inline object get_array_base(ndarray arr): */ (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base)); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":931 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":931 * int _import_umath() except -1 - * + * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) @@ -6871,9 +6871,9 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":935 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -6886,8 +6886,8 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":936 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":936 + * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< * if base is NULL: @@ -6895,7 +6895,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":937 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":937 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -6905,18 +6905,18 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_base == NULL) != 0); if (__pyx_t_1) { - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":938 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":938 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< * return base - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":937 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":937 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -6925,11 +6925,11 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":939 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":939 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< - * + * * # Versions of the import_* functions which are more suitable for */ __Pyx_XDECREF(__pyx_r); @@ -6937,9 +6937,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":935 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":935 * PyArray_SetBaseObject(arr, base) - * + * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< * base = PyArray_BASE(arr) * if base is NULL: @@ -6952,7 +6952,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":943 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":943 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -6976,7 +6976,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":944 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -6992,7 +6992,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":945 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":945 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< @@ -7001,7 +7001,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { */ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 945, __pyx_L3_error) - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":944 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7015,12 +7015,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":946 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":946 * try: * __pyx_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) { @@ -7030,11 +7030,11 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":947 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":947 * __pyx_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__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 947, __pyx_L5_except_error) @@ -7046,7 +7046,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":944 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":944 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7061,7 +7061,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":943 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":943 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -7084,9 +7084,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":949 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -7108,8 +7108,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -7124,7 +7124,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":951 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":951 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -7133,8 +7133,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 951, __pyx_L3_error) - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -7147,12 +7147,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":952 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":952 * 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) { @@ -7162,11 +7162,11 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":953 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":953 * _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__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 953, __pyx_L5_except_error) @@ -7178,8 +7178,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":950 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":950 + * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -7193,9 +7193,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":949 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":949 * raise ImportError("numpy.core.multiarray failed to import") - * + * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -7216,9 +7216,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":955 +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -7240,8 +7240,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -7256,7 +7256,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":957 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":957 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -7265,8 +7265,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { */ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L3_error) - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -7279,12 +7279,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":958 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":958 * 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) { @@ -7294,11 +7294,11 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":959 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":959 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef extern from *: */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 959, __pyx_L5_except_error) @@ -7310,8 +7310,8 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":956 - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":956 + * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< * _import_umath() @@ -7325,9 +7325,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":955 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":955 * raise ImportError("numpy.core.umath failed to import") - * + * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< * try: * _import_umath() @@ -7348,9 +7348,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":969 - * - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":969 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -7361,19 +7361,19 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_timedelta64_object", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":981 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":981 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":969 - * - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":969 + * + * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.timedelta64)` @@ -7385,9 +7385,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":984 - * - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":984 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -7398,19 +7398,19 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_datetime64_object", 0); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":996 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":996 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":984 - * - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":984 + * + * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< * """ * Cython equivalent of `isinstance(obj, np.datetime64)` @@ -7422,9 +7422,9 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":999 - * - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":999 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -7433,19 +7433,19 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1006 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":1006 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":999 - * - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":999 + * + * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy datetime64 object @@ -7456,9 +7456,9 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1009 - * - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":1009 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -7467,19 +7467,19 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1013 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":1013 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1009 - * - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":1009 + * + * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the int64 value underlying scalar numpy timedelta64 object @@ -7490,9 +7490,9 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1016 - * - * +/* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":1016 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -7501,7 +7501,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1020 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":1020 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -7509,9 +7509,9 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":1016 - * - * + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":1016 + * + * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< * """ * returns the unit part of the dtype for a numpy datetime64 object. @@ -7524,10 +7524,10 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* Python wrapper */ @@ -7620,10 +7620,10 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P } else { /* "View.MemoryView":123 - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< - * + * * cdef int idx */ __pyx_v_allocate_buffer = ((int)1); @@ -7645,10 +7645,10 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* function exit code */ @@ -7687,10 +7687,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":129 * cdef PyObject **p - * + * * self.ndim = len(shape) # <<<<<<<<<<<<<< * self.itemsize = itemsize - * + * */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); @@ -7700,29 +7700,29 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":130 - * + * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< - * + * * if not self.ndim: */ __pyx_v_self->itemsize = __pyx_v_itemsize; /* "View.MemoryView":132 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":133 - * + * * 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__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error) @@ -7733,28 +7733,28 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":132 * self.itemsize = itemsize - * + * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") - * + * */ } /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":136 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error) @@ -7765,26 +7765,26 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") - * + * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") - * + * */ } /* "View.MemoryView":138 * 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_t_2 = PyBytes_Check(__pyx_v_format); + __pyx_t_2 = PyBytes_Check(__pyx_v_format); __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { /* "View.MemoryView":139 - * + * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string @@ -7812,7 +7812,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":138 * 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 @@ -7824,7 +7824,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * 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_ERR(2, 140, __pyx_L1_error) __pyx_t_3 = __pyx_v_format; @@ -7839,8 +7839,8 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< - * - * + * + * */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); @@ -7850,39 +7850,39 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->format = __pyx_t_7; /* "View.MemoryView":144 - * - * + * + * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< * self._strides = self._shape + self.ndim - * + * */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); /* "View.MemoryView":145 - * + * * self._shape = 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":147 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":148 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -7892,16 +7892,16 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":147 * self._strides = self._shape + self.ndim - * + * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") - * + * */ } /* "View.MemoryView":151 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -7923,7 +7923,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_t_8 = (__pyx_t_8 + 1); /* "View.MemoryView":152 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -7937,7 +7937,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim - * + * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -7962,7 +7962,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __PYX_ERR(2, 153, __pyx_L1_error) /* "View.MemoryView":152 - * + * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -7974,14 +7974,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< - * + * * cdef char order */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; /* "View.MemoryView":151 - * - * + * + * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) @@ -7990,7 +7990,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":157 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' @@ -8022,7 +8022,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->mode = __pyx_n_u_fortran; /* "View.MemoryView":157 - * + * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' @@ -8077,7 +8077,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * 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, */ /*else*/ { @@ -8094,16 +8094,16 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":166 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) - * + * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< * itemsize, self.ndim, order) - * + * */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); /* "View.MemoryView":169 * itemsize, self.ndim, order) - * + * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< * self.dtype_is_object = format == b'O' * if allocate_buffer: @@ -8111,11 +8111,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->free_data = __pyx_v_allocate_buffer; /* "View.MemoryView":170 - * + * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: - * + * */ __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 170, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error) @@ -8126,15 +8126,15 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_4 = (__pyx_v_allocate_buffer != 0); if (__pyx_t_4) { /* "View.MemoryView":174 - * - * + * + * * self.data = malloc(self.len) # <<<<<<<<<<<<<< * if not self.data: * raise MemoryError("unable to allocate array data.") @@ -8142,11 +8142,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); /* "View.MemoryView":175 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); if (unlikely(__pyx_t_4)) { @@ -8155,7 +8155,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error) @@ -8165,17 +8165,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ __PYX_ERR(2, 176, __pyx_L1_error) /* "View.MemoryView":175 - * + * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") - * + * */ } /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): @@ -8184,7 +8184,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ if (__pyx_t_4) { /* "View.MemoryView":179 - * + * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< * for i in range(self.len / itemsize): @@ -8217,7 +8217,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ (__pyx_v_p[__pyx_v_i]) = Py_None; @@ -8225,7 +8225,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ Py_INCREF(Py_None); @@ -8233,7 +8233,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") - * + * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): @@ -8244,17 +8244,17 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":122 * cdef bint dtype_is_object - * + * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): - * + * */ /* function exit code */ @@ -8274,7 +8274,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ } /* "View.MemoryView":185 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 @@ -8481,7 +8481,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< * info.readonly = 0 - * + * */ __pyx_t_5 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_5; @@ -8490,14 +8490,14 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ __pyx_v_info->readonly = 0; /* "View.MemoryView":202 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: @@ -8506,7 +8506,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru if (__pyx_t_1) { /* "View.MemoryView":203 - * + * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< * else: @@ -8517,7 +8517,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":202 * info.readonly = 0 - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: @@ -8529,7 +8529,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.obj = self */ /*else*/ { @@ -8539,9 +8539,9 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":207 * info.format = NULL - * + * * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); @@ -8551,7 +8551,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":185 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 @@ -8582,7 +8582,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) @@ -8605,7 +8605,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":212 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) @@ -8624,7 +8624,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc __pyx_v_self->callback_free_data(__pyx_v_self->data); /* "View.MemoryView":212 - * + * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) @@ -8676,7 +8676,7 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< * PyObject_Free(self._shape) - * + * */ free(__pyx_v_self->data); @@ -8694,14 +8694,14 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< - * + * * @property */ PyObject_Free(__pyx_v_self->_shape); /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") - * + * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) @@ -8712,11 +8712,11 @@ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struc } /* "View.MemoryView":222 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ /* Python wrapper */ @@ -8745,7 +8745,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< - * + * * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); @@ -8756,11 +8756,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ goto __pyx_L0; /* "View.MemoryView":222 - * + * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() - * + * */ /* function exit code */ @@ -8775,7 +8775,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct _ } /* "View.MemoryView":226 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE @@ -8799,7 +8799,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * 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); @@ -8807,7 +8807,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< - * + * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); @@ -8834,7 +8834,7 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { goto __pyx_L0; /* "View.MemoryView":226 - * + * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE @@ -8856,10 +8856,10 @@ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ /* Python wrapper */ @@ -8881,10 +8881,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":231 - * + * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< - * + * * def __getattr__(self, attr): */ __pyx_r = (__pyx_v_self->_shape[0]); @@ -8892,10 +8892,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) - * + * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] - * + * */ /* function exit code */ @@ -8906,10 +8906,10 @@ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(str /* "View.MemoryView":233 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ /* Python wrapper */ @@ -8936,10 +8936,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( __Pyx_RefNannySetupContext("__getattr__", 0); /* "View.MemoryView":234 - * + * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< - * + * * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); @@ -8954,10 +8954,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( /* "View.MemoryView":233 * return self._shape[0] - * + * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) - * + * */ /* function exit code */ @@ -8974,10 +8974,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__( /* "View.MemoryView":236 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ /* Python wrapper */ @@ -9004,10 +9004,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":237 - * + * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< - * + * * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); @@ -9022,10 +9022,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ /* "View.MemoryView":236 * return getattr(self.memview, attr) - * + * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] - * + * */ /* function exit code */ @@ -9042,10 +9042,10 @@ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__ /* "View.MemoryView":239 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ /* Python wrapper */ @@ -9071,11 +9071,11 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc __Pyx_RefNannySetupContext("__setitem__", 0); /* "View.MemoryView":240 - * + * * 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_ERR(2, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9084,10 +9084,10 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struc /* "View.MemoryView":239 * return self.memview[item] - * + * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value - * + * */ /* function exit code */ @@ -9216,7 +9216,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct } /* "View.MemoryView":244 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): @@ -9239,7 +9239,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":248 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: @@ -9248,7 +9248,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize if (__pyx_t_1) { /* "View.MemoryView":249 - * + * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: @@ -9282,7 +9282,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":248 * cdef array result - * + * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: @@ -9324,7 +9324,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf - * + * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -9348,7 +9348,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< - * + * * return result */ __pyx_v_result->data = __pyx_v_buf; @@ -9357,10 +9357,10 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize /* "View.MemoryView":255 * result.data = buf - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_result)); @@ -9368,7 +9368,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize goto __pyx_L0; /* "View.MemoryView":244 - * + * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): @@ -9488,7 +9488,7 @@ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struc * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ /* Python wrapper */ @@ -9513,7 +9513,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< - * + * * cdef generic = Enum("") */ __Pyx_XDECREF(__pyx_r); @@ -9526,7 +9526,7 @@ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr_ * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name - * + * */ /* function exit code */ @@ -9830,7 +9830,7 @@ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_Me } /* "View.MemoryView":298 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" @@ -9848,59 +9848,59 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< * cdef size_t offset - * + * */ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); /* "View.MemoryView":304 - * + * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< - * + * * if offset > 0: */ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); /* "View.MemoryView":306 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ __pyx_t_1 = ((__pyx_v_offset > 0) != 0); if (__pyx_t_1) { /* "View.MemoryView":307 - * + * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< - * + * * return aligned_p */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); /* "View.MemoryView":306 * offset = aligned_p % alignment - * + * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset - * + * */ } /* "View.MemoryView":309 * aligned_p += alignment - offset - * + * * return aligned_p # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; /* "View.MemoryView":298 - * + * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" @@ -9914,7 +9914,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags @@ -10015,7 +10015,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __Pyx_RefNannySetupContext("__cinit__", 0); /* "View.MemoryView":346 - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< * self.flags = flags @@ -10080,7 +10080,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; @@ -10088,7 +10088,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * global __pyx_memoryview_thread_locks_used */ Py_INCREF(Py_None); @@ -10112,7 +10112,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ } /* "View.MemoryView":355 - * + * * 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] @@ -10140,7 +10140,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); /* "View.MemoryView":355 - * + * * 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] @@ -10172,7 +10172,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); if (unlikely(__pyx_t_1)) { @@ -10181,7 +10181,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: * raise MemoryError # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error) @@ -10191,7 +10191,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError - * + * */ } @@ -10206,7 +10206,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":363 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: @@ -10215,7 +10215,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ if (__pyx_t_1) { /* "View.MemoryView":364 - * + * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< * else: @@ -10234,7 +10234,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":363 * raise MemoryError - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: @@ -10246,7 +10246,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * 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*/ { @@ -10256,7 +10256,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":368 * self.dtype_is_object = dtype_is_object - * + * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL @@ -10267,14 +10267,14 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< - * + * * def __dealloc__(memoryview self): */ __pyx_v_self->typeinfo = NULL; /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo - * + * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags @@ -10293,7 +10293,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit_ /* "View.MemoryView":372 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) @@ -10323,7 +10323,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":373 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) @@ -10338,12 +10338,12 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * elif (<__pyx_buffer *> &self.view).obj == Py_None: - * + * */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); /* "View.MemoryView":373 - * + * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) @@ -10356,7 +10356,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< - * + * * (<__pyx_buffer *> &self.view).obj = NULL */ __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); @@ -10364,18 +10364,18 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":377 * elif (<__pyx_buffer *> &self.view).obj == Py_None: - * + * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< * Py_DECREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; /* "View.MemoryView":378 - * + * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< - * + * * cdef int i */ Py_DECREF(Py_None); @@ -10384,7 +10384,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< - * + * * (<__pyx_buffer *> &self.view).obj = NULL */ } @@ -10494,7 +10494,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal * 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); @@ -10512,7 +10512,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":372 * self.typeinfo = NULL - * + * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) @@ -10524,7 +10524,7 @@ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__deal /* "View.MemoryView":393 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf @@ -10552,17 +10552,17 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< - * + * * for dim, idx in enumerate(index): */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); /* "View.MemoryView":397 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { @@ -10610,10 +10610,10 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py __pyx_t_1 = (__pyx_t_1 + 1); /* "View.MemoryView":398 - * + * * 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_ERR(2, 398, __pyx_L1_error) @@ -10622,27 +10622,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py /* "View.MemoryView":397 * cdef char *itemp = self.view.buf - * + * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":400 * itemp = pybuffer_index(&self.view, itemp, idx, dim) - * + * * return itemp # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_itemp; goto __pyx_L0; /* "View.MemoryView":393 * PyThread_free_lock(self.lock) - * + * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf @@ -10661,8 +10661,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py } /* "View.MemoryView":403 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self @@ -10699,11 +10699,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":404 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); __pyx_t_2 = (__pyx_t_1 != 0); @@ -10713,7 +10713,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< - * + * * have_slices, indices = _unellipsify(index, self.view.ndim) */ __Pyx_XDECREF(__pyx_r); @@ -10722,19 +10722,19 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ goto __pyx_L0; /* "View.MemoryView":404 - * + * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self - * + * */ } /* "View.MemoryView":407 * 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_ERR(2, 407, __pyx_L1_error) @@ -10748,8 +10748,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __PYX_ERR(2, 407, __pyx_L1_error) } #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_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 @@ -10768,7 +10768,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ __pyx_t_5 = 0; /* "View.MemoryView":410 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) @@ -10792,7 +10792,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ goto __pyx_L0; /* "View.MemoryView":410 - * + * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) @@ -10805,7 +10805,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< * return self.convert_item_to_object(itemp) - * + * */ /*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 == ((char *)NULL))) __PYX_ERR(2, 413, __pyx_L1_error) @@ -10815,7 +10815,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< - * + * * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); @@ -10827,8 +10827,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ } /* "View.MemoryView":403 - * - * + * + * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self @@ -10851,7 +10851,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4_ /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") @@ -10886,11 +10886,11 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __Pyx_INCREF(__pyx_v_index); /* "View.MemoryView":417 - * + * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") - * + * */ __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { @@ -10899,7 +10899,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< - * + * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) @@ -10909,19 +10909,19 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __PYX_ERR(2, 418, __pyx_L1_error) /* "View.MemoryView":417 - * + * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") - * + * */ } /* "View.MemoryView":420 * raise TypeError("Cannot assign to read-only memoryview") - * + * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< - * + * * if have_slices: */ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) @@ -10935,8 +10935,8 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit __PYX_ERR(2, 420, __pyx_L1_error) } #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_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 @@ -10956,7 +10956,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: @@ -10965,7 +10965,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit if (__pyx_t_1) { /* "View.MemoryView":423 - * + * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: @@ -11030,7 +11030,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) - * + * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: @@ -11042,7 +11042,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< - * + * * cdef is_slice(self, obj): */ /*else*/ { @@ -11054,7 +11054,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) - * + * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") @@ -11079,7 +11079,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit /* "View.MemoryView":431 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: @@ -11104,13 +11104,13 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_INCREF(__pyx_v_obj); /* "View.MemoryView":432 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __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) { @@ -11196,7 +11196,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< * return None - * + * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { @@ -11210,7 +11210,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< - * + * * return obj */ __Pyx_XDECREF(__pyx_r); @@ -11245,7 +11245,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ } /* "View.MemoryView":432 - * + * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: @@ -11255,9 +11255,9 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":439 * return None - * + * * return obj # <<<<<<<<<<<<<< - * + * * cdef setitem_slice_assignment(self, dst, src): */ __Pyx_XDECREF(__pyx_r); @@ -11267,7 +11267,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":431 * self.setitem_indexed(index, value) - * + * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: @@ -11289,7 +11289,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ /* "View.MemoryView":441 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice @@ -11313,7 +11313,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":445 * 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) @@ -11322,11 +11322,11 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 445, __pyx_L1_error) /* "View.MemoryView":446 - * + * * 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_ERR(2, 446, __pyx_L1_error) __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 446, __pyx_L1_error) @@ -11335,7 +11335,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi * 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error) @@ -11349,7 +11349,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":445 * 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) @@ -11358,7 +11358,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":441 * return obj - * + * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice @@ -11379,7 +11379,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL @@ -11415,7 +11415,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< * cdef void *item - * + * */ __pyx_v_tmp = NULL; @@ -11423,7 +11423,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< - * + * * if self.view.itemsize > sizeof(array): */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 456, __pyx_L1_error) @@ -11431,7 +11431,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: @@ -11440,7 +11440,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor if (__pyx_t_2) { /* "View.MemoryView":459 - * + * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< * if tmp == NULL: @@ -11487,7 +11487,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) - * + * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: @@ -11499,7 +11499,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item = tmp * else: * item = array # <<<<<<<<<<<<<< - * + * * try: */ /*else*/ { @@ -11509,7 +11509,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":466 * item = array - * + * * try: # <<<<<<<<<<<<<< * if self.dtype_is_object: * ( item)[0] = value @@ -11517,7 +11517,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /*try:*/ { /* "View.MemoryView":467 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value @@ -11536,7 +11536,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); /* "View.MemoryView":467 - * + * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value @@ -11549,8 +11549,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< - * - * + * + * */ /*else*/ { __pyx_t_3 = ((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_3)) __PYX_ERR(2, 470, __pyx_L6_error) @@ -11560,8 +11560,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __pyx_L8:; /* "View.MemoryView":474 - * - * + * + * * 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, @@ -11570,7 +11570,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor if (__pyx_t_2) { /* "View.MemoryView":475 - * + * * 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, @@ -11581,8 +11581,8 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":474 - * - * + * + * * 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, @@ -11603,7 +11603,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< - * + * * cdef setitem_indexed(self, index, value): */ /*finally:*/ { @@ -11648,7 +11648,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) - * + * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL @@ -11669,7 +11669,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor /* "View.MemoryView":481 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) @@ -11687,11 +11687,11 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ __Pyx_RefNannySetupContext("setitem_indexed", 0); /* "View.MemoryView":482 - * + * * 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 == ((char *)NULL))) __PYX_ERR(2, 482, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; @@ -11700,7 +11700,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ * 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_ERR(2, 483, __pyx_L1_error) @@ -11709,7 +11709,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ /* "View.MemoryView":481 * PyMem_Free(tmp) - * + * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) @@ -11730,7 +11730,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_ /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -11763,7 +11763,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem - * + * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -11772,7 +11772,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":491 * cdef bytes bytesitem - * + * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) @@ -11783,7 +11783,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -11860,7 +11860,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_t_1 = 0; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -11876,7 +11876,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * return result */ /*else:*/ { - __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_10 = strlen(__pyx_v_self->view.format); __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { @@ -11885,7 +11885,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< * return result - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 498, __pyx_L5_except_error) @@ -11907,7 +11907,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< - * + * * cdef assign_item_from_object(self, char *itemp, object value): */ __Pyx_XDECREF(__pyx_r); @@ -11960,7 +11960,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview __pyx_L5_except_error:; /* "View.MemoryView":492 - * + * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) @@ -11981,7 +11981,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -12007,7 +12007,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview /* "View.MemoryView":501 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -12053,17 +12053,17 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":509 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ - __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "View.MemoryView":510 - * + * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: @@ -12094,7 +12094,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":509 * cdef Py_ssize_t i - * + * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: @@ -12106,7 +12106,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< - * + * * for i, c in enumerate(bytesvalue): */ /*else*/ { @@ -12169,10 +12169,10 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { @@ -12188,28 +12188,28 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __pyx_v_c = (__pyx_t_11[0]); /* "View.MemoryView":515 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ __pyx_v_i = __pyx_t_9; /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) - * + * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c - * + * */ __pyx_t_9 = (__pyx_t_9 + 1); /* "View.MemoryView":515 - * + * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< - * + * * @cname('getbuffer') */ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; @@ -12218,7 +12218,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie /* "View.MemoryView":501 * return result - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" @@ -12245,7 +12245,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie } /* "View.MemoryView":518 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: @@ -12292,7 +12292,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * */ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); if (__pyx_t_2) { @@ -12309,7 +12309,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_ND: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error) @@ -12323,13 +12323,13 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * */ } /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: @@ -12338,7 +12338,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":523 - * + * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< * else: @@ -12349,7 +12349,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") - * + * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: @@ -12361,7 +12361,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_STRIDES: */ /*else*/ { @@ -12371,7 +12371,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":527 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: @@ -12380,7 +12380,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":528 - * + * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< * else: @@ -12391,7 +12391,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":527 * info.shape = NULL - * + * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: @@ -12403,7 +12403,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_INDIRECT: */ /*else*/ { @@ -12413,7 +12413,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":532 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: @@ -12422,7 +12422,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":533 - * + * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< * else: @@ -12433,7 +12433,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":532 * info.strides = NULL - * + * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: @@ -12445,7 +12445,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_FORMAT: */ /*else*/ { @@ -12455,7 +12455,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":537 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: @@ -12464,7 +12464,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu if (__pyx_t_1) { /* "View.MemoryView":538 - * + * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< * else: @@ -12475,7 +12475,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":537 * info.suboffsets = NULL - * + * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: @@ -12487,7 +12487,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< - * + * * info.buf = self.view.buf */ /*else*/ { @@ -12497,7 +12497,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu /* "View.MemoryView":542 * info.format = NULL - * + * * info.buf = self.view.buf # <<<<<<<<<<<<<< * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize @@ -12506,7 +12506,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->buf = __pyx_t_6; /* "View.MemoryView":543 - * + * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< * info.itemsize = self.view.itemsize @@ -12540,7 +12540,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< * info.obj = self - * + * */ __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; @@ -12549,7 +12549,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); @@ -12559,7 +12559,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":518 - * + * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: @@ -12589,7 +12589,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu } /* "View.MemoryView":553 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) @@ -12638,7 +12638,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * 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 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error) @@ -12646,7 +12646,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -12655,7 +12655,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ goto __pyx_L0; /* "View.MemoryView":553 - * + * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) @@ -12675,11 +12675,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct _ } /* "View.MemoryView":559 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ /* Python wrapper */ @@ -12704,7 +12704,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -12713,11 +12713,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc goto __pyx_L0; /* "View.MemoryView":559 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj - * + * */ /* function exit code */ @@ -12728,11 +12728,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struc } /* "View.MemoryView":563 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ /* Python wrapper */ @@ -12766,7 +12766,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -12789,11 +12789,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru goto __pyx_L0; /* "View.MemoryView":563 - * + * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) - * + * */ /* function exit code */ @@ -12809,11 +12809,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(stru } /* "View.MemoryView":567 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ /* Python wrapper */ @@ -12848,7 +12848,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); @@ -12856,9 +12856,9 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st /* "View.MemoryView":570 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error) @@ -12871,16 +12871,16 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< - * + * * raise ValueError("Buffer view does not expose strides") */ } /* "View.MemoryView":572 * raise ValueError("Buffer view does not expose strides") - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -12903,11 +12903,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st goto __pyx_L0; /* "View.MemoryView":567 - * + * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: - * + * */ /* function exit code */ @@ -12923,7 +12923,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st } /* "View.MemoryView":575 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: @@ -12963,7 +12963,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * 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) { @@ -12972,7 +12972,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * 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_XDECREF(__pyx_r); @@ -12990,15 +12990,15 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim - * + * */ } /* "View.MemoryView":579 * return (-1,) * self.view.ndim - * + * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -13021,7 +13021,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ goto __pyx_L0; /* "View.MemoryView":575 - * + * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: @@ -13041,11 +13041,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ } /* "View.MemoryView":582 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ /* Python wrapper */ @@ -13074,7 +13074,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -13085,11 +13085,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc goto __pyx_L0; /* "View.MemoryView":582 - * + * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim - * + * */ /* function exit code */ @@ -13104,11 +13104,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struc } /* "View.MemoryView":586 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ /* Python wrapper */ @@ -13137,7 +13137,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -13148,11 +13148,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s goto __pyx_L0; /* "View.MemoryView":586 - * + * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize - * + * */ /* function exit code */ @@ -13167,11 +13167,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(s } /* "View.MemoryView":590 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ /* Python wrapper */ @@ -13202,7 +13202,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< - * + * * @property */ __Pyx_XDECREF(__pyx_r); @@ -13219,11 +13219,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str goto __pyx_L0; /* "View.MemoryView":590 - * + * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize - * + * */ /* function exit code */ @@ -13240,7 +13240,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(str } /* "View.MemoryView":594 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: @@ -13281,7 +13281,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * 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); @@ -13291,7 +13291,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< - * + * * for length in self.view.shape[:self.view.ndim]: */ __Pyx_INCREF(__pyx_int_1); @@ -13299,10 +13299,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":598 * result = 1 - * + * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< * result *= length - * + * */ __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++) { @@ -13313,10 +13313,10 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc __pyx_t_6 = 0; /* "View.MemoryView":599 - * + * * 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, 599, __pyx_L1_error) @@ -13327,9 +13327,9 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":601 * result *= length - * + * * self._size = result # <<<<<<<<<<<<<< - * + * * return self._size */ __Pyx_INCREF(__pyx_v_result); @@ -13343,15 +13343,15 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 - * + * */ } /* "View.MemoryView":603 * self._size = result - * + * * return self._size # <<<<<<<<<<<<<< - * + * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); @@ -13360,7 +13360,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc goto __pyx_L0; /* "View.MemoryView":594 - * + * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: @@ -13382,7 +13382,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struc /* "View.MemoryView":605 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] @@ -13408,11 +13408,11 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":606 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { @@ -13421,26 +13421,26 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< - * + * * return 0 */ __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; /* "View.MemoryView":606 - * + * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] - * + * */ } /* "View.MemoryView":609 * return self.view.shape[0] - * + * * return 0 # <<<<<<<<<<<<<< - * + * * def __repr__(self): */ __pyx_r = 0; @@ -13448,7 +13448,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 /* "View.MemoryView":605 * return self._size - * + * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] @@ -13462,7 +13462,7 @@ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_1 /* "View.MemoryView":611 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) @@ -13493,11 +13493,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 __Pyx_RefNannySetupContext("__repr__", 0); /* "View.MemoryView":612 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error) @@ -13513,18 +13513,18 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< - * + * * def __str__(self): */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "View.MemoryView":612 - * + * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) - * + * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -13543,7 +13543,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 /* "View.MemoryView":611 * return 0 - * + * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) @@ -13564,10 +13564,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12 /* "View.MemoryView":615 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ /* Python wrapper */ @@ -13594,11 +13594,11 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 __Pyx_RefNannySetupContext("__str__", 0); /* "View.MemoryView":616 - * + * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error) @@ -13623,10 +13623,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 /* "View.MemoryView":615 * id(self)) - * + * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) - * + * */ /* function exit code */ @@ -13642,8 +13642,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14 } /* "View.MemoryView":619 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -13679,7 +13679,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; @@ -13688,7 +13688,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); @@ -13699,8 +13699,8 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 goto __pyx_L0; /* "View.MemoryView":619 - * - * + * + * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -13719,7 +13719,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16 /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -13755,7 +13755,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 628, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; @@ -13764,7 +13764,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< - * + * * def copy(self): */ __Pyx_XDECREF(__pyx_r); @@ -13776,7 +13776,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) - * + * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp @@ -13795,7 +13795,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18 /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS @@ -13830,14 +13830,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &mslice) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); /* "View.MemoryView":635 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS - * + * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, * self.view.itemsize, @@ -13845,7 +13845,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); /* "View.MemoryView":636 - * + * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, @@ -13856,9 +13856,9 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":641 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< - * + * * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); @@ -13870,7 +13870,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) - * + * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS @@ -13889,7 +13889,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20 /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS @@ -13925,14 +13925,14 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< - * + * * slice_copy(self, &src) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); /* "View.MemoryView":647 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS - * + * * slice_copy(self, &src) # <<<<<<<<<<<<<< * dst = slice_copy_contig(&src, "fortran", self.view.ndim, * self.view.itemsize, @@ -13940,7 +13940,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); /* "View.MemoryView":648 - * + * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, @@ -13951,10 +13951,10 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 /* "View.MemoryView":653 * self.dtype_is_object) - * + * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) @@ -13965,7 +13965,7 @@ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22 /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) - * + * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS @@ -14096,7 +14096,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st } /* "View.MemoryView":657 - * + * * @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) @@ -14148,7 +14148,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< * return result - * + * */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; @@ -14156,7 +14156,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_check') */ __Pyx_XDECREF(__pyx_r); @@ -14165,7 +14165,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in goto __pyx_L0; /* "View.MemoryView":657 - * + * * @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) @@ -14187,11 +14187,11 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in } /* "View.MemoryView":663 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { @@ -14204,19 +14204,19 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { * @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, __pyx_memoryview_type); + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); __pyx_r = __pyx_t_1; goto __pyx_L0; /* "View.MemoryView":663 - * + * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) - * + * */ /* function exit code */ @@ -14227,7 +14227,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { /* "View.MemoryView":666 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with @@ -14266,7 +14266,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: */ - __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_1 = PyTuple_Check(__pyx_v_index); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { @@ -14299,7 +14299,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< - * + * * result = [] */ /*else*/ { @@ -14310,7 +14310,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":676 * tup = index - * + * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False @@ -14321,7 +14321,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_3 = 0; /* "View.MemoryView":677 - * + * * result = [] * have_slices = False # <<<<<<<<<<<<<< * seen_ellipsis = False @@ -14492,10 +14492,10 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_2 = PySlice_Check(__pyx_v_item); __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_10) { } else { @@ -14511,7 +14511,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 689, __pyx_L1_error) @@ -14528,16 +14528,16 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * */ } /* "View.MemoryView":691 * raise TypeError("Cannot index with type '%s'" % type(item)) - * + * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< * result.append(item) - * + * */ __pyx_t_10 = (__pyx_v_have_slices != 0); if (!__pyx_t_10) { @@ -14545,17 +14545,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_t_1 = __pyx_t_10; goto __pyx_L11_bool_binop_done; } - __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = PySlice_Check(__pyx_v_item); __pyx_t_2 = (__pyx_t_10 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; /* "View.MemoryView":692 - * + * * 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 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error) @@ -14575,7 +14575,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":694 * result.append(item) - * + * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) @@ -14584,11 +14584,11 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":695 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { @@ -14597,7 +14597,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * 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_ERR(2, 696, __pyx_L1_error) @@ -14613,19 +14613,19 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":695 - * + * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) - * + * */ } /* "View.MemoryView":698 * result.extend([slice(None)] * nslices) - * + * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): */ __Pyx_XDECREF(__pyx_r); @@ -14658,7 +14658,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":666 * return isinstance(o, memoryview) - * + * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with @@ -14684,7 +14684,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: @@ -14705,7 +14705,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); /* "View.MemoryView":701 - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: @@ -14721,7 +14721,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { @@ -14730,8 +14730,8 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -14744,14 +14744,14 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") - * + * */ } } /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) - * + * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: @@ -14771,7 +14771,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ } /* "View.MemoryView":710 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim @@ -14825,19 +14825,19 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_suboffset_dim = -1; /* "View.MemoryView":718 - * - * + * + * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< - * + * * cdef _memoryviewslice memviewsliceobj */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); /* "View.MemoryView":722 * cdef _memoryviewslice memviewsliceobj - * + * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ #ifndef CYTHON_WITHOUT_ASSERTIONS @@ -14851,17 +14851,17 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":724 * 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), __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":725 - * + * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice @@ -14884,7 +14884,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":724 * assert memview.view.ndim > 0 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice @@ -14897,7 +14897,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< * p_src = &src - * + * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); @@ -14906,36 +14906,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_p_src = (&__pyx_v_src); } __pyx_L3:; /* "View.MemoryView":735 - * - * + * + * * dst.memview = p_src.memview # <<<<<<<<<<<<<< * dst.data = p_src.data - * + * */ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; /* "View.MemoryView":736 - * + * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; /* "View.MemoryView":741 - * - * + * + * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< * cdef int *p_suboffset_dim = &suboffset_dim * cdef Py_ssize_t start, stop, step @@ -14943,7 +14943,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_p_dst = (&__pyx_v_dst); /* "View.MemoryView":742 - * + * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< * cdef Py_ssize_t start, stop, step @@ -14953,7 +14953,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( @@ -15004,7 +15004,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_t_6 = (__pyx_t_6 + 1); /* "View.MemoryView":747 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( @@ -15032,7 +15032,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __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 == ((int)-1))) __PYX_ERR(2, 748, __pyx_L1_error) /* "View.MemoryView":747 - * + * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( @@ -15126,7 +15126,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -15147,7 +15147,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 762, __pyx_L1_error) @@ -15167,7 +15167,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":764 * 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 @@ -15179,11 +15179,11 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ __pyx_v_have_start = __pyx_t_1; /* "View.MemoryView":765 - * + * * 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_ERR(2, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -15195,7 +15195,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 766, __pyx_L1_error) @@ -15206,7 +15206,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":768 * 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, @@ -15217,7 +15217,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< - * + * * if isinstance(memview, _memoryviewslice): */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); @@ -15226,7 +15226,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step - * + * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( @@ -15236,17 +15236,17 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":776 * 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), __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":777 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, @@ -15273,7 +15273,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) } /* "View.MemoryView":777 - * + * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, @@ -15288,7 +15288,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ /* "View.MemoryView":776 * new_ndim += 1 - * + * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, @@ -15300,7 +15300,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) - * + * */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); @@ -15309,8 +15309,8 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -15320,7 +15320,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ * 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_ERR(2, 782, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); @@ -15329,7 +15329,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } /* "View.MemoryView":710 - * + * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim @@ -15351,7 +15351,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ } /* "View.MemoryView":807 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, @@ -15371,9 +15371,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":827 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); @@ -15381,7 +15381,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":829 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: @@ -15390,7 +15390,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_1) { /* "View.MemoryView":830 - * + * * if start < 0: * start += shape # <<<<<<<<<<<<<< * if not 0 <= start < shape: @@ -15400,7 +15400,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":829 * if not is_slice: - * + * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: @@ -15426,7 +15426,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * 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, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 832, __pyx_L1_error) @@ -15441,9 +15441,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":827 * cdef bint negative_step - * + * * if not is_slice: # <<<<<<<<<<<<<< - * + * * if start < 0: */ goto __pyx_L3; @@ -15451,9 +15451,9 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":835 * else: - * + * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< - * + * * if have_step and step == 0: */ /*else*/ { @@ -15470,10 +15470,10 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":837 * negative_step = have_step != 0 and step < 0 - * + * * if have_step and step == 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) - * + * */ __pyx_t_1 = (__pyx_v_have_step != 0); if (__pyx_t_1) { @@ -15487,26 +15487,26 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":838 - * + * * 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, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 838, __pyx_L1_error) /* "View.MemoryView":837 * 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) - * + * */ } /* "View.MemoryView":841 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape @@ -15515,7 +15515,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":842 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape @@ -15562,7 +15562,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":842 - * + * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape @@ -15633,8 +15633,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L12:; /* "View.MemoryView":841 - * - * + * + * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape @@ -15676,7 +15676,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< - * + * * if have_stop: */ /*else*/ { @@ -15688,7 +15688,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":857 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape @@ -15697,7 +15697,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":858 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape @@ -15744,7 +15744,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":858 - * + * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape @@ -15784,7 +15784,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":857 * start = 0 - * + * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape @@ -15826,7 +15826,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< - * + * * if not have_step: */ /*else*/ { @@ -15838,100 +15838,100 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":870 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":871 - * + * * if not have_step: * step = 1 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_step = 1; /* "View.MemoryView":870 * stop = shape - * + * * if not have_step: # <<<<<<<<<<<<<< * step = 1 - * + * */ } /* "View.MemoryView":875 - * + * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< - * + * * if (stop - start) - step * new_shape: */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); /* "View.MemoryView":877 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { /* "View.MemoryView":878 - * + * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< - * + * * if new_shape < 0: */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); /* "View.MemoryView":877 * new_shape = (stop - start) // step - * + * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 - * + * */ } /* "View.MemoryView":880 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":881 - * + * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_new_shape = 0; /* "View.MemoryView":880 * new_shape += 1 - * + * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 - * + * */ } /* "View.MemoryView":884 - * - * + * + * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset @@ -15939,11 +15939,11 @@ 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":885 - * + * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< * dst.suboffsets[new_ndim] = suboffset - * + * */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; @@ -15951,16 +15951,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< - * - * + * + * */ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; } __pyx_L3:; /* "View.MemoryView":889 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: @@ -15969,7 +15969,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":890 - * + * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< * else: @@ -15978,8 +15978,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); /* "View.MemoryView":889 - * - * + * + * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: @@ -15991,7 +15991,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< - * + * * if suboffset >= 0: */ /*else*/ { @@ -16002,7 +16002,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: @@ -16011,7 +16011,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, if (__pyx_t_2) { /* "View.MemoryView":895 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: @@ -16070,7 +16070,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, __pyx_L26:; /* "View.MemoryView":895 - * + * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: @@ -16083,7 +16083,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< - * + * * return 0 */ /*else*/ { @@ -16093,7 +16093,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride - * + * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: @@ -16102,16 +16102,16 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, /* "View.MemoryView":904 * suboffset_dim[0] = new_ndim - * + * * return 0 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":807 - * + * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, @@ -16135,7 +16135,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, } /* "View.MemoryView":910 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: @@ -16173,14 +16173,14 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< * cdef char *resultp - * + * */ __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":916 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize @@ -16189,7 +16189,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P if (__pyx_t_2) { /* "View.MemoryView":917 - * + * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< * stride = itemsize @@ -16216,7 +16216,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":916 * cdef char *resultp - * + * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize @@ -16248,7 +16248,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { @@ -16257,7 +16257,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< - * + * * if index < 0: */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); @@ -16267,7 +16267,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] - * + * */ } } @@ -16275,7 +16275,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: @@ -16284,7 +16284,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P if (__pyx_t_2) { /* "View.MemoryView":926 - * + * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< * if index < 0: @@ -16297,7 +16297,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { @@ -16306,7 +16306,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * 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_ERR(2, 928, __pyx_L1_error) @@ -16326,13 +16326,13 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ } /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] - * + * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: @@ -16341,19 +16341,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":930 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * */ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":931 - * + * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< - * + * * resultp = bufp + index * stride */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error) @@ -16370,16 +16370,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P /* "View.MemoryView":930 * 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":933 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) - * + * * resultp = bufp + index * stride # <<<<<<<<<<<<<< * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset @@ -16387,11 +16387,11 @@ 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":934 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { @@ -16400,32 +16400,32 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< - * + * * return resultp */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); /* "View.MemoryView":934 - * + * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset - * + * */ } /* "View.MemoryView":937 * resultp = ( resultp)[0] + suboffset - * + * * return resultp # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_resultp; goto __pyx_L0; /* "View.MemoryView":910 - * + * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: @@ -16444,11 +16444,11 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P } /* "View.MemoryView":943 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { @@ -16475,7 +16475,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< - * + * * cdef Py_ssize_t *shape = memslice.shape */ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; @@ -16483,26 +16483,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":946 * cdef int ndim = memslice.memview.view.ndim - * + * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< * cdef Py_ssize_t *strides = memslice.strides - * + * */ __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; /* "View.MemoryView":947 - * + * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; /* "View.MemoryView":951 - * + * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< * j = ndim - 1 - i @@ -16527,7 +16527,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< * shape[i], shape[j] = shape[j], shape[i] - * + * */ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); @@ -16538,7 +16538,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); @@ -16548,10 +16548,10 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":956 * shape[i], shape[j] = shape[j], shape[i] - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * */ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); if (!__pyx_t_8) { @@ -16565,40 +16565,40 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { if (__pyx_t_7) { /* "View.MemoryView":957 - * + * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< - * + * * return 1 */ __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L1_error) /* "View.MemoryView":956 * 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") - * + * */ } } /* "View.MemoryView":959 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") - * + * * return 1 # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = 1; goto __pyx_L0; /* "View.MemoryView":943 - * + * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim - * + * */ /* function exit code */ @@ -16619,10 +16619,10 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ /* Python wrapper */ @@ -16641,20 +16641,20 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":977 - * + * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< - * + * * cdef convert_item_to_object(self, char *itemp): */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 - * + * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * */ /* function exit code */ @@ -16663,7 +16663,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) @@ -16680,7 +16680,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor __Pyx_RefNannySetupContext("convert_item_to_object", 0); /* "View.MemoryView":980 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) @@ -16704,7 +16704,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor goto __pyx_L0; /* "View.MemoryView":980 - * + * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) @@ -16716,7 +16716,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor * 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*/ { @@ -16730,7 +16730,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) - * + * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) @@ -16749,7 +16749,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) @@ -16767,7 +16767,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __Pyx_RefNannySetupContext("assign_item_from_object", 0); /* "View.MemoryView":986 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) @@ -16786,7 +16786,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error) /* "View.MemoryView":986 - * + * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) @@ -16799,7 +16799,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< - * + * * @property */ /*else*/ { @@ -16811,7 +16811,7 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) - * + * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) @@ -16831,11 +16831,11 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo } /* "View.MemoryView":992 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ /* Python wrapper */ @@ -16860,7 +16860,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_XDECREF(__pyx_r); @@ -16869,11 +16869,11 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__ goto __pyx_L0; /* "View.MemoryView":992 - * + * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object - * + * */ /* function exit code */ @@ -16997,7 +16997,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS } /* "View.MemoryView":999 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, @@ -17026,20 +17026,20 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1007 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { /* "View.MemoryView":1008 - * + * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< - * - * + * + * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -17047,18 +17047,18 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1007 * cdef _memoryviewslice result - * + * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None - * + * */ } /* "View.MemoryView":1013 - * - * + * + * * 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_ERR(2, 1013, __pyx_L1_error) @@ -17082,28 +17082,28 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1015 * result = _memoryviewslice(None, 0, dtype_is_object) - * + * * result.from_slice = memviewslice # <<<<<<<<<<<<<< * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * */ __pyx_v_result->from_slice = __pyx_v_memviewslice; /* "View.MemoryView":1016 - * + * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< - * + * * result.from_object = ( memviewslice.memview).base */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); /* "View.MemoryView":1018 * __PYX_INC_MEMVIEW(&memviewslice, 1) - * + * * result.from_object = ( 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_ERR(2, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -17114,10 +17114,10 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_t_2 = 0; /* "View.MemoryView":1019 - * + * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< - * + * * result.view = memviewslice.memview.view */ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; @@ -17125,7 +17125,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1021 * result.typeinfo = memviewslice.memview.typeinfo - * + * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< * result.view.buf = memviewslice.data * result.view.ndim = ndim @@ -17134,7 +17134,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view = __pyx_t_5; /* "View.MemoryView":1022 - * + * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< * result.view.ndim = ndim @@ -17156,7 +17156,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) - * + * */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; @@ -17164,14 +17164,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: */ Py_INCREF(Py_None); /* "View.MemoryView":1027 * Py_INCREF(Py_None) - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: @@ -17180,7 +17180,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl if (__pyx_t_1) { /* "View.MemoryView":1028 - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< * else: @@ -17190,7 +17190,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1027 * Py_INCREF(Py_None) - * + * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: @@ -17202,7 +17202,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< - * + * * result.view.shape = result.from_slice.shape */ /*else*/ { @@ -17212,25 +17212,25 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS_RO - * + * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< * result.view.strides = result.from_slice.strides - * + * */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); /* "View.MemoryView":1033 - * + * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); /* "View.MemoryView":1036 - * - * + * + * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: @@ -17238,7 +17238,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view.suboffsets = NULL; /* "View.MemoryView":1037 - * + * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: @@ -17264,7 +17264,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); @@ -17272,7 +17272,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< - * + * * result.view.len = result.view.itemsize */ goto __pyx_L6_break; @@ -17290,7 +17290,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1042 * break - * + * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< * for length in result.view.shape[:ndim]: * result.view.len *= length @@ -17299,11 +17299,11 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl __pyx_v_result->__pyx_base.view.len = __pyx_t_9; /* "View.MemoryView":1043 - * + * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< * result.view.len *= length - * + * */ __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++) { @@ -17317,7 +17317,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< - * + * * result.to_object_func = to_object_func */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error) @@ -17332,27 +17332,27 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl /* "View.MemoryView":1046 * result.view.len *= length - * + * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< * result.to_dtype_func = to_dtype_func - * + * */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; /* "View.MemoryView":1047 - * + * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< - * + * * return result */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; /* "View.MemoryView":1049 * result.to_dtype_func = to_dtype_func - * + * * return result # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') */ __Pyx_XDECREF(__pyx_r); @@ -17361,7 +17361,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl goto __pyx_L0; /* "View.MemoryView":999 - * + * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, @@ -17383,7 +17383,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl } /* "View.MemoryView":1052 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: @@ -17409,7 +17409,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * obj = memview * return &obj.from_slice */ - __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __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) { @@ -17450,7 +17450,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< * return mslice - * + * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); @@ -17459,7 +17459,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_slice_copy') */ __pyx_r = __pyx_v_mslice; @@ -17467,7 +17467,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p } /* "View.MemoryView":1052 - * + * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: @@ -17486,7 +17486,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p } /* "View.MemoryView":1063 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim @@ -17508,7 +17508,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem /* "View.MemoryView":1067 * cdef (Py_ssize_t*) shape, strides, suboffsets - * + * * shape = memview.view.shape # <<<<<<<<<<<<<< * strides = memview.view.strides * suboffsets = memview.view.suboffsets @@ -17517,11 +17517,11 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_v_shape = __pyx_t_1; /* "View.MemoryView":1068 - * + * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< * suboffsets = memview.view.suboffsets - * + * */ __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; @@ -17530,7 +17530,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< - * + * * dst.memview = <__pyx_memoryview *> memview */ __pyx_t_1 = __pyx_v_memview->view.suboffsets; @@ -17538,25 +17538,25 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem /* "View.MemoryView":1071 * suboffsets = memview.view.suboffsets - * + * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< * dst.data = memview.view.buf - * + * */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); /* "View.MemoryView":1072 - * + * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< - * + * * for dim in range(memview.view.ndim): */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); /* "View.MemoryView":1074 * dst.data = memview.view.buf - * + * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] @@ -17567,7 +17567,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem __pyx_v_dim = __pyx_t_4; /* "View.MemoryView":1075 - * + * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< * dst.strides[dim] = strides[dim] @@ -17580,7 +17580,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 - * + * */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); @@ -17588,7 +17588,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object') */ if ((__pyx_v_suboffsets != 0)) { @@ -17600,7 +17600,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem } /* "View.MemoryView":1063 - * + * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim @@ -17612,7 +17612,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem } /* "View.MemoryView":1080 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" @@ -17634,7 +17634,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< * return memoryview_copy_from_slice(memview, &memviewslice) - * + * */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); @@ -17642,7 +17642,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); @@ -17653,7 +17653,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx goto __pyx_L0; /* "View.MemoryView":1080 - * + * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" @@ -17672,7 +17672,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx } /* "View.MemoryView":1087 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ @@ -17696,17 +17696,17 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1094 * 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), __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":1095 - * + * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func @@ -17727,7 +17727,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1094 * 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 @@ -17740,7 +17740,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL # <<<<<<<<<<<<<< * to_dtype_func = NULL - * + * */ /*else*/ { __pyx_v_to_object_func = NULL; @@ -17749,7 +17749,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, */ __pyx_v_to_dtype_func = NULL; @@ -17758,7 +17758,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview /* "View.MemoryView":1101 * to_dtype_func = NULL - * + * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< * to_object_func, to_dtype_func, * memview.dtype_is_object) @@ -17769,8 +17769,8 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview * 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_ERR(2, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -17779,7 +17779,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview goto __pyx_L0; /* "View.MemoryView":1087 - * + * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ @@ -17798,8 +17798,8 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview } /* "View.MemoryView":1109 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg @@ -17810,7 +17810,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { int __pyx_t_1; /* "View.MemoryView":1110 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg @@ -17830,7 +17830,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { goto __pyx_L0; /* "View.MemoryView":1110 - * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg @@ -17842,7 +17842,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { * return -arg * else: * return arg # <<<<<<<<<<<<<< - * + * * @cname('__pyx_get_best_slice_order') */ /*else*/ { @@ -17851,8 +17851,8 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { } /* "View.MemoryView":1109 - * - * + * + * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg @@ -17864,7 +17864,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { } /* "View.MemoryView":1116 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ @@ -17886,7 +17886,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< * cdef Py_ssize_t f_stride = 0 - * + * */ __pyx_v_c_stride = 0; @@ -17894,14 +17894,14 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ __pyx_v_f_stride = 0; /* "View.MemoryView":1124 * 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] @@ -17910,7 +17910,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1125 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] @@ -17924,7 +17924,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -17932,13 +17932,13 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ goto __pyx_L4_break; /* "View.MemoryView":1125 - * + * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] @@ -17950,7 +17950,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1129 * break - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] @@ -17961,7 +17961,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1130 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] @@ -17975,7 +17975,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break - * + * */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -17983,13 +17983,13 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ goto __pyx_L7_break; /* "View.MemoryView":1130 - * + * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] @@ -18001,7 +18001,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1134 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: @@ -18010,7 +18010,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ if (__pyx_t_2) { /* "View.MemoryView":1135 - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< * else: @@ -18021,7 +18021,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ /* "View.MemoryView":1134 * break - * + * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: @@ -18032,7 +18032,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< - * + * * @cython.cdivision(True) */ /*else*/ { @@ -18041,7 +18041,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } /* "View.MemoryView":1116 - * + * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ @@ -18054,7 +18054,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _ } /* "View.MemoryView":1140 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, @@ -18075,7 +18075,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v Py_ssize_t __pyx_t_6; /* "View.MemoryView":1147 - * + * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_extent = dst_shape[0] @@ -18097,7 +18097,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); @@ -18105,14 +18105,14 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): @@ -18121,7 +18121,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v if (__pyx_t_1) { /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -18156,7 +18156,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_L5_bool_binop_done:; /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -18174,7 +18174,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); /* "View.MemoryView":1153 - * + * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): @@ -18228,7 +18228,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): @@ -18263,7 +18263,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride - * + * */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); @@ -18271,7 +18271,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, */ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); @@ -18280,7 +18280,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v __pyx_L3:; /* "View.MemoryView":1140 - * + * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, @@ -18292,7 +18292,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v /* "View.MemoryView":1170 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: @@ -18305,13 +18305,13 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< * src.shape, dst.shape, ndim, itemsize) - * + * */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1170 * dst_data += dst_stride - * + * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: @@ -18321,7 +18321,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi } /* "View.MemoryView":1177 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" @@ -18341,7 +18341,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< - * + * * for shape in src.shape[:ndim]: */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; @@ -18349,10 +18349,10 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr /* "View.MemoryView":1181 * cdef Py_ssize_t shape, size = src.memview.view.itemsize - * + * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< * size *= shape - * + * */ __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { @@ -18360,10 +18360,10 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr __pyx_v_shape = (__pyx_t_2[0]); /* "View.MemoryView":1182 - * + * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< - * + * * return size */ __pyx_v_size = (__pyx_v_size * __pyx_v_shape); @@ -18371,16 +18371,16 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr /* "View.MemoryView":1184 * size *= shape - * + * * return size # <<<<<<<<<<<<<< - * + * * @cname('__pyx_fill_contig_strides_array') */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "View.MemoryView":1177 - * + * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" @@ -18393,7 +18393,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr } /* "View.MemoryView":1187 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, @@ -18410,7 +18410,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1196 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride @@ -18419,7 +18419,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ if (__pyx_t_1) { /* "View.MemoryView":1197 - * + * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< * strides[idx] = stride @@ -18451,7 +18451,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1196 * cdef int idx - * + * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride @@ -18475,7 +18475,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< * stride *= shape[idx] - * + * */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; @@ -18483,7 +18483,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< - * + * * return stride */ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); @@ -18493,16 +18493,16 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ /* "View.MemoryView":1205 * stride *= shape[idx] - * + * * return stride # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_data_to_temp') */ __pyx_r = __pyx_v_stride; goto __pyx_L0; /* "View.MemoryView":1187 - * + * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, @@ -18515,7 +18515,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ } /* "View.MemoryView":1208 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, @@ -18540,26 +18540,26 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1219 * cdef void *result - * + * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef size_t size = slice_get_size(src, ndim) - * + * */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1220 - * + * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< - * + * * result = malloc(size) */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); /* "View.MemoryView":1222 * cdef size_t size = slice_get_size(src, ndim) - * + * * result = malloc(size) # <<<<<<<<<<<<<< * if not result: * _err(MemoryError, NULL) @@ -18567,11 +18567,11 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_result = malloc(__pyx_v_size); /* "View.MemoryView":1223 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { @@ -18580,23 +18580,23 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error) /* "View.MemoryView":1223 - * + * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) - * + * */ } /* "View.MemoryView":1227 - * - * + * + * * tmpslice.data = result # <<<<<<<<<<<<<< * tmpslice.memview = src.memview * for i in range(ndim): @@ -18604,7 +18604,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_tmpslice->data = ((char *)__pyx_v_result); /* "View.MemoryView":1228 - * + * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< * for i in range(ndim): @@ -18630,7 +18630,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< * tmpslice.suboffsets[i] = -1 - * + * */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); @@ -18638,7 +18638,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * 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]) = -1L; @@ -18646,16 +18646,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1233 * tmpslice.suboffsets[i] = -1 - * + * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< * ndim, order) - * + * */ (void)(__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":1237 - * - * + * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 @@ -18666,11 +18666,11 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1238 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { @@ -18679,24 +18679,24 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< - * + * * if slice_is_contig(src[0], order, ndim): */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; /* "View.MemoryView":1238 - * + * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 - * + * */ } } /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: @@ -18705,7 +18705,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, if (__pyx_t_2) { /* "View.MemoryView":1242 - * + * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< * else: @@ -18715,7 +18715,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 - * + * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: @@ -18727,7 +18727,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< - * + * * return result */ /*else*/ { @@ -18737,16 +18737,16 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, /* "View.MemoryView":1246 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) - * + * * return result # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "View.MemoryView":1208 - * + * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, @@ -18770,7 +18770,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, } /* "View.MemoryView":1251 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: @@ -18796,7 +18796,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent * 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_ERR(2, 1254, __pyx_L1_error) @@ -18822,7 +18822,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent * 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_ERR(2, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -18835,7 +18835,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent __PYX_ERR(2, 1253, __pyx_L1_error) /* "View.MemoryView":1251 - * + * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: @@ -18858,11 +18858,11 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent } /* "View.MemoryView":1257 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { @@ -18885,7 +18885,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, * @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_ERR(2, 1258, __pyx_L1_error) @@ -18918,11 +18918,11 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, __PYX_ERR(2, 1258, __pyx_L1_error) /* "View.MemoryView":1257 - * + * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) - * + * */ /* function exit code */ @@ -18942,7 +18942,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, } /* "View.MemoryView":1261 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: @@ -19019,7 +19019,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_copy_contents') */ /*else*/ { @@ -19028,7 +19028,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { } /* "View.MemoryView":1261 - * + * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: @@ -19052,7 +19052,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { } /* "View.MemoryView":1268 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, @@ -19123,13 +19123,13 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice tmp - * + * */ __pyx_v_direct_copy = 0; /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: @@ -19138,7 +19138,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_2) { /* "View.MemoryView":1285 - * + * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< * elif dst_ndim < src_ndim: @@ -19148,7 +19148,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp - * + * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: @@ -19161,7 +19161,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { @@ -19170,7 +19170,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< - * + * * cdef int ndim = max(src_ndim, dst_ndim) */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); @@ -19180,16 +19180,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * */ } __pyx_L3:; /* "View.MemoryView":1289 * broadcast_leading(&dst, dst_ndim, src_ndim) - * + * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< - * + * * for i in range(ndim): */ __pyx_t_3 = __pyx_v_dst_ndim; @@ -19203,7 +19203,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1291 * cdef int ndim = max(src_ndim, dst_ndim) - * + * * for i in range(ndim): # <<<<<<<<<<<<<< * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: @@ -19214,7 +19214,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1292 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: @@ -19265,7 +19265,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< - * + * * if src.suboffsets[i] >= 0: */ /*else*/ { @@ -19274,7 +19274,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_L7:; /* "View.MemoryView":1292 - * + * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: @@ -19284,38 +19284,38 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":1300 - * + * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< - * + * * if slices_overlap(&src, &dst, ndim, itemsize): */ __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1300, __pyx_L1_error) /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) - * + * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * */ } } /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); @@ -19323,73 +19323,73 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1305 - * + * * 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); /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): - * + * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) - * + * */ } /* "View.MemoryView":1307 * order = get_best_order(&dst, ndim) - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp - * + * */ __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1307, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; /* "View.MemoryView":1308 - * + * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< - * + * * if not broadcasting: */ __pyx_v_src = __pyx_v_tmp; /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) - * + * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< - * + * * if not slice_is_contig(src, order, ndim): */ } /* "View.MemoryView":1310 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1313 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): @@ -19398,7 +19398,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_2) { /* "View.MemoryView":1314 - * + * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< * elif slice_is_contig(src, 'F', ndim): @@ -19407,8 +19407,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); /* "View.MemoryView":1313 - * - * + * + * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): @@ -19421,7 +19421,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * */ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { @@ -19430,7 +19430,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * 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); @@ -19440,16 +19440,16 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * 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":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ __pyx_t_2 = (__pyx_v_direct_copy != 0); @@ -19457,7 +19457,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1320 * if direct_copy: - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) @@ -19465,7 +19465,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":1321 - * + * * 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) @@ -19487,7 +19487,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ free(__pyx_v_tmpdata); @@ -19495,7 +19495,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * if order == 'F' == get_best_order(&dst, ndim): */ __pyx_r = 0; @@ -19503,28 +19503,28 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) - * + * * if direct_copy: # <<<<<<<<<<<<<< - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) */ } /* "View.MemoryView":1310 * src = tmp - * + * * if not broadcasting: # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":1326 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_2 = (__pyx_v_order == 'F'); if (__pyx_t_2) { @@ -19534,35 +19534,35 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ if (__pyx_t_8) { /* "View.MemoryView":1329 - * - * + * + * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) - * + * */ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error) /* "View.MemoryView":1330 - * + * * 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 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error) /* "View.MemoryView":1326 * return 0 - * + * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< - * - * + * + * */ } /* "View.MemoryView":1332 * transpose_memslice(&dst) - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) @@ -19570,11 +19570,11 @@ 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":1333 - * + * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); @@ -19582,32 +19582,32 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * + * * free(tmpdata) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1336 * refcount_copying(&dst, dtype_is_object, ndim, True) - * + * * free(tmpdata) # <<<<<<<<<<<<<< * return 0 - * + * */ free(__pyx_v_tmpdata); /* "View.MemoryView":1337 - * + * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_broadcast_leading') */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":1268 - * + * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, @@ -19631,7 +19631,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_ } /* "View.MemoryView":1340 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, @@ -19649,14 +19649,14 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< - * + * * for i in range(ndim - 1, -1, -1): */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); /* "View.MemoryView":1346 * cdef int offset = ndim_other - ndim - * + * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] @@ -19665,7 +19665,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1347 - * + * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< * mslice.strides[i + offset] = mslice.strides[i] @@ -19678,7 +19678,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); @@ -19686,7 +19686,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * 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_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); @@ -19694,7 +19694,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic /* "View.MemoryView":1351 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] - * + * * for i in range(offset): # <<<<<<<<<<<<<< * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] @@ -19705,7 +19705,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1352 - * + * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< * mslice.strides[i] = mslice.strides[0] @@ -19718,7 +19718,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< * mslice.suboffsets[i] = -1 - * + * */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); @@ -19726,14 +19726,14 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< - * - * + * + * */ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } /* "View.MemoryView":1340 - * + * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, @@ -19744,19 +19744,19 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslic } /* "View.MemoryView":1362 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; /* "View.MemoryView":1366 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) @@ -19765,17 +19765,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i if (__pyx_t_1) { /* "View.MemoryView":1367 - * + * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< * dst.strides, ndim, inc) - * + * */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1366 - * - * + * + * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) @@ -19783,18 +19783,18 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i } /* "View.MemoryView":1362 - * + * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: - * + * */ /* function exit code */ } /* "View.MemoryView":1371 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -19812,13 +19812,13 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1371 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -19833,7 +19833,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da } /* "View.MemoryView":1377 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): @@ -19851,7 +19851,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss /* "View.MemoryView":1381 * cdef Py_ssize_t i - * + * * for i in range(shape[0]): # <<<<<<<<<<<<<< * if ndim == 1: * if inc: @@ -19862,7 +19862,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1382 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: @@ -19913,7 +19913,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss __pyx_L6:; /* "View.MemoryView":1382 - * + * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: @@ -19927,7 +19927,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< * ndim - 1, inc) - * + * */ /*else*/ { @@ -19935,7 +19935,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss * 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); @@ -19944,16 +19944,16 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss /* "View.MemoryView":1391 * ndim - 1, inc) - * + * * data += strides[0] # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } /* "View.MemoryView":1377 - * + * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): @@ -19965,7 +19965,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss } /* "View.MemoryView":1397 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, @@ -19996,13 +19996,13 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1397 - * + * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, @@ -20013,7 +20013,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst } /* "View.MemoryView":1407 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -20034,7 +20034,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t extent = shape[0] - * + * */ __pyx_v_stride = (__pyx_v_strides[0]); @@ -20042,14 +20042,14 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< - * + * * if ndim == 1: */ __pyx_v_extent = (__pyx_v_shape[0]); /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) @@ -20058,7 +20058,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t if (__pyx_t_1) { /* "View.MemoryView":1415 - * + * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< * memcpy(data, item, itemsize) @@ -20090,7 +20090,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] - * + * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) @@ -20124,8 +20124,8 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } @@ -20133,7 +20133,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t __pyx_L3:; /* "View.MemoryView":1407 - * + * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, @@ -21471,22 +21471,22 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":947 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":947 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_umath() except -1: */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../../tmp/build-env-ju6z9ren/lib/python3.8/site-packages/numpy/__init__.pxd":953 + /* "../../../../../home/wpreimes/miniconda3/envs/smecv_validation/lib/python3.8/site-packages/numpy/__init__.pxd":953 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< - * + * * cdef inline int import_ufunc() except -1: */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 953, __pyx_L1_error) @@ -21494,10 +21494,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__10); /* "View.MemoryView":133 - * + * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< - * + * * if itemsize <= 0: */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 133, __pyx_L1_error) @@ -21505,10 +21505,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__11); /* "View.MemoryView":136 - * + * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< - * + * * if not isinstance(format, bytes): */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 136, __pyx_L1_error) @@ -21516,11 +21516,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__12); /* "View.MemoryView":148 - * + * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); @@ -21530,7 +21530,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< - * + * * if self.dtype_is_object: */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 176, __pyx_L1_error) @@ -21571,7 +21571,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< - * + * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 418, __pyx_L1_error) @@ -21593,7 +21593,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< - * + * * if flags & PyBUF_ND: */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 520, __pyx_L1_error) @@ -21602,9 +21602,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "View.MemoryView":570 * if self.view.strides == NULL: - * + * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< - * + * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 570, __pyx_L1_error) @@ -21615,7 +21615,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * 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(2, 577, __pyx_L1_error) @@ -21659,8 +21659,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * 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_ERR(2, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); @@ -21711,7 +21711,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "View.MemoryView":286 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") @@ -21721,11 +21721,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__33); /* "View.MemoryView":287 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); @@ -21735,30 +21735,30 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "View.MemoryView":291 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "View.MemoryView":292 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); @@ -21904,7 +21904,7 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else @@ -22179,9 +22179,9 @@ if (!__Pyx_RefNanny) { /* "pytesmo/time_series/filters.pyx":37 * ''' - * + * * import platform # <<<<<<<<<<<<<< - * + * * cimport numpy as np */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_platform, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) @@ -22190,7 +22190,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pytesmo/time_series/filters.pyx":40 - * + * * cimport numpy as np * import numpy as np # <<<<<<<<<<<<<< * from libc.math cimport exp, fabs, isnan @@ -22417,9 +22417,9 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":209 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * + * * def __dealloc__(array self): */ __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 209, __pyx_L1_error) @@ -22430,7 +22430,7 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":286 * return self.name - * + * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") @@ -22443,11 +22443,11 @@ if (!__Pyx_RefNanny) { __pyx_t_5 = 0; /* "View.MemoryView":287 - * + * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") - * + * */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -22460,8 +22460,8 @@ if (!__Pyx_RefNanny) { * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -22471,11 +22471,11 @@ if (!__Pyx_RefNanny) { __pyx_t_5 = 0; /* "View.MemoryView":291 - * - * + * + * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") - * + * */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -22485,11 +22485,11 @@ if (!__Pyx_RefNanny) { __pyx_t_5 = 0; /* "View.MemoryView":292 - * + * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -22499,7 +22499,7 @@ if (!__Pyx_RefNanny) { __pyx_t_5 = 0; /* "View.MemoryView":316 - * + * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ @@ -22526,10 +22526,10 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":549 * info.obj = self - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -22539,10 +22539,10 @@ if (!__Pyx_RefNanny) { /* "View.MemoryView":995 * return self.from_object - * + * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< - * - * + * + * */ __pyx_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -25309,8 +25309,8 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED llx = lla + llb; return PyLong_FromLongLong(llx); #endif - - + + } #endif if (PyFloat_CheckExact(op1)) { diff --git a/src/pytesmo/timedate/julian.py b/src/pytesmo/timedate/julian.py index 9ab4c313..b5ab171d 100644 --- a/src/pytesmo/timedate/julian.py +++ b/src/pytesmo/timedate/julian.py @@ -5,23 +5,36 @@ This module will be removed in future versions of pytesmo """ -import numpy as np import pandas as pd import datetime as dt import pytz import warnings -warnings.warn("pytesmo.timdate.julian has moved to the cadati pip package " - "Import from pytesmo will not work in future versions of the package", - DeprecationWarning) from cadati.check_date import is_leap_year -from cadati.jd_date import julday, caldat, julian2date, julian2datetime, \ - julian2num, num2julian +from cadati.jd_date import ( + julday, + caldat, + julian2date, + julian2datetime, + julian2num, + num2julian, +) from cadati.conv_doy import doy from pytesmo.utils import deprecated -@deprecated +# deprecated calls: +__all__ = ['is_leap_year', 'julday', 'caldat', 'julian2datetime', + 'julian2num', 'num2julian', 'doy'] + +warnings.warn( + "pytesmo.timdate.julian has moved to the cadati pip package " + "Import from pytesmo will not work in future versions of the package", + DeprecationWarning, +) + + +@deprecated() def julian2doy(j, consider_nonleap_years=True): """ Calendar date from julian date. @@ -37,9 +50,12 @@ def julian2doy(j, consider_nonleap_years=True): doy : numpy.ndarray or int32 Day of year. """ - return julian2date(j, return_doy=True, doy_leap_year=not consider_nonleap_years)[-1] + return julian2date( + j, return_doy=True, doy_leap_year=not consider_nonleap_years + )[-1] + -@deprecated +@deprecated() def julian2datetimeindex(j, tz=pytz.UTC): """ Converting Julian days to datetimeindex. @@ -56,7 +72,11 @@ def julian2datetimeindex(j, tz=pytz.UTC): """ year, month, day, hour, minute, second, microsecond = julian2date(j) - return pd.DatetimeIndex([dt.datetime(y, m, d, h, mi, s, ms, tz) - for y, m, d, h, mi, s, ms in - zip(year, month, day, hour, minute, - second, microsecond)]) \ No newline at end of file + return pd.DatetimeIndex( + [ + dt.datetime(y, m, d, h, mi, s, ms, tz) + for y, m, d, h, mi, s, ms in zip( + year, month, day, hour, minute, second, microsecond + ) + ] + ) diff --git a/src/pytesmo/utils.py b/src/pytesmo/utils.py index 5aa31552..aea2df08 100644 --- a/src/pytesmo/utils.py +++ b/src/pytesmo/utils.py @@ -33,20 +33,47 @@ import scipy.interpolate as sc_int import scipy.optimize as sc_opt import scipy.special as sc_special -import warnings + import functools +import inspect +import warnings + + +def deprecated(message: str = None): + """ + Decorator for classes or functions to mark them as deprecated. + If the decorator is applied without a specific message (`@deprecated()`), + the default warning is shown when using the function/class. To specify + a custom message use it like: + @deprecated('Don't use this function anymore!'). + + Parameters + ---------- + message : str, optional (default: None) + Custom message to show with the DeprecationWarning. + """ + + def decorator(src): + default_msg = f"Pytesmo " \ + f"{'class' if inspect.isclass(src) else 'method'} " \ + f"'{src.__module__}.{src.__name__}' " \ + f"is deprecated and will be removed soon." + + @functools.wraps(src) + def new_func(*args, **kwargs): + warnings.simplefilter('always', DeprecationWarning) + + warnings.warn( + default_msg if message is None else message, + category=DeprecationWarning, + stacklevel=2 + ) + warnings.simplefilter('default', DeprecationWarning) + return src(*args, **kwargs) + + return new_func + return decorator -def deprecated(func): - # mark func as deprecated (warn when used) - @functools.wraps(func) - def new_func(*args, **kwargs): - warnings.simplefilter('always', DeprecationWarning) - warnings.warn(f"Pytesmo function {func.__name__} is deprecated and will be removed soon", - category=DeprecationWarning, - stacklevel=2) - warnings.simplefilter('default', DeprecationWarning) # reset filter - return func(*args, **kwargs) - return new_func def ml_percentile(in_data, percentiles): """ @@ -104,7 +131,8 @@ def interp_uniq(src): if len(pos) > 1: if pos[0] == 0 and pos[-1] < size - 1: src[ - pos[-1]] = (src[pos[len(pos) - 2]] + src[pos[-1] + 1]) / 2.0 + pos[-1]] = (src[pos[len(pos) - 2]] + + src[pos[-1] + 1]) / 2.0 elif pos[-1] == size - 1: src[pos[0]] = ( src[pos[1]] + src[pos[0] - 1]) / 2.0 @@ -255,6 +283,7 @@ def ensure_iterable(el): else: return el + def array_dropna(*arrs): """ Drop elements from input arrays where ANY array is NaN diff --git a/src/pytesmo/validation_framework/adapters.py b/src/pytesmo/validation_framework/adapters.py index c7a349d1..31c849be 100644 --- a/src/pytesmo/validation_framework/adapters.py +++ b/src/pytesmo/validation_framework/adapters.py @@ -1,73 +1,127 @@ -# Copyright (c) 2016,Vienna University of Technology, -# Department of Geodesy and Geoinformation +# Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation # All rights reserved. -import warnings # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of the Vienna University of Technology, Department of -# Geodesy and Geoinformation nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific -# prior written permission. +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the TU Wien, Department of Geodesy and +# Geoinformation nor the names of its contributors may be used to endorse +# or promote products derived from this software without specific prior +# written permission. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, DEPARTMENT OF -# GEODESY AND GEOINFORMATION 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. - -''' +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, +# DEPARTMENT OF GEODESY AND GEOINFORMATION 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. + + +""" Module containing adapters that can be used together with the validation framework. -''' +""" import operator from pytesmo.time_series.anomaly import calc_anomaly from pytesmo.time_series.anomaly import calc_climatology +from pytesmo.utils import deprecated from pandas import DataFrame +import warnings +_op_lookup = { + "<": operator.lt, + "<=": operator.le, + "==": operator.eq, + "!=": operator.ne, + ">=": operator.ge, + ">": operator.gt, +} -class BasicAdapter(object): + +class BasicAdapter: """ - Base class for other adapters that works around data readers that don't - return a DataFrame (e.g. ASCAT). Also removes unnecessary timezone information in data. + Adapter to modify the return value of reading functions from base class. + - Pick data frame from objects that have a `data_property_name`, + i.e. ascat time series objects. + - Removes unnecessary timezone information in pandas data frames which + pytesmo can not use. + - adds a method with the name given in `read_name` that calls the same + method from cls but modifies the returned data frame. """ - def __init__(self, cls, data_property_name='data'): + + def __init__(self, cls, data_property_name="data", read_name=None): + """ + Parameters + ---------- + cls: object + The original reader to adapt. + data_property_name: str, optional (default: "data") + Attribute name under which the pandas DataFrame containing the time + series is found in the object returned by the read function of the + original reader. Ignored if no attribute of this name is found. + Then it is required that the DataFrame is already the return value + of the read function. + read_name: str, optional (default: None) + To enable the adapter for a method other than `read` or `read_ts` + give the function name here (a function of that name must exist in + cls). A method of the same name will be added to the adapted + Reader, which takes the same arguments as the base method. + The output of this method will be changed by the adapter. + If None is passed, only data from `read` and `read_ts` of cls + will be adapted. + """ + self.cls = cls self.data_property_name = data_property_name + self.read_name = read_name + + if read_name: + setattr(self, read_name, self._adapt_custom) def __get_dataframe(self, data): - if ((not isinstance(data, DataFrame)) and (hasattr(data, self.data_property_name)) and - (isinstance(getattr(data, self.data_property_name), DataFrame))): + if ( + (not isinstance(data, DataFrame)) + and (hasattr(data, self.data_property_name)) + and (isinstance(getattr(data, self.data_property_name), DataFrame)) + ): data = getattr(data, self.data_property_name) return data def __drop_tz_info(self, data): - if (hasattr(data.index, 'tz') and (data.index.tz is not None)): - warnings.warn('Dropping timezone information ({}) for data from reader {}'.format(data.index.tz, self.cls.__class__.__name__)) + if hasattr(data.index, "tz") and (data.index.tz is not None): + warnings.warn( + f"Dropping timezone information ({data.index.tz})" + f" for data from reader {self.cls.__class__.__name__}" + ) data.index = data.index.tz_convert(None) return data + def _adapt(self, df: DataFrame) -> DataFrame: + # drop time zone info and extract df from ASCAT TS object + return self.__drop_tz_info(self.__get_dataframe(df)) + + def _adapt_custom(self, *args, **kwargs): + # modifies data from whatever function was set as `read_name`. + data = getattr(self.cls, self.read_name)(*args, **kwargs) + return self._adapt(data) + def read_ts(self, *args, **kwargs): - data = self.cls.read_ts(*args, **kwargs) - data = self.__drop_tz_info(self.__get_dataframe(data)) - return data + data = getattr(self.cls, "read_ts")(*args, **kwargs) + return self._adapt(data) def read(self, *args, **kwargs): - data = self.cls.read(*args, **kwargs) - data = self.__drop_tz_info(self.__get_dataframe(data)) - return data + data = getattr(self.cls, "read")(*args, **kwargs) + return self._adapt(data) @property def grid(self): @@ -78,6 +132,10 @@ def grid(self): return self.cls.grid +@deprecated( + "`MaskingAdapter` is deprecated, use `SelfMaskingAdapter` " + "or `AdvancedMaskingAdapter` instead." +) class MaskingAdapter(BasicAdapter): """ Transform the given class to return a boolean dataset given the operator @@ -88,41 +146,56 @@ class MaskingAdapter(BasicAdapter): Parameters ---------- cls: object - has to have a read_ts or read method - operator: string - one of '<', '<=', '==', '>=', '>', '!=' - threshold: - value to use as the threshold combined with the operator - column_name: string, optional - name of the column to cut the read masking dataset to + Reader object, has to have a `read_ts` or `read` method or a method + name must be specified in the `read_name` kwarg. The same method will + be available for the adapted version of the reader. + op: str or Callable + Either a string to look up a function from + :const:`pytesmo/validation_framework/adapters.py._op_lookup` + or a function that takes `data` and `threshold` as arguments. + threshold: Any + Value to use as the threshold combined with the operator to mask + elements in `column_name` + column_name: str, optional (default: None) + Name of the column to apply `op` to. If None is passed, + nothing happens. + data_property_name: str, optional (default: "data") + Attribute name under which the pandas DataFrame containing the time + series is found in the object returned by the read function of the + original reader. Ignored if no attribute of this name is found. + Then it is required that the DataFrame is already the return value + of the read function. + read_name: str, optional (default: None) + To enable the adapter for a method other than `read` or `read_ts` + give the function name here (a function of that name must exist in + cls). A method of the same name will be added to the adapted + Reader, which takes the same arguments as the base method. + The output of this method will be changed by the adapter. + If None is passed, only data from `read` and `read_ts` of cls + will be adapted. """ - def __init__(self, cls, op, threshold, column_name = None): - super(MaskingAdapter, self).__init__(cls) + def __init__(self, cls, op, threshold, column_name=None, **kwargs): + + super().__init__(cls, **kwargs) + + if callable(op): + self.operator = op + elif op in _op_lookup: + self.operator = _op_lookup[op] + else: + raise ValueError('"{}" is not a valid operator'.format(op)) - self.op_lookup = {'<': operator.lt, - '<=': operator.le, - '==': operator.eq, - '!=': operator.ne, - '>=': operator.ge, - '>': operator.gt} - self.operator = self.op_lookup[op] self.threshold = threshold self.column_name = column_name - def __mask(self, data): + def _adapt(self, data): + data = super()._adapt(data) if self.column_name is not None: data = data.loc[:, [self.column_name]] return self.operator(data, self.threshold) - def read_ts(self, *args, **kwargs): - data = super(MaskingAdapter, self).read_ts(*args, **kwargs) - return self.__mask(data) - - def read(self, *args, **kwargs): - data = super(MaskingAdapter, self).read(*args, **kwargs) - return self.__mask(data) class SelfMaskingAdapter(BasicAdapter): """ @@ -134,84 +207,107 @@ class SelfMaskingAdapter(BasicAdapter): Parameters ---------- cls: object - has to have a read_ts or read method - operator: string - one of '<', '<=', '==', '>=', '>', '!=' - threshold: - value to use as the threshold combined with the operator - column_name: string - name of the column to apply the threshold to + Reader object, has to have a `read_ts` or `read` method or a method + name must be specified in the `read_name` kwarg. The same method will + be available for the adapted version of the reader. + op: str or Callable + Either a string to look up a function from + :const:`pytesmo/validation_framework/adapters.py._op_lookup` + or a function that takes `data` and `threshold` as arguments. + threshold: Any + Value to use as the threshold combined with the operator to mask + elements in `column_name` + column_name: str + Name of the column to apply `op` to + data_property_name: str, optional (default: "data") + Attribute name under which the pandas DataFrame containing the time + series is found in the object returned by the read function of the + original reader. Ignored if no attribute of this name is found. + Then it is required that the DataFrame is already the return value + of the read function. + read_name: str, optional (default: None) + To enable the adapter for a method other than `read` or `read_ts` + give the function name here (a function of that name must exist in + cls). A method of the same name will be added to the adapted + Reader, which takes the same arguments as the base method. + The output of this method will be changed by the adapter. + If None is passed, only data from `read` and `read_ts` of cls + will be adapted. """ - def __init__(self, cls, op, threshold, column_name): - super(SelfMaskingAdapter, self).__init__(cls) + def __init__(self, cls, op, threshold, column_name, **kwargs): - self.op_lookup = {'<': operator.lt, - '<=': operator.le, - '==': operator.eq, - '!=': operator.ne, - '>=': operator.ge, - '>': operator.gt} + super().__init__(cls, **kwargs) + + if callable(op): + self.operator = op + elif op in _op_lookup: + self.operator = _op_lookup[op] + else: + raise ValueError(f"'{op}' is not a valid operator") - self.operator = self.op_lookup[op] self.threshold = threshold self.column_name = column_name - def __mask(self, data): + def _adapt(self, data): + data = super()._adapt(data) mask = self.operator(data[self.column_name], self.threshold) return data[mask] - def read_ts(self, *args, **kwargs): - data = super(SelfMaskingAdapter, self).read_ts(*args, **kwargs) - return self.__mask(data) - - def read(self, *args, **kwargs): - data = super(SelfMaskingAdapter, self).read(*args, **kwargs) - return self.__mask(data) - class AdvancedMaskingAdapter(BasicAdapter): """ Transform the given (reader) class to return a dataset that is masked based - on the given list of filters. A filter is a 3-tuple of column_name, operator, and threshold. - This class calls the read_ts or read method of the given reader instance, applies all filters - separately, ANDs all filters together, and masks the whole dataframe with the result. + on the given list of filters. A filter is a 3-tuple of column_name, + operator, and threshold. + This class calls the reading method of the given reader instance, + applies all filters separately, ANDs all filters together, and masks the + whole dataframe with the result. Parameters ---------- cls: object - has to have a read_ts or read method + Reader object, has to have a `read_ts` or `read` method or a method + name must be specified in the `read_name` kwarg. The same method will + be available for the adapted version of the reader. filter_list: list of 3-tuples: column_name, operator, and threshold. 'column_name': string name of the column to apply the operator to - 'operator': callable or string; - callable needs to accept two parameters (e.g. my_mask(a,b); - the threshold will be passed to the second parameter - string needs to be one of '<', '<=', '==', '>=', '>', '!=' + 'operator': Callable or str; + string needs to be one of '<', '<=', '==', '>=', '>', '!=' or a + function that takes data and threshold as arguments. 'threshold': value to use as the threshold combined with the operator; + data_property_name: str, optional (default: "data") + Attribute name under which the pandas DataFrame containing the time + series is found in the object returned by the read function of the + original reader. Ignored if no attribute of this name is found. + Then it is required that the DataFrame is already the return value + of the read function. + read_name: str, optional (default: None) + To enable the adapter for a method other than `read` or `read_ts` + give the function name here (a function of that name must exist in + cls). A method of the same name will be added to the adapted + Reader, which takes the same arguments as the base method. + The output of this method will be changed by the adapter. + If None is passed, only data from `read` and `read_ts` of cls + will be adapted. """ - def __init__(self, cls, filter_list): - super(AdvancedMaskingAdapter, self).__init__(cls) + def __init__(self, cls, filter_list, **kwargs): - self.op_lookup = {'<': operator.lt, - '<=': operator.le, - '==': operator.eq, - '!=': operator.ne, - '>=': operator.ge, - '>': operator.gt, - 'contains': operator.contains} + super().__init__(cls, **kwargs) self.filter_list = filter_list - def __mask(self, data): + def _adapt(self, data): + data = super()._adapt(data) mask = None for column_name, op, threshold in self.filter_list: if callable(op): operator = op - elif op in self.op_lookup: - operator = self.op_lookup[op] + elif op in _op_lookup: + operator = _op_lookup[op] else: raise ValueError('"{}" is not a valid operator'.format(op)) @@ -224,80 +320,107 @@ def __mask(self, data): return data[mask] - def read_ts(self, *args, **kwargs): - data = super(AdvancedMaskingAdapter, self).read_ts(*args, **kwargs) - return self.__mask(data) - - def read(self, *args, **kwargs): - data = super(AdvancedMaskingAdapter, self).read(*args, **kwargs) - return self.__mask(data) class AnomalyAdapter(BasicAdapter): """ - Takes the pandas DataFrame that the read_ts or read method of the instance - returns and calculates the anomaly of the time series based on a moving - average. - + Takes the pandas DataFrame that reader returns and calculates the + anomaly of the time series based on a moving average. Parameters ---------- - cls : class instance - Must have a read_ts or read method returning a pandas.DataFrame - window_size : float, optional + cls: object + Reader object, has to have a `read_ts` or `read` method or a method + name must be specified in the `read_name` kwarg. The same method will + be available for the adapted version of the reader. + window_size : float, optional (default: 35) The window-size [days] of the moving-average window to calculate the - anomaly reference (only used if climatology is not provided) - Default: 35 (days) + anomaly reference. columns: list, optional columns in the dataset for which to calculate anomalies. + data_property_name: str, optional (default: "data") + Attribute name under which the pandas DataFrame containing the time + series is found in the object returned by the read function of the + original reader. Ignored if no attribute of this name is found. + Then it is required that the DataFrame is already the return value + of the read function. + read_name: str, optional (default: None) + To enable the adapter for a method other than `read` or `read_ts` + give the function name here (a function of that name must exist in + cls). A method of the same name will be added to the adapted + Reader, which takes the same arguments as the base method. + The output of this method will be changed by the adapter. + If None is passed, only data from `read` and `read_ts` of cls + will be adapted. """ - def __init__(self, cls, window_size=35, columns=None): - super(AnomalyAdapter, self).__init__(cls) + def __init__(self, cls, window_size=35, columns=None, **kwargs): + + super().__init__(cls, **kwargs) + self.window_size = window_size self.columns = columns - def calc_anom(self, data): + def _adapt(self, data): + data = super()._adapt(data) if self.columns is None: ite = data else: ite = self.columns for column in ite: - data[column] = calc_anomaly(data[column], - window_size=self.window_size) + data[column] = calc_anomaly( + data[column], window_size=self.window_size + ) return data - def read_ts(self, *args, **kwargs): - data = super(AnomalyAdapter, self).read_ts(*args, **kwargs) - return self.calc_anom(data) - - def read(self, *args, **kwargs): - data = super(AnomalyAdapter, self).read(*args, **kwargs) - return self.calc_anom(data) - class AnomalyClimAdapter(BasicAdapter): """ - Takes the pandas DataFrame that the read_ts or read method of the instance - returns and calculates the anomaly of the time series based on a moving - average. - + Takes the pandas DataFrame that reader returns and calculates the + anomaly of the time series based on the (long-term) average of the series. Parameters ---------- - cls : class instance - Must have a read_ts or read method returning a pandas.DataFrame - columns: list, optional - columns in the dataset for which to calculate anomalies. + cls: object + Reader object, has to have a `read_ts` or `read` method or a method + name must be specified in the `read_name` kwarg. The same method will + be available for the adapted version of the reader. + columns: list, optional (default: None) + Columns in the dataset for which to calculate anomalies. If None is + passed, the anomaly is calculated for all columns. + data_property_name: str, optional (default: "data") + Attribute name under which the pandas DataFrame containing the time + series is found in the object returned by the read function of the + original reader. Ignored if no attribute of this name is found. + Then it is required that the DataFrame is already the return value + of the read function. + read_name: str, optional (default: None) + To enable the adapter for a method other than `read` or `read_ts` + give the function name here (a function of that name must exist in + cls). A method of the same name will be added to the adapted + Reader, which takes the same arguments as the base method. + The output of this method will be changed by the adapter. + If None is passed, only data from `read` and `read_ts` of cls + will be adapted. kwargs: - Any additional arguments will be given to the calc_climatology function. + Any remaining keyword arguments will be given to + :func:`pytesmo.time_series.anomaly.calc_climatology` """ def __init__(self, cls, columns=None, **kwargs): - super(AnomalyClimAdapter, self).__init__(cls) + + cls_kwargs = dict() + if "data_property_name" in kwargs: + cls_kwargs["data_property_name"] = kwargs.pop("data_property_name") + if "read_name" in kwargs: + cls_kwargs["read_name"] = kwargs.pop("read_name") + + super().__init__(cls, **cls_kwargs) + self.kwargs = kwargs self.columns = columns - def calc_anom(self, data): + def _adapt(self, data): + data = super()._adapt(data) if self.columns is None: ite = data else: @@ -305,15 +428,8 @@ def calc_anom(self, data): for column in ite: clim = calc_climatology(data[column], **self.kwargs) data[column] = calc_anomaly(data[column], climatology=clim) - return data - def read_ts(self, *args, **kwargs): - data = super(AnomalyClimAdapter, self).read_ts(*args, **kwargs) - return self.calc_anom(data) - - def read(self, *args, **kwargs): - data = super(AnomalyClimAdapter, self).read(*args, **kwargs) - return self.calc_anom(data) + return data class ColumnCombineAdapter(BasicAdapter): @@ -321,44 +437,66 @@ class ColumnCombineAdapter(BasicAdapter): Takes the pandas DataFrame that the read_ts or read method of the instance returns and applies a function to merge multiple columns into one. E.g. when there are 2 Soil Moisture parameters in a dataset that should be - averaged on reading. Will add one additional column to the input data frame. + averaged on reading. Will add one additional column to the input data + frame. """ - def __init__(self, cls, func, func_kwargs=None, columns=None, new_name='merged'): + def __init__( + self, + cls, + func, + func_kwargs=None, + columns=None, + new_name="merged", + **kwargs, + ): """ Parameters ---------- - cls : class instance - Must have a read_ts or read method returning a pandas.DataFrame + cls : object + Reader object, has to have a `read_ts` or `read` method or a + method name must be specified in the `read_name` kwarg. + The same method will be available for the adapted version of the + reader. func: Callable - Will be applied to dataframe columns using pd.DataFrame.apply(..., axis=1) + Will be applied to dataframe columns using + pd.DataFrame.apply(..., axis=1) additional kwargs for this must be given in func_kwargs, - e.g. pd.DataFrame.mean + e.g. :func:`pd.DataFrame.mean` func_kwargs : dict, optional (default: None) - kwargs that are passed to method + kwargs that are passed to method or None to use the default ones. columns: list, optional (default: None) Columns in the dataset that are combined. If None are selected all columns are used. new_name: str, optional (default: merged) Name that the merged column will have in the returned data frame. + data_property_name: str, optional (default: "data") + Attribute name under which the pandas DataFrame containing the + time series is found in the object returned by the read function + of the original reader. + Ignored if no attribute of this name is found. + Then it is required that the DataFrame is already the return value + of the read function. + read_name: str, optional (default: None) + To enable the adapter for a method other than `read` or `read_ts` + give the function name here (a function of that name must exist in + cls). A method of the same name will be added to the adapted + Reader, which takes the same arguments as the base method. + The output of this method will be changed by the adapter. + If None is passed, only data from `read` and `read_ts` of cls + will be adapted. """ - super(ColumnCombineAdapter, self).__init__(cls) + super().__init__(cls, **kwargs) self.func = func self.func_kwargs = func_kwargs if func_kwargs is not None else {} - self.func_kwargs['axis'] = 1 + self.func_kwargs["axis"] = 1 self.columns = columns self.new_name = new_name - def apply(self, data: DataFrame) -> DataFrame: + def _adapt(self, data: DataFrame) -> DataFrame: + data = super()._adapt(data) columns = data.columns if self.columns is None else self.columns new_col = data[columns].apply(self.func, **self.func_kwargs) data[self.new_name] = new_col return data - - def read_ts(self, *args, **kwargs) -> DataFrame: - data = super(ColumnCombineAdapter, self).read_ts(*args, **kwargs) - return self.apply(data) - - def read(self, *args, **kwargs) -> DataFrame: - return self.read_ts(*args, **kwargs) diff --git a/src/pytesmo/validation_framework/data_manager.py b/src/pytesmo/validation_framework/data_manager.py index 0049d1d2..68df48b9 100644 --- a/src/pytesmo/validation_framework/data_manager.py +++ b/src/pytesmo/validation_framework/data_manager.py @@ -1,30 +1,30 @@ -# Copyright (c) 2015, Vienna University of Technology (TU Wien), Department -# of Geodesy and Geoinformation (GEO). +# Copyright (c) 2016,Vienna University of Technology, +# Department of Geodesy and Geoinformation # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the Vienna University of Technology, Department -# of Geodesy and Geoinformation nor the names of its contributors may -# be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, -# DEPARTMENT OF GEODESY AND GEOINFORMATION 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. +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the Vienna University of Technology, Department of +# Geodesy and Geoinformation nor the names of its contributors may be used +# to endorse or promote products derived from this software without +# specific prior written permission. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, DEPARTMENT +# OF GEODESY AND GEOINFORMATION 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. import itertools @@ -43,7 +43,7 @@ class DataManager(MixinReadTs): :Values : dict, containing the following fields 'class' : object - Class containing the method read_ts for reading the data. + Class containing the method `read` for reading the data. 'columns' : list List of columns which will be used in the validation process. 'args' : list, optional @@ -70,14 +70,15 @@ class DataManager(MixinReadTs): Of type [datetime start, datetime end]. If given then the two input datasets will be truncated to start <= dates <= end. read_ts_names : string or dict of strings, optional - if another method name than 'read_ts' should be used for reading the data + if another method name than 'read' should be used for reading the data then it can be specified here. If it is a dict then specify a function name for each dataset. upscale_parms : dict, optional. Default is None. dictionary with parameters for the upscaling methods. Keys: * 'upscaling_method': method for upscaling * 'temporal_stability': bool for using temporal stability - * 'upscaling_lut': dict of shape {'other_name':{ref gpi: [other gpis]}} + * 'upscaling_lut': dict of shape + {'other_name':{ref gpi: [other gpis]}} Methods ------- @@ -93,11 +94,12 @@ class DataManager(MixinReadTs): """ def __init__( - self, datasets, - ref_name, - period=None, - read_ts_names='read_ts', - upscale_parms=None, + self, + datasets, + ref_name, + period=None, + read_ts_names="read", + upscale_parms=None, ): self.datasets = datasets self._add_default_values() @@ -108,12 +110,13 @@ def __init__( for dataset in datasets.keys(): if dataset != ref_name: self.other_name.append(dataset) - if 'use_lut' not in self.datasets[dataset]: - self.datasets[dataset]['use_lut'] = False + if "use_lut" not in self.datasets[dataset]: + self.datasets[dataset]["use_lut"] = False try: - self.reference_grid = self.datasets[ - self.reference_name]['class'].grid + self.reference_grid = self.datasets[self.reference_name][ + "class" + ].grid except AttributeError: self.reference_grid = None @@ -149,11 +152,13 @@ def _add_default_values(self): Add defaults for args, kwargs, grids_compatible, use_lut and lut_max_dist to dataset dictionary. """ - defaults = {'use_lut': False, - 'args': [], - 'kwargs': {}, - 'grids_compatible': False, - 'lut_max_dist': None} + defaults = { + "use_lut": False, + "args": [], + "kwargs": {}, + "grids_compatible": False, + "lut_max_dist": None, + } for dataset in self.datasets.keys(): new_defaults = dict(defaults) new_defaults.update(self.datasets[dataset]) @@ -172,10 +177,11 @@ def get_luts(self): """ luts = {} for other_name in self.other_name: - if self.datasets[other_name]['use_lut']: + if self.datasets[other_name]["use_lut"]: luts[other_name] = self.reference_grid.calc_lut( - self.datasets[other_name]['class'].grid, - max_dist=self.datasets[other_name]['lut_max_dist']) + self.datasets[other_name]["class"].grid, + max_dist=self.datasets[other_name]["lut_max_dist"], + ) else: luts[other_name] = None @@ -185,7 +191,7 @@ def get_luts(self): def ds_dict(self): ds_dict = {} for dataset in self.datasets.keys(): - ds_dict[dataset] = self.datasets[dataset]['columns'] + ds_dict[dataset] = self.datasets[dataset]["columns"] return ds_dict def get_results_names(self, n=2): @@ -196,7 +202,7 @@ def read_reference(self, *args): """ Function to read and prepare the reference dataset. - Calls read_ts of the dataset. + Calls read of the dataset. Takes either 1 (gpi) or 2 (lon, lat) arguments. Parameters @@ -219,7 +225,7 @@ def read_other(self, name, *args): """ Function to read and prepare non-reference datasets. - Calls read_ts of the dataset. + Calls read of the dataset. Takes either 1 (gpi) or 2 (lon, lat) arguments. @@ -306,26 +312,20 @@ def get_other_data(self, gpi, lon, lat): other_dataframes = {} for other_name in self.other_name: - grids_compatible = self.datasets[ - other_name]['grids_compatible'] + grids_compatible = self.datasets[other_name]["grids_compatible"] if grids_compatible: - other_dataframe = self.read_other( - other_name, gpi) + other_dataframe = self.read_other(other_name, gpi) elif isinstance(self.luts, Upscaling): other_dataframe = self.luts.get_upscaled_ts( - gpi=gpi, - other_name=other_name, - **self.upscale_parms + gpi=gpi, other_name=other_name, **self.upscale_parms ) elif self.luts[other_name] is not None: other_gpi = self.luts[other_name][gpi] if other_gpi == -1: continue - other_dataframe = self.read_other( - other_name, other_gpi) + other_dataframe = self.read_other(other_name, other_gpi) else: - other_dataframe = self.read_other( - other_name, lon, lat) + other_dataframe = self.read_other(other_name, lon, lat) if other_dataframe is not None: other_dataframes[other_name] = other_dataframe @@ -333,15 +333,15 @@ def get_other_data(self, gpi, lon, lat): def flatten(seq): - l = [] + eltl = [] for elt in seq: t = type(elt) if t is tuple or t is list: for elt2 in flatten(elt): - l.append(elt2) + eltl.append(elt2) else: - l.append(elt) - return l + eltl.append(elt) + return eltl def get_result_combinations(ds_dict, n=2): @@ -356,7 +356,8 @@ def get_result_combinations(ds_dict, n=2): n: int Number of datasets for combine with each other. If n=2 always two datasets will be combined into one result. - If n=3 always three datasets will be combined into one results and so on. + If n=3 always three datasets will be combined into one results and + so on. n has to be <= the number of total datasets. Returns @@ -387,7 +388,8 @@ def get_result_names(ds_dict, refkey, n=2): n: int Number of datasets for combine with each other. If n=2 always two datasets will be combined into one result. - If n=3 always three datasets will be combined into one results and so on. + If n=3 always three datasets will be combined into one results and + so on. n has to be <= the number of total datasets. Returns @@ -409,8 +411,9 @@ def get_result_names(ds_dict, refkey, n=2): for column in ds_dict[other]: other_columns.append((other, column)) - for comb in itertools.product(ref_columns, - itertools.combinations(other_columns, n - 1)): + for comb in itertools.product( + ref_columns, itertools.combinations(other_columns, n - 1) + ): results_names.append(comb) # flatten to one level and remove those that do not have n unique @@ -419,7 +422,10 @@ def get_result_names(ds_dict, refkey, n=2): # iterate in chunks of n*2 over the list result_combos = [] - for chunk in [results_names[pos:pos + n * 2] for pos in range(0, len(results_names), n * 2)]: + for chunk in [ + results_names[pos: pos + n * 2] + for pos in range(0, len(results_names), n * 2) + ]: combo = [] datasets = chunk[::2] columns = chunk[1::2] diff --git a/src/pytesmo/validation_framework/data_scalers.py b/src/pytesmo/validation_framework/data_scalers.py index e85bf2d6..996bc980 100644 --- a/src/pytesmo/validation_framework/data_scalers.py +++ b/src/pytesmo/validation_framework/data_scalers.py @@ -1,34 +1,33 @@ -# Copyright (c) 2017,Vienna University of Technology, -# Department of Geodesy and Geoinformation +# Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of the Vienna University of Technology, Department of -# Geodesy and Geoinformation nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific -# prior written permission. +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the TU Wien, Department of Geodesy and +# Geoinformation nor the names of its contributors may be used to endorse +# or promote products derived from this software without specific prior +# written permission. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, DEPARTMENT OF -# GEODESY AND GEOINFORMATION 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. - -''' +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, +# DEPARTMENT OF GEODESY AND GEOINFORMATION 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. + +""" Data scaler classes to be used together with the validation framework. -''' +""" import numpy as np import pandas as pd @@ -75,9 +74,9 @@ def scale(self, data, reference_index, gpi_info): ValueError if scaling is not successful """ - return scaling.scale(data, - method=self.method, - reference_index=reference_index) + return scaling.scale( + data, method=self.method, reference_index=reference_index + ) class CDFStoreParamsScaler(object): @@ -99,13 +98,18 @@ class CDFStoreParamsScaler(object): Percentiles to use for CDF matching """ - def __init__(self, path, grid, - percentiles=[0, 5, 10, 30, 50, 70, 90, 95, 100]): + def __init__( + self, path, grid, percentiles=[0, 5, 10, 30, 50, 70, 90, 95, 100] + ): self.path = path self.grid = grid self.percentiles = np.asanyarray(percentiles) - self.io = GriddedPointData(path, grid, mode='a', - ioclass_kws={'add_dims': {'percentiles': self.percentiles.size}}) + self.io = GriddedPointData( + path, + grid, + mode="a", + ioclass_kws={"add_dims": {"percentiles": self.percentiles.size}}, + ) def scale(self, data, reference_index, gpi_info): """ @@ -139,10 +143,11 @@ def scale(self, data, reference_index, gpi_info): src_percentiles = parameters[series] ref_percentiles = parameters[reference_name] data[series] = pd.Series( - lin_cdf_match_stored_params(data[series].values, - src_percentiles, - ref_percentiles), - index=data.index) + lin_cdf_match_stored_params( + data[series].values, src_percentiles, ref_percentiles + ), + index=data.index, + ) data.insert(reference_index, reference.name, reference) return data @@ -167,8 +172,9 @@ def calc_parameters(self, data): for column in data.columns: c_data = data[column].values perc = np.percentile(c_data, self.percentiles) - perc = unique_percentiles_interpolate(perc, - percentiles=self.percentiles) + perc = unique_percentiles_interpolate( + perc, percentiles=self.percentiles + ) parameters[column] = perc return parameters @@ -202,7 +208,7 @@ def get_parameters(self, data, gpi): def load_parameters(self, gpi): data = self.io.read(gpi) if data is not None: - unwanted_keys = ['lat', 'lon', 'alt', 'time', 'location_id'] + unwanted_keys = ["lat", "lon", "alt", "time", "location_id"] for key in unwanted_keys: del data[key] @@ -226,13 +232,15 @@ def store_parameters(self, gpi, parameters): """ data = [] dtypes = [] - dim_info = {'dims': {}} + dim_info = {"dims": {}} for key in parameters: - dim_info['dims'][key] = ('obs', 'percentiles') + dim_info["dims"][key] = ("obs", "percentiles") dtypes.append( - (key, parameters[key].dtype, (parameters[key].size, ))) + (key, parameters[key].dtype, (parameters[key].size,)) + ) data.append(parameters[key]) - data = np.core.records.fromarrays(data, dtype=np.dtype(dtypes, - metadata=dim_info)) + data = np.core.records.fromarrays( + data, dtype=np.dtype(dtypes, metadata=dim_info) + ) self.io.write(gpi, data) diff --git a/src/pytesmo/validation_framework/metric_calculators.py b/src/pytesmo/validation_framework/metric_calculators.py index 1c5923d8..1af1e989 100644 --- a/src/pytesmo/validation_framework/metric_calculators.py +++ b/src/pytesmo/validation_framework/metric_calculators.py @@ -65,19 +65,23 @@ def _get_tc_metric_template(metr, ds_names): - """ return empty dict to fill TC results into """ + """return empty dict to fill TC results into""" if isinstance(metr, str): metr = [metr] # metrics that are computed between dataset triples - met_thds_template = {'snr': np.float32([np.nan]), - 'err_std': np.float32([np.nan]), - 'beta': np.float32([np.nan])} + met_thds_template = { + "snr": np.float32([np.nan]), + "err_std": np.float32([np.nan]), + "beta": np.float32([np.nan]), + } - in_lut = np.isin(np.array(metr), np.array(list(met_thds_template.keys()))) + in_lut = np.isin( + np.array(metr), np.array(list(met_thds_template.keys())) + ) if not all(in_lut): unknown = np.take(metr, np.where(in_lut is False)[0]) - raise ValueError('Unknown metric(s): {}'.format(' '.join(unknown))) + raise ValueError("Unknown metric(s): {}".format(" ".join(unknown))) met_thds = {} for m in metr: @@ -88,51 +92,51 @@ def _get_tc_metric_template(metr, ds_names): def _get_metric_template(metr): - """ return empty dict to fill results into """ + """return empty dict to fill results into""" if isinstance(metr, str): metr = [metr] lut = dict() # metrics that are equal for all data sets - met_comm = {'n_obs': np.int32([0])} + met_comm = {"n_obs": np.int32([0])} # metrics that are computed between dataset pairs met_tds = { - 'R': np.float32([np.nan]), - 'p_R': np.float32([np.nan]), - 'rho': np.float32([np.nan]), - 'p_rho': np.float32([np.nan]), - 'BIAS': np.float32([np.nan]), - 'tau': np.float32([np.nan]), - 'p_tau': np.float32([np.nan]), - 'RMSD': np.float32([np.nan]), - 'mse': np.float32([np.nan]), - 'RSS': np.float32([np.nan]), - 'mse_corr': np.float32([np.nan]), - 'mse_bias': np.float32([np.nan]), - 'mse_var': np.float32([np.nan]), - 'urmsd': np.float32([np.nan]), - 'BIAS_ci_lower': np.float32([np.nan]), - 'BIAS_ci_upper': np.float32([np.nan]), - 'RMSD_ci_lower': np.float32([np.nan]), - 'RMSD_ci_upper': np.float32([np.nan]), - 'RSS_ci_lower': np.float32([np.nan]), - 'RSS_ci_upper': np.float32([np.nan]), - 'mse_ci_lower': np.float32([np.nan]), - 'mse_ci_upper': np.float32([np.nan]), - 'mse_corr_ci_lower': np.float32([np.nan]), - 'mse_corr_ci_upper': np.float32([np.nan]), - 'mse_bias_ci_lower': np.float32([np.nan]), - 'mse_bias_ci_upper': np.float32([np.nan]), - 'mse_var_ci_lower': np.float32([np.nan]), - 'mse_var_ci_upper': np.float32([np.nan]), - 'urmsd_ci_lower': np.float32([np.nan]), - 'urmsd_ci_upper': np.float32([np.nan]), - 'R_ci_lower': np.float32([np.nan]), - 'R_ci_upper': np.float32([np.nan]), - 'rho_ci_lower': np.float32([np.nan]), - 'rho_ci_upper': np.float32([np.nan]), - 'tau_ci_lower': np.float32([np.nan]), - 'tau_ci_upper': np.float32([np.nan]), + "R": np.float32([np.nan]), + "p_R": np.float32([np.nan]), + "rho": np.float32([np.nan]), + "p_rho": np.float32([np.nan]), + "BIAS": np.float32([np.nan]), + "tau": np.float32([np.nan]), + "p_tau": np.float32([np.nan]), + "RMSD": np.float32([np.nan]), + "mse": np.float32([np.nan]), + "RSS": np.float32([np.nan]), + "mse_corr": np.float32([np.nan]), + "mse_bias": np.float32([np.nan]), + "mse_var": np.float32([np.nan]), + "urmsd": np.float32([np.nan]), + "BIAS_ci_lower": np.float32([np.nan]), + "BIAS_ci_upper": np.float32([np.nan]), + "RMSD_ci_lower": np.float32([np.nan]), + "RMSD_ci_upper": np.float32([np.nan]), + "RSS_ci_lower": np.float32([np.nan]), + "RSS_ci_upper": np.float32([np.nan]), + "mse_ci_lower": np.float32([np.nan]), + "mse_ci_upper": np.float32([np.nan]), + "mse_corr_ci_lower": np.float32([np.nan]), + "mse_corr_ci_upper": np.float32([np.nan]), + "mse_bias_ci_lower": np.float32([np.nan]), + "mse_bias_ci_upper": np.float32([np.nan]), + "mse_var_ci_lower": np.float32([np.nan]), + "mse_var_ci_upper": np.float32([np.nan]), + "urmsd_ci_lower": np.float32([np.nan]), + "urmsd_ci_upper": np.float32([np.nan]), + "R_ci_lower": np.float32([np.nan]), + "R_ci_upper": np.float32([np.nan]), + "rho_ci_lower": np.float32([np.nan]), + "rho_ci_upper": np.float32([np.nan]), + "tau_ci_lower": np.float32([np.nan]), + "tau_ci_upper": np.float32([np.nan]), } lut.update(met_comm) @@ -141,7 +145,7 @@ def _get_metric_template(metr): in_lut = np.isin(np.array(metr), np.array(list(lut.keys()))) if not all(in_lut): unknown = np.take(metr, np.where(in_lut is False)[0]) - raise ValueError('Unknown metric(s): {}'.format(' '.join(unknown))) + raise ValueError("Unknown metric(s): {}".format(" ".join(unknown))) return {m: lut[m] for m in metr} @@ -167,15 +171,19 @@ def __init__(self, calculator, sets=None): """ self.cls = calculator if sets is None: - sets = {'DJF': [12, 1, 2], 'MAM': [3, 4, 5], - 'JJA': [6, 7, 8], 'SON': [9, 10, 11], - 'ALL': list(range(1, 13))} + sets = { + "DJF": [12, 1, 2], + "MAM": [3, 4, 5], + "JJA": [6, 7, 8], + "SON": [9, 10, 11], + "ALL": list(range(1, 13)), + } self.sets = sets # metadata metrics and lon, lat, gpi are excluded from applying # seasonally - self.non_seas_metrics = ['gpi', 'lon', 'lat'] + self.non_seas_metrics = ["gpi", "lon", "lat"] if self.cls.metadata_template is not None: self.non_seas_metrics += list(self.cls.metadata_template.keys()) @@ -215,10 +223,10 @@ def filter_months(df, months, dropna=False): The filtered series """ dat = df.copy(True) - dat['__index_month'] = dat.index.month - cond = ['__index_month == {}'.format(m) for m in months] - selection = dat.query(' | '.join(cond)).index - dat.drop('__index_month', axis=1, inplace=True) + dat["__index_month"] = dat.index.month + cond = ["__index_month == {}".format(m) for m in months] + selection = dat.query(" | ".join(cond)).index + dat.drop("__index_month", axis=1, inplace=True) if dropna: return dat.loc[selection] @@ -276,11 +284,13 @@ class MetadataMetrics(object): 10. """ - def __init__(self, other_name='k1', metadata_template=None, min_obs=10): + def __init__(self, other_name="k1", metadata_template=None, min_obs=10): - self.result_template = {'gpi': np.int32([-1]), - 'lon': np.float64([np.nan]), - 'lat': np.float64([np.nan])} + self.result_template = { + "gpi": np.int32([-1]), + "lon": np.float64([np.nan]), + "lat": np.float64([np.nan]), + } self.metadata_template = metadata_template if self.metadata_template is not None: @@ -305,18 +315,20 @@ def calc_metrics(self, data, gpi_info): dataset = copy.deepcopy(self.result_template) - dataset['gpi'][0] = gpi_info[0] - dataset['lon'][0] = gpi_info[1] - dataset['lat'][0] = gpi_info[2] + dataset["gpi"][0] = gpi_info[0] + dataset["lon"][0] = gpi_info[1] + dataset["lat"][0] = gpi_info[2] if self.metadata_template is not None: for key, value in self.metadata_template.items(): try: dataset[key][0] = gpi_info[3][key] - except(IndexError): - raise Exception('No metadata has been provided to the job. ' - 'Should be of form {field: metadata_value} using the metadata_template ' - 'supplied to init function.') + except (IndexError): + raise Exception( + "No metadata has been provided to the job. " + "Should be of form {field: metadata_value} using " + "the metadata_template supplied to init function." + ) return dataset @@ -353,12 +365,24 @@ class BasicMetrics(MetadataMetrics): which is then propagated to the end netCDF results file. """ - def __init__(self, other_name='k1', calc_tau=False, metadata_template=None): - super(BasicMetrics, self).__init__(other_name=other_name, - metadata_template=metadata_template) + def __init__( + self, other_name="k1", calc_tau=False, metadata_template=None + ): + super(BasicMetrics, self).__init__( + other_name=other_name, metadata_template=metadata_template + ) - self.basic_metrics = ['n_obs', 'R', 'p_R', 'rho', 'p_rho', 'RMSD', - 'BIAS', 'tau', 'p_tau'] + self.basic_metrics = [ + "n_obs", + "R", + "p_R", + "rho", + "p_rho", + "RMSD", + "BIAS", + "tau", + "p_tau", + ] self.result_template.update(_get_metric_template(self.basic_metrics)) @@ -389,21 +413,21 @@ def calc_metrics(self, data, gpi_info): if len(data) < self.min_obs: return dataset - x, y = data['ref'].values, data[self.other_name].values + x, y = data["ref"].values, data[self.other_name].values R, p_R = stats.pearsonr(x, y) rho, p_rho = stats.spearmanr(x, y) RMSD = metrics.rmsd(x, y) BIAS = metrics.bias(x, y) - dataset['R'][0], dataset['p_R'][0] = R, p_R - dataset['rho'][0], dataset['p_rho'][0] = rho, p_rho - dataset['RMSD'][0] = RMSD - dataset['BIAS'][0] = BIAS - dataset['n_obs'][0] = len(data) + dataset["R"][0], dataset["p_R"][0] = R, p_R + dataset["rho"][0], dataset["p_rho"][0] = rho, p_rho + dataset["RMSD"][0] = RMSD + dataset["BIAS"][0] = BIAS + dataset["n_obs"][0] = len(data) if self.calc_tau: tau, p_tau = metrics.kendalltau(x, y) - dataset['tau'][0], dataset['p_tau'][0] = tau, p_tau + dataset["tau"][0], dataset["p_tau"][0] = tau, p_tau return dataset @@ -414,24 +438,26 @@ class BasicMetricsPlusMSE(BasicMetrics): into correlation, bias and variance parts. """ - def __init__(self, other_name='k1', - metadata_template=None): - super(BasicMetricsPlusMSE, self).__init__(other_name=other_name, - metadata_template=metadata_template) + def __init__(self, other_name="k1", metadata_template=None): + super(BasicMetricsPlusMSE, self).__init__( + other_name=other_name, metadata_template=metadata_template + ) - self.mse_metrics = ['mse', 'mse_corr', 'mse_bias', 'mse_var'] + self.mse_metrics = ["mse", "mse_corr", "mse_bias", "mse_var"] self.result_template.update(_get_metric_template(self.mse_metrics)) def calc_metrics(self, data, gpi_info): - dataset = super(BasicMetricsPlusMSE, self).calc_metrics(data, gpi_info) + dataset = super(BasicMetricsPlusMSE, self).calc_metrics( + data, gpi_info + ) if len(data) < self.min_obs: return dataset - x, y = data['ref'].values, data[self.other_name].values + x, y = data["ref"].values, data[self.other_name].values mse, mse_corr, mse_bias, mse_var = metrics.mse_decomposition(x, y) - dataset['mse'][0] = mse - dataset['mse_corr'][0] = mse_corr - dataset['mse_bias'][0] = mse_bias - dataset['mse_var'][0] = mse_var + dataset["mse"][0] = mse + dataset["mse_corr"][0] = mse_corr + dataset["mse_bias"][0] = mse_bias + dataset["mse_var"][0] = mse_var return dataset @@ -451,18 +477,23 @@ class FTMetrics(MetadataMetrics): """ - def __init__(self, frozen_flag=2, - other_name='k1', - metadata_template=None): - super(FTMetrics, self).__init__(other_name=other_name, - metadata_template=metadata_template) + def __init__( + self, frozen_flag=2, other_name="k1", metadata_template=None + ): + super(FTMetrics, self).__init__( + other_name=other_name, metadata_template=metadata_template + ) self.frozen_flag_value = frozen_flag - self.result_template.update({'ssf_fr_temp_un': np.float32([np.nan]), - 'ssf_fr_temp_fr': np.float32([np.nan]), - 'ssf_un_temp_fr': np.float32([np.nan]), - 'ssf_un_temp_un': np.float32([np.nan]), - 'n_obs': np.int32([0])}) + self.result_template.update( + { + "ssf_fr_temp_un": np.float32([np.nan]), + "ssf_fr_temp_fr": np.float32([np.nan]), + "ssf_un_temp_fr": np.float32([np.nan]), + "ssf_un_temp_un": np.float32([np.nan]), + "n_obs": np.int32([0]), + } + ) def calc_metrics(self, data, gpi_info): """ @@ -489,7 +520,7 @@ def calc_metrics(self, data, gpi_info): if len(data) < self.min_obs: return dataset - ssf, temp = data['ref'].values, data[self.other_name].values + ssf, temp = data["ref"].values, data[self.other_name].values # SSF <= 1 unfrozen # SSF >= 2 frozen @@ -507,16 +538,17 @@ def calc_metrics(self, data, gpi_info): ssf_fr_temp_unfrozen = np.where(temp_ssf_frozen >= 0)[0] ssf_un_temp_frozen = np.where(temp_ssf_unfrozen < 0)[0] - dataset['ssf_fr_temp_un'][0] = len(ssf_fr_temp_unfrozen) - dataset['ssf_fr_temp_fr'][0] = len(ssf_temp_frozen) + dataset["ssf_fr_temp_un"][0] = len(ssf_fr_temp_unfrozen) + dataset["ssf_fr_temp_fr"][0] = len(ssf_temp_frozen) - dataset['ssf_un_temp_fr'][0] = len(ssf_un_temp_frozen) - dataset['ssf_un_temp_un'][0] = len(ssf_temp_unfrozen) + dataset["ssf_un_temp_fr"][0] = len(ssf_un_temp_frozen) + dataset["ssf_un_temp_un"][0] = len(ssf_temp_unfrozen) - dataset['n_obs'][0] = len(data) + dataset["n_obs"][0] = len(data) return dataset + class HSAF_Metrics(MetadataMetrics): """ This class computes metrics as defined by the H-SAF consortium in @@ -524,19 +556,22 @@ class HSAF_Metrics(MetadataMetrics): information about gpi, lat, lon and number of observations. """ - def __init__(self, - other_name1='k1', - other_name2='k2', - dataset_names=None, - metadata_template=None): + def __init__( + self, + other_name1="k1", + other_name2="k2", + dataset_names=None, + metadata_template=None, + ): - super(HSAF_Metrics, self).__init__(other_name=other_name1, - metadata_template=metadata_template) + super(HSAF_Metrics, self).__init__( + other_name=other_name1, metadata_template=metadata_template + ) # prepare validation dataset names as provided self.other_name1 = other_name1 self.other_name2 = other_name2 - self.df_columns = ['ref', self.other_name1, self.other_name2] + self.df_columns = ["ref", self.other_name1, self.other_name2] if dataset_names is None: self.ds_names = self.df_columns else: @@ -551,20 +586,24 @@ def __init__(self, for combi in itertools.combinations(self.df_columns, 2): self.tds_names.append("{:}_and_{:}".format(*combi)) - metrics_common = {'n_obs': np.int32([0])} + metrics_common = {"n_obs": np.int32([0])} - metrics_sds = {'snr': np.float32([np.nan]), - 'err_var': np.float32([np.nan]), - 'beta': np.float32([np.nan])} + metrics_sds = { + "snr": np.float32([np.nan]), + "err_var": np.float32([np.nan]), + "beta": np.float32([np.nan]), + } - metrics_tds = {'R': np.float32([np.nan]), - 'p_R': np.float32([np.nan]), - 'rho': np.float32([np.nan]), - 'p_rho': np.float32([np.nan]), - 'bias': np.float32([np.nan]), - 'ubrmsd': np.float32([np.nan])} + metrics_tds = { + "R": np.float32([np.nan]), + "p_R": np.float32([np.nan]), + "rho": np.float32([np.nan]), + "p_rho": np.float32([np.nan]), + "bias": np.float32([np.nan]), + "ubrmsd": np.float32([np.nan]), + } - self.seasons = ['ALL', 'DJF', 'MAM', 'JJA', 'SON'] + self.seasons = ["ALL", "DJF", "MAM", "JJA", "SON"] for season in self.seasons: # get template for common metric @@ -580,18 +619,32 @@ def __init__(self, # get template for two-dataset metric for tds_name in self.tds_names: - split_tds_name = tds_name.split('_and_') - tds_name_key = "{:}_{:}".format(self.ds_names_lut[ - split_tds_name[0]], - self.ds_names_lut[ - split_tds_name[1]]) + split_tds_name = tds_name.split("_and_") + tds_name_key = "{:}_{:}".format( + self.ds_names_lut[split_tds_name[0]], + self.ds_names_lut[split_tds_name[1]], + ) for metric in metrics_tds.keys(): key = "{:}_{:}_{:}".format(tds_name_key, season, metric) self.result_template[key] = metrics_tds[metric].copy() - self.month_to_season = np.array(['', 'DJF', 'DJF', 'MAM', 'MAM', - 'MAM', 'JJA', 'JJA', 'JJA', 'SON', - 'SON', 'SON', 'DJF']) + self.month_to_season = np.array( + [ + "", + "DJF", + "DJF", + "MAM", + "MAM", + "MAM", + "JJA", + "JJA", + "JJA", + "SON", + "SON", + "SON", + "DJF", + ] + ) def calc_metrics(self, data, gpi_info): """ @@ -611,7 +664,7 @@ def calc_metrics(self, data, gpi_info): for season in self.seasons: - if season != 'ALL': + if season != "ALL": subset = self.month_to_season[data.index.month] == season else: subset = np.ones(len(data), dtype=bool) @@ -620,7 +673,7 @@ def calc_metrics(self, data, gpi_info): n_obs = subset.sum() if n_obs < self.min_obs: continue - dataset['{:}_n_obs'.format(season)][0] = n_obs + dataset["{:}_n_obs".format(season)][0] = n_obs # get single dataset metrics # calculate SNR @@ -631,9 +684,9 @@ def calc_metrics(self, data, gpi_info): snr, err, beta = metrics.tcol_metrics(x, y, z) for i, name in enumerate(self.ds_names): - dataset['{:}_{:}_snr'.format(name, season)][0] = snr[i] - dataset['{:}_{:}_err_var'.format(name, season)][0] = err[i] - dataset['{:}_{:}_beta'.format(name, season)][0] = beta[i] + dataset["{:}_{:}_snr".format(name, season)][0] = snr[i] + dataset["{:}_{:}_err_var".format(name, season)][0] = err[i] + dataset["{:}_{:}_beta".format(name, season)][0] = beta[i] # calculate Pearson correlation pearson_R, pearson_p = df_metrics.pearsonr(data) @@ -646,7 +699,7 @@ def calc_metrics(self, data, gpi_info): spea_p = spea_p._asdict() # scale data to reference in order to calculate absolute metrics - data_scaled = scale(data, method='min_max') + data_scaled = scale(data, method="min_max") # calculate bias bias_nT = df_metrics.bias(data_scaled) @@ -664,20 +717,24 @@ def calc_metrics(self, data, gpi_info): bias = bias_dict[tds_name] ubRMSD = ubRMSD_dict[tds_name] - split_tds_name = tds_name.split('_and_') - tds_name_key = "{:}_{:}".format(self.ds_names_lut[ - split_tds_name[0]], - self.ds_names_lut[ - split_tds_name[1]]) - - dataset['{:}_{:}_R'.format(tds_name_key, season)][0] = R - dataset['{:}_{:}_p_R'.format(tds_name_key, season)][0] = p_R - dataset['{:}_{:}_rho'.format(tds_name_key, season)][0] = rho - dataset['{:}_{:}_p_rho'.format(tds_name_key, season)][0] = \ - p_rho - dataset['{:}_{:}_bias'.format(tds_name_key, season)][0] = bias - dataset['{:}_{:}_ubrmsd'.format(tds_name_key, season)][0] = \ - ubRMSD + split_tds_name = tds_name.split("_and_") + tds_name_key = "{:}_{:}".format( + self.ds_names_lut[split_tds_name[0]], + self.ds_names_lut[split_tds_name[1]], + ) + + dataset["{:}_{:}_R".format(tds_name_key, season)][0] = R + dataset["{:}_{:}_p_R".format(tds_name_key, season)][0] = p_R + dataset["{:}_{:}_rho".format(tds_name_key, season)][0] = rho + dataset["{:}_{:}_p_rho".format(tds_name_key, season)][ + 0 + ] = p_rho + dataset["{:}_{:}_bias".format(tds_name_key, season)][ + 0 + ] = bias + dataset["{:}_{:}_ubrmsd".format(tds_name_key, season)][ + 0 + ] = ubRMSD return dataset @@ -721,17 +778,25 @@ class IntercomparisonMetrics(MetadataMetrics): """ - def __init__(self, refname="ref", other_names=('k1', 'k2', 'k3'), - calc_tau=False, metrics_between_nonref=False, - calc_rho=True, dataset_names=None, metadata_template=None): + def __init__( + self, + refname="ref", + other_names=("k1", "k2", "k3"), + calc_tau=False, + metrics_between_nonref=False, + calc_rho=True, + dataset_names=None, + metadata_template=None, + ): other_names = list(other_names) super(IntercomparisonMetrics, self).__init__( - other_name=other_names, metadata_template=metadata_template) + other_name=other_names, metadata_template=metadata_template + ) # string that splits the dataset names and metric names in the output # e.g. 'metric_between_dataset1_and_dataset2' - self.ds_names_split, self.metric_ds_split = '_and_', '_between_' + self.ds_names_split, self.metric_ds_split = "_and_", "_between_" self.df_columns = [refname] + self.other_name @@ -748,20 +813,36 @@ def __init__(self, refname="ref", other_names=('k1', 'k2', 'k3'), self.ds_names_lut[col] = name combis = n_combinations( - self.df_columns, 2, - must_include=refname if not metrics_between_nonref else None + self.df_columns, + 2, + must_include=refname if not metrics_between_nonref else None, ) self.tds_names = [] for combi in combis: - self.tds_names.append("{1}{0}{2}".format( - self.ds_names_split, *combi)) + self.tds_names.append( + "{1}{0}{2}".format(self.ds_names_split, *combi) + ) # metrics that are equal for all datasets - metrics_common = ['n_obs'] + metrics_common = ["n_obs"] # metrics that are calculated between dataset pairs - metrics_tds = ['R', 'p_R', 'rho', 'p_rho', 'BIAS', 'RMSD', 'mse', 'RSS', - 'mse_corr', 'mse_bias', 'urmsd', 'mse_var', 'tau', 'p_tau'] + metrics_tds = [ + "R", + "p_R", + "rho", + "p_rho", + "BIAS", + "RMSD", + "mse", + "RSS", + "mse_corr", + "mse_bias", + "urmsd", + "mse_var", + "tau", + "p_tau", + ] metrics_common = _get_metric_template(metrics_common) metrics_tds = _get_metric_template(metrics_tds) @@ -771,19 +852,22 @@ def __init__(self, refname="ref", other_names=('k1', 'k2', 'k3'), for tds_name in self.tds_names: split_tds_name = tds_name.split(self.ds_names_split) - tds_name_key = \ - self.ds_names_split.join([self.ds_names_lut[split_tds_name[0]], - self.ds_names_lut[split_tds_name[1]]]) + tds_name_key = self.ds_names_split.join( + [ + self.ds_names_lut[split_tds_name[0]], + self.ds_names_lut[split_tds_name[1]], + ] + ) for metric in metrics_tds.keys(): key = self.metric_ds_split.join([metric, tds_name_key]) self.result_template[key] = metrics_tds[metric].copy() if not calc_rho: - self.result_template.pop('rho', None) - self.result_template.pop('p_rho', None) + self.result_template.pop("rho", None) + self.result_template.pop("p_rho", None) if not calc_tau: - self.result_template.pop('tau', None) - self.result_template.pop('p_tau', None) + self.result_template.pop("tau", None) + self.result_template.pop("p_tau", None) def calc_metrics(self, data, gpi_info): """ @@ -805,8 +889,9 @@ def calc_metrics(self, data, gpi_info): global comparisons """ - dataset = super(IntercomparisonMetrics, - self).calc_metrics(data, gpi_info) + dataset = super(IntercomparisonMetrics, self).calc_metrics( + data, gpi_info + ) subset = np.ones(len(data), dtype=bool) @@ -814,7 +899,7 @@ def calc_metrics(self, data, gpi_info): if n_obs < self.min_obs: return dataset - dataset['n_obs'][0] = n_obs + dataset["n_obs"][0] = n_obs # make sure we have the correct order data = data[self.df_columns] @@ -833,8 +918,12 @@ def calc_metrics(self, data, gpi_info): # calculate MSE mse, mse_corr, mse_bias, mse_var = df_metrics.mse_decomposition(data) - mse_dict, mse_corr_dict, mse_bias_dict, mse_var_dict = \ - mse._asdict(), mse_corr._asdict(), mse_bias._asdict(), mse_var._asdict() + mse_dict, mse_corr_dict, mse_bias_dict, mse_var_dict = ( + mse._asdict(), + mse_corr._asdict(), + mse_bias._asdict(), + mse_var._asdict(), + ) # calculate RSS rss = df_metrics.RSS(data) @@ -857,7 +946,7 @@ def calc_metrics(self, data, gpi_info): # No extra scaling is performed here. # always scale for ubRMSD with mean std # calculate ubRMSD - data_scaled = scale(data, method='mean_std') + data_scaled = scale(data, method="mean_std") ubRMSD_nT = df_metrics.ubrmsd(data_scaled) ubRMSD_dict = ubRMSD_nT._asdict() @@ -881,35 +970,55 @@ def calc_metrics(self, data, gpi_info): split_tds_name = tds_name.split(self.ds_names_split) tds_name_key = self.ds_names_split.join( - [self.ds_names_lut[split_tds_name[0]], self.ds_names_lut[split_tds_name[1]]]) - - dataset[self.metric_ds_split.join(['R', tds_name_key])][0] = R - dataset[self.metric_ds_split.join(['p_R', tds_name_key])][0] = p_R - dataset[self.metric_ds_split.join( - ['BIAS', tds_name_key])][0] = bias - dataset[self.metric_ds_split.join(['mse', tds_name_key])][0] = mse - dataset[self.metric_ds_split.join( - ['mse_corr', tds_name_key])][0] = mse_corr - dataset[self.metric_ds_split.join( - ['mse_bias', tds_name_key])][0] = mse_bias - dataset[self.metric_ds_split.join( - ['mse_var', tds_name_key])][0] = mse_var - dataset[self.metric_ds_split.join( - ['RMSD', tds_name_key])][0] = rmsd - dataset[self.metric_ds_split.join( - ['urmsd', tds_name_key])][0] = ubRMSD - dataset[self.metric_ds_split.join(['RSS', tds_name_key])][0] = rss + [ + self.ds_names_lut[split_tds_name[0]], + self.ds_names_lut[split_tds_name[1]], + ] + ) + + dataset[self.metric_ds_split.join(["R", tds_name_key])][0] = R + dataset[self.metric_ds_split.join(["p_R", tds_name_key])][ + 0 + ] = p_R + dataset[self.metric_ds_split.join(["BIAS", tds_name_key])][ + 0 + ] = bias + dataset[self.metric_ds_split.join(["mse", tds_name_key])][ + 0 + ] = mse + dataset[self.metric_ds_split.join(["mse_corr", tds_name_key])][ + 0 + ] = mse_corr + dataset[self.metric_ds_split.join(["mse_bias", tds_name_key])][ + 0 + ] = mse_bias + dataset[self.metric_ds_split.join(["mse_var", tds_name_key])][ + 0 + ] = mse_var + dataset[self.metric_ds_split.join(["RMSD", tds_name_key])][ + 0 + ] = rmsd + dataset[self.metric_ds_split.join(["urmsd", tds_name_key])][ + 0 + ] = ubRMSD + dataset[self.metric_ds_split.join(["RSS", tds_name_key])][ + 0 + ] = rss if self.calc_rho: - dataset[self.metric_ds_split.join( - ['rho', tds_name_key])][0] = rho - dataset[self.metric_ds_split.join( - ['p_rho', tds_name_key])][0] = p_rho + dataset[self.metric_ds_split.join(["rho", tds_name_key])][ + 0 + ] = rho + dataset[self.metric_ds_split.join(["p_rho", tds_name_key])][ + 0 + ] = p_rho if self.calc_tau: - dataset[self.metric_ds_split.join( - ['tau', tds_name_key])][0] = tau - dataset[self.metric_ds_split.join( - ['p_tau', tds_name_key])][0] = p_tau + dataset[self.metric_ds_split.join(["tau", tds_name_key])][ + 0 + ] = tau + dataset[self.metric_ds_split.join(["p_tau", tds_name_key])][ + 0 + ] = p_tau return dataset @@ -922,16 +1031,23 @@ class TCMetrics(MetadataMetrics): of more than 3 datasets. """ - def __init__(self, other_names=('k1', 'k2'), calc_tau=False, dataset_names=None, - tc_metrics_for_ref=True, metrics_between_nonref=False, - metadata_template=None): + def __init__( + self, + other_names=("k1", "k2"), + calc_tau=False, + dataset_names=None, + tc_metrics_for_ref=True, + metrics_between_nonref=False, + metadata_template=None, + ): """ Triple Collocation metrics as implemented in the QA4SM project. Parameters ---------- other_names : tuple, optional (default: ('k1', 'k2')) - Names of the data sets that are not the reference in the data frame. + Names of the data sets that are not the reference in the + data frame. calc_tau : bool, optional (default: False) Calculate Kendall's Tau (slow) dataset_names : tuple, optional (default: None) @@ -947,18 +1063,22 @@ def __init__(self, other_names=('k1', 'k2'), calc_tau=False, dataset_names=None, dict = {'field': np.float32([np.nan]}. Allows users to specify information in the job tuple, i.e. jobs.append( - (idx, metadata['longitude'], metadata['latitude'], metadata_dict)) + (idx, + metadata['longitude'], + metadata['latitude'], + metadata_dict)) which is then propagated to the end netCDF results file. """ - self.ref_name = 'ref' + self.ref_name = "ref" other_names = list(other_names) super(TCMetrics, self).__init__( - other_name=other_names, metadata_template=metadata_template) + other_name=other_names, metadata_template=metadata_template + ) # string that splits the dataset names and metric names in the output # e.g. 'metric_between_dataset1_and_dataset2' - self.ds_names_split, self.metric_ds_split = '_and_', '_between_' + self.ds_names_split, self.metric_ds_split = "_and_", "_between_" self.calc_tau = calc_tau self.df_columns = [self.ref_name] + self.other_name @@ -976,68 +1096,105 @@ def __init__(self, other_names=('k1', 'k2'), calc_tau=False, dataset_names=None, self.tds_names, self.thds_names = self._make_names() # metrics that are equal for all datasets - metrics_common = ['n_obs'] + metrics_common = ["n_obs"] # metrics that are calculated between dataset pairs - metrics_tds = ['R', 'p_R', 'rho', 'p_rho', 'BIAS', 'RMSD', 'mse', 'RSS', - 'mse_corr', 'mse_bias', 'urmsd', 'mse_var', 'tau', 'p_tau'] + metrics_tds = [ + "R", + "p_R", + "rho", + "p_rho", + "BIAS", + "RMSD", + "mse", + "RSS", + "mse_corr", + "mse_bias", + "urmsd", + "mse_var", + "tau", + "p_tau", + ] # metrics that are calculated between dataset triples - metrics_thds = ['snr', 'err_std', 'beta'] + metrics_thds = ["snr", "err_std", "beta"] metrics_common = _get_metric_template(metrics_common) metrics_tds = _get_metric_template(metrics_tds) ignore_ds = [self.ref_name] if not tc_metrics_for_ref else () - metrics_thds = _get_tc_metric_template(metrics_thds, - [self.ds_names_lut[n] for n in self.df_columns if n not in ignore_ds]) + metrics_thds = _get_tc_metric_template( + metrics_thds, + [ + self.ds_names_lut[n] + for n in self.df_columns + if n not in ignore_ds + ], + ) for metric in metrics_common.keys(): self.result_template[metric] = metrics_common[metric].copy() for tds_name in self.tds_names: split_tds_name = tds_name.split(self.ds_names_split) - tds_name_key = \ - self.ds_names_split.join([self.ds_names_lut[split_tds_name[0]], - self.ds_names_lut[split_tds_name[1]]]) + tds_name_key = self.ds_names_split.join( + [ + self.ds_names_lut[split_tds_name[0]], + self.ds_names_lut[split_tds_name[1]], + ] + ) for metric in metrics_tds.keys(): key = self.metric_ds_split.join([metric, tds_name_key]) self.result_template[key] = metrics_tds[metric].copy() for thds_name in self.thds_names: split_tds_name = thds_name.split(self.ds_names_split) - thds_name_key = \ - self.ds_names_split.join([self.ds_names_lut[split_tds_name[0]], - self.ds_names_lut[split_tds_name[1]], - self.ds_names_lut[split_tds_name[2]]]) + thds_name_key = self.ds_names_split.join( + [ + self.ds_names_lut[split_tds_name[0]], + self.ds_names_lut[split_tds_name[1]], + self.ds_names_lut[split_tds_name[2]], + ] + ) for metric, ds in metrics_thds.keys(): - if not any([self.ds_names_lut[other_ds] == ds - for other_ds in thds_name.split(self.ds_names_split)]): + if not any( + [ + self.ds_names_lut[other_ds] == ds + for other_ds in thds_name.split(self.ds_names_split) + ] + ): continue - full_name = '_'.join([metric, ds]) + full_name = "_".join([metric, ds]) key = self.metric_ds_split.join([full_name, thds_name_key]) self.result_template[key] = metrics_thds[(metric, ds)].copy() if not calc_tau: - self.result_template.pop('tau', None) - self.result_template.pop('p_tau', None) + self.result_template.pop("tau", None) + self.result_template.pop("p_tau", None) def _make_names(self): tds_names, thds_names = [], [] - combis_2 = n_combinations(self.df_columns, 2, - must_include=[self.ref_name] if not self.metrics_between_nonref else None) + combis_2 = n_combinations( + self.df_columns, + 2, + must_include=[self.ref_name] + if not self.metrics_between_nonref + else None, + ) combis_3 = n_combinations( - self.df_columns, 3, must_include=[self.ref_name]) + self.df_columns, 3, must_include=[self.ref_name] + ) for combi in combis_2: tds_names.append(self.ds_names_split.join(combi)) for combi in combis_3: - thds_names.append("{1}{0}{2}{0}{3}".format( - self.ds_names_split, *combi)) + thds_names.append( + "{1}{0}{2}{0}{3}".format(self.ds_names_split, *combi) + ) return tds_names, thds_names def _tc_res_dict(self, res): - """name is the TC metric name and res the according named tuple """ + """name is the TC metric name and res the according named tuple""" res_dict = {} metric = np.array([type(r).__name__ for r in res]) @@ -1057,8 +1214,9 @@ def calc_metrics(self, data, gpi_info): Parameters ---------- data : pd.DataFrame - with >2 columns, the first column is the reference dataset named 'ref' - other columns are the data sets to compare against named 'other_i' + with >2 columns, the first column is the reference dataset + named 'ref' other columns are the data sets to compare against + named 'other_i' gpi_info : tuple of (gpi, lon, lat) @@ -1071,11 +1229,11 @@ def calc_metrics(self, data, gpi_info): dataset = copy.deepcopy(self.result_template) - dataset['gpi'][0] = gpi_info[0] - dataset['lon'][0] = gpi_info[1] - dataset['lat'][0] = gpi_info[2] + dataset["gpi"][0] = gpi_info[0] + dataset["lon"][0] = gpi_info[1] + dataset["lat"][0] = gpi_info[2] - if self.metadata_template != None: + if self.metadata_template is not None: for key, value in self.metadata_template.items(): dataset[key][0] = gpi_info[3][key] @@ -1086,7 +1244,7 @@ def calc_metrics(self, data, gpi_info): if n_obs < self.min_obs: return dataset - dataset['n_obs'][0] = n_obs + dataset["n_obs"][0] = n_obs # calculate Pearson correlation pearson_R, pearson_p = df_metrics.pearsonr(data) @@ -1111,7 +1269,7 @@ def calc_metrics(self, data, gpi_info): rss_dict = rss._asdict() # calculate ubRMSD # todo: we could use the TC derived scaling parameters here? - data_scaled = scale(data, method='mean_std') + data_scaled = scale(data, method="mean_std") ubRMSD_nT = df_metrics.ubrmsd(data_scaled) ubRMSD_dict = ubRMSD_nT._asdict() # calulcate tau @@ -1122,7 +1280,9 @@ def calc_metrics(self, data, gpi_info): tau = p_tau = p_tau_dict = tau_dict = None # calculate TC metrics ref_ind = np.where(np.array(data.columns) == self.ref_name)[0][0] - snrs, err_stds, betas = df_metrics.tcol_metrics(data, ref_ind=ref_ind) + snrs, err_stds, betas = df_metrics.tcol_metrics( + data, ref_ind=ref_ind + ) snr_dict = self._tc_res_dict(snrs) err_std_dict = self._tc_res_dict(err_stds) beta_dict = self._tc_res_dict(betas) @@ -1135,15 +1295,21 @@ def calc_metrics(self, data, gpi_info): split_thds_name = thds_name.split(self.ds_names_split) thds_name_key = self.ds_names_split.join( - [self.ds_names_lut[split_thds_name[0]], - self.ds_names_lut[split_thds_name[1]], - self.ds_names_lut[split_thds_name[2]]]) + [ + self.ds_names_lut[split_thds_name[0]], + self.ds_names_lut[split_thds_name[1]], + self.ds_names_lut[split_thds_name[2]], + ] + ) - for metr, res in dict(snr=snr, err_std=err_std, beta=beta).items(): + for metr, res in dict( + snr=snr, err_std=err_std, beta=beta + ).items(): for ds, ds_res in res.items(): m_ds = "{}_{}".format(metr, self.ds_names_lut[ds]) - n = '{}{}{}'.format( - m_ds, self.metric_ds_split, thds_name_key) + n = "{}{}{}".format( + m_ds, self.metric_ds_split, thds_name_key + ) if n in dataset.keys(): dataset[n][0] = ds_res @@ -1166,33 +1332,54 @@ def calc_metrics(self, data, gpi_info): split_tds_name = tds_name.split(self.ds_names_split) tds_name_key = self.ds_names_split.join( - [self.ds_names_lut[split_tds_name[0]], self.ds_names_lut[split_tds_name[1]]]) - - dataset[self.metric_ds_split.join(['R', tds_name_key])][0] = R - dataset[self.metric_ds_split.join(['p_R', tds_name_key])][0] = p_R - dataset[self.metric_ds_split.join(['rho', tds_name_key])][0] = rho - dataset[self.metric_ds_split.join( - ['p_rho', tds_name_key])][0] = p_rho - dataset[self.metric_ds_split.join( - ['BIAS', tds_name_key])][0] = bias - dataset[self.metric_ds_split.join(['mse', tds_name_key])][0] = mse - dataset[self.metric_ds_split.join( - ['mse_corr', tds_name_key])][0] = mse_corr - dataset[self.metric_ds_split.join( - ['mse_bias', tds_name_key])][0] = mse_bias - dataset[self.metric_ds_split.join( - ['mse_var', tds_name_key])][0] = mse_var - dataset[self.metric_ds_split.join( - ['RMSD', tds_name_key])][0] = rmsd - dataset[self.metric_ds_split.join( - ['urmsd', tds_name_key])][0] = ubRMSD - dataset[self.metric_ds_split.join(['RSS', tds_name_key])][0] = rss + [ + self.ds_names_lut[split_tds_name[0]], + self.ds_names_lut[split_tds_name[1]], + ] + ) + + dataset[self.metric_ds_split.join(["R", tds_name_key])][0] = R + dataset[self.metric_ds_split.join(["p_R", tds_name_key])][ + 0 + ] = p_R + dataset[self.metric_ds_split.join(["rho", tds_name_key])][ + 0 + ] = rho + dataset[self.metric_ds_split.join(["p_rho", tds_name_key])][ + 0 + ] = p_rho + dataset[self.metric_ds_split.join(["BIAS", tds_name_key])][ + 0 + ] = bias + dataset[self.metric_ds_split.join(["mse", tds_name_key])][ + 0 + ] = mse + dataset[self.metric_ds_split.join(["mse_corr", tds_name_key])][ + 0 + ] = mse_corr + dataset[self.metric_ds_split.join(["mse_bias", tds_name_key])][ + 0 + ] = mse_bias + dataset[self.metric_ds_split.join(["mse_var", tds_name_key])][ + 0 + ] = mse_var + dataset[self.metric_ds_split.join(["RMSD", tds_name_key])][ + 0 + ] = rmsd + dataset[self.metric_ds_split.join(["urmsd", tds_name_key])][ + 0 + ] = ubRMSD + dataset[self.metric_ds_split.join(["RSS", tds_name_key])][ + 0 + ] = rss if self.calc_tau: - dataset[self.metric_ds_split.join( - ['tau', tds_name_key])][0] = tau - dataset[self.metric_ds_split.join( - ['p_tau', tds_name_key])][0] = p_tau + dataset[self.metric_ds_split.join(["tau", tds_name_key])][ + 0 + ] = tau + dataset[self.metric_ds_split.join(["p_tau", tds_name_key])][ + 0 + ] = p_tau return dataset @@ -1218,16 +1405,18 @@ class RollingMetrics(MetadataMetrics): which is then propagated to the end netCDF results file. """ - def __init__(self, other_name='k1', metadata_template=None): + def __init__(self, other_name="k1", metadata_template=None): super(RollingMetrics, self).__init__( - other_name=other_name, metadata_template=metadata_template) + other_name=other_name, metadata_template=metadata_template + ) - self.basic_metrics = ['R', 'p_R', 'RMSD'] + self.basic_metrics = ["R", "p_R", "RMSD"] self.result_template.update(_get_metric_template(self.basic_metrics)) - def calc_metrics(self, data, gpi_info, window_size='30d', center=True, - min_periods=2): + def calc_metrics( + self, data, gpi_info, window_size="30d", center=True, min_periods=2 + ): """ Calculate the desired statistics. @@ -1254,20 +1443,21 @@ def calc_metrics(self, data, gpi_info, window_size='30d', center=True, xy = data.to_numpy() timestamps = data.index.to_julian_date().values window_size_jd = pd.Timedelta( - window_size).to_numpy()/np.timedelta64(1, 'D') + window_size + ).to_numpy() / np.timedelta64(1, "D") pr_arr, rmsd_arr = metrics.rolling_pr_rmsd( timestamps, xy[:, 0], xy[:, 1], window_size_jd, center, - min_periods + min_periods, ) - dataset['time'] = np.array([data.index]) - dataset['R'] = np.array([pr_arr[:, 0]]) - dataset['p_R'] = np.array([pr_arr[:, 1]]) - dataset['RMSD'] = np.array([rmsd_arr[:]]) + dataset["time"] = np.array([data.index]) + dataset["R"] = np.array([pr_arr[:, 0]]) + dataset["p_R"] = np.array([pr_arr[:, 1]]) + dataset["RMSD"] = np.array([rmsd_arr[:]]) return dataset @@ -1299,7 +1489,7 @@ def get_dataset_names(ref_key, datasets, n=3): """ ds_dict = {} for ds in datasets.keys(): - ds_dict[ds] = datasets[ds]['columns'] + ds_dict[ds] = datasets[ds]["columns"] ds_names = get_result_names(ds_dict, ref_key, n) dataset_names = [] for name in ds_names[0]: @@ -1309,13 +1499,22 @@ def get_dataset_names(ref_key, datasets, n=3): class PairwiseMetricsMixin: - def _pairwise_metric_names(self): """ Returns a list of metric names to be calculated between pairs. """ - metrics = ['R', 'p_R', 'BIAS', 'RMSD', 'mse', 'RSS', - 'mse_corr', 'mse_bias', 'urmsd', 'mse_var'] + metrics = [ + "R", + "p_R", + "BIAS", + "RMSD", + "mse", + "RSS", + "mse_corr", + "mse_bias", + "urmsd", + "mse_var", + ] if self.calc_spearman: metrics += ["rho", "p_rho"] if self.calc_kendall: @@ -1336,11 +1535,13 @@ def _pairwise_metric_names(self): "mse_bias_ci_lower", "mse_bias_ci_upper", "RMSD_ci_lower", "RMSD_ci_upper", "mse_ci_lower", "mse_ci_upper", - "RSS_ci_lower", "RSS_ci_upper",] + "RSS_ci_lower", "RSS_ci_upper", + ] return metrics - def _calc_pairwise_metrics(self, x, y, mx, my, varx, vary, cov, - result, suffix=""): + def _calc_pairwise_metrics( + self, x, y, mx, my, varx, vary, cov, result, suffix="" + ): """ Calculates pairwise metrics, making use of pre-computed moments. @@ -1385,39 +1586,39 @@ def _calc_pairwise_metrics(self, x, y, mx, my, varx, vary, cov, if self.calc_spearman: ( result["rho" + suffix][0], - result["p_rho" + suffix][0] + result["p_rho" + suffix][0], ) = stats.spearmanr(x, y) if self.calc_kendall: ( result["tau" + suffix][0], - result["p_tau" + suffix][0] + result["p_tau" + suffix][0], ) = stats.kendalltau(x, y) if self.analytical_cis: ( result["BIAS_ci_lower" + suffix][0], - result["BIAS_ci_upper" + suffix][0] + result["BIAS_ci_upper" + suffix][0], ) = _bias_ci_from_moments(0.05, mx, my, varx, vary, cov, n_obs) ( result["urmsd_ci_lower" + suffix][0], - result["urmsd_ci_upper" + suffix][0] + result["urmsd_ci_upper" + suffix][0], ) = ubrmsd_ci(x, y, result["urmsd" + suffix][0]) ( result["R_ci_lower" + suffix][0], - result["R_ci_upper" + suffix][0] + result["R_ci_upper" + suffix][0], ) = pearson_r_ci(x, y, result["R" + suffix][0]) if self.calc_spearman: ( result["rho_ci_lower" + suffix][0], - result["rho_ci_upper" + suffix][0] + result["rho_ci_upper" + suffix][0], ) = spearman_r_ci(x, y, result["rho" + suffix][0]) if self.calc_kendall: ( result["tau_ci_lower" + suffix][0], - result["tau_ci_upper" + suffix][0] + result["tau_ci_upper" + suffix][0], ) = kendall_tau_ci(x, y, result["tau" + suffix][0]) if self.bootstrap_cis: @@ -1491,9 +1692,15 @@ class PairwiseIntercomparisonMetrics(MetadataMetrics, PairwiseMetricsMixin): The default is `False`. This might be a lot of computational effort. """ - def __init__(self, min_obs=10, calc_spearman=True, calc_kendall=True, - analytical_cis=True, bootstrap_cis=False, - metadata_template=None): + def __init__( + self, + min_obs=10, + calc_spearman=True, + calc_kendall=True, + analytical_cis=True, + bootstrap_cis=False, + metadata_template=None, + ): super().__init__(min_obs=10, metadata_template=metadata_template) self.calc_spearman = calc_spearman @@ -1523,8 +1730,7 @@ def calc_metrics(self, data, gpi_info): result["n_obs"][0] = n_obs if n_obs < self.min_obs: warnings.warn( - "Not enough observations to calculate metrics.", - UserWarning + "Not enough observations to calculate metrics.", UserWarning ) return result @@ -1572,8 +1778,13 @@ class TripleCollocationMetrics(MetadataMetrics, PairwiseMetricsMixin): The default is `False`. This might be a lot of computational effort. """ - def __init__(self, refname, min_obs=10, bootstrap_cis=False, - metadata_template=None): + def __init__( + self, + refname, + min_obs=10, + bootstrap_cis=False, + metadata_template=None, + ): super().__init__(min_obs=10, metadata_template=metadata_template) @@ -1620,8 +1831,7 @@ def calc_metrics(self, data, gpi_info): result["n_obs"][0] = n_obs if n_obs < self.min_obs: warnings.warn( - "Not enough observations to calculate metrics.", - UserWarning + "Not enough observations to calculate metrics.", UserWarning ) return result @@ -1648,19 +1858,26 @@ def calc_metrics(self, data, gpi_info): return result -if __name__ == '__main__': # pragma: no cover - calc = TCMetrics(other_names=('k1', 'k2', 'k3'), - calc_tau=False, - metadata_template=dict(meta1=np.array(['TBD']), - meta2=np.float32([np.nan]))) +if __name__ == "__main__": # pragma: no cover + calc = TCMetrics( + other_names=("k1", "k2", "k3"), + calc_tau=False, + metadata_template=dict( + meta1=np.array(["TBD"]), meta2=np.float32([np.nan]) + ), + ) adapted = MonthsMetricsAdapter(calc) - idx = pd.date_range('2000-01-01', '2010-07-21', freq='D') - df = pd.DataFrame(index=idx, - data={'ref': np.random.rand(idx.size), - 'k1': np.random.rand(idx.size), - 'k2': np.random.rand(idx.size), - 'k3': np.random.rand(idx.size)}) - - calc.calc_metrics(df, (0, 1, 2, {'meta1': 'meta', 'meta2': 12})) + idx = pd.date_range("2000-01-01", "2010-07-21", freq="D") + df = pd.DataFrame( + index=idx, + data={ + "ref": np.random.rand(idx.size), + "k1": np.random.rand(idx.size), + "k2": np.random.rand(idx.size), + "k3": np.random.rand(idx.size), + }, + ) + + calc.calc_metrics(df, (0, 1, 2, {"meta1": "meta", "meta2": 12})) diff --git a/src/pytesmo/validation_framework/results_manager.py b/src/pytesmo/validation_framework/results_manager.py index 2e77d061..c5aabbb0 100644 --- a/src/pytesmo/validation_framework/results_manager.py +++ b/src/pytesmo/validation_framework/results_manager.py @@ -22,8 +22,8 @@ def build_filename(root, key): root : str Directory where the file should be stored key : list of tuples - The keys are joined to create a filename from them. If the length of the - joined keys is too long we shorten it. + The keys are joined to create a filename from them. If the length of + the joined keys is too long we shorten it. Returns ------- @@ -33,25 +33,24 @@ def build_filename(root, key): ds_names = [] for ds in key: if isinstance(ds, tuple): - ds_names.append('.'.join(ds)) + ds_names.append(".".join(ds)) else: ds_names.append(ds) - fname = '_with_'.join(ds_names) - ext = 'nc' + fname = "_with_".join(ds_names) + ext = "nc" - if len(os.path.join(root, '.'.join([fname, ext]))) > 255: + if len(os.path.join(root, ".".join([fname, ext]))) > 255: ds_names = [str(ds[0]) for ds in key] - fname = '_with_'.join(ds_names) + fname = "_with_".join(ds_names) - if len(os.path.join(root, '.'.join([fname, ext]))) > 255: - fname = 'validation' + if len(os.path.join(root, ".".join([fname, ext]))) > 255: + fname = "validation" - return os.path.join(root, '.'.join([fname, ext])) + return os.path.join(root, ".".join([fname, ext])) class PointDataResults(Dataset): - def __init__(self, filename, zlib=True, read_only=False): """ Results manager for validation results as returned by the validation @@ -67,61 +66,82 @@ def __init__(self, filename, zlib=True, read_only=False): Force read only mode when opening the netcdf file """ - self.time_unit = 'days since 1900-01-01 00:00:00' + self.time_unit = "days since 1900-01-01 00:00:00" if os.path.exists(filename): if read_only: - mode = 'r' + mode = "r" else: - mode = 'a' + mode = "a" else: - mode = 'w' + mode = "w" super(PointDataResults, self).__init__(filename, mode=mode, zlib=zlib) - if mode == 'w': + if mode == "w": # in space (static results) - self.dataset.createDimension('loc', None) + self.dataset.createDimension("loc", None) # in time (rolling metrics) - self.dataset.createDimension('obs', None) + self.dataset.createDimension("obs", None) # default variables, along loc dim self.write_var( - 'lon', dim=('loc'), dtype='float', - attr=dict(long_name="location longitude", - standard_name="longitude", - units="degrees_east", - valid_range=np.array([-180, 180]), - axis="X") + "lon", + dim=("loc"), + dtype="float", + attr=dict( + long_name="location longitude", + standard_name="longitude", + units="degrees_east", + valid_range=np.array([-180, 180]), + axis="X", + ), ) self.write_var( - 'lat', dim=('loc'), dtype="float", - attr=dict(long_name="location latitude", - standard_name="latitude", - units="degrees_north", - valid_range=np.array([-90, 90]), - axis="Y") + "lat", + dim=("loc"), + dtype="float", + attr=dict( + long_name="location latitude", + standard_name="latitude", + units="degrees_north", + valid_range=np.array([-90, 90]), + axis="Y", + ), ) self.write_var( - 'idx', dim=('loc'), dtype="int", - attr=dict(long_name="observation point index", - standard_name="idx", - units="timeseries_id") + "idx", + dim=("loc"), + dtype="int", + attr=dict( + long_name="observation point index", + standard_name="idx", + units="timeseries_id", + ), ) # indexing var for time series self.write_var( - '_row_size', dim=('loc'), dtype="int", - attr=dict(long_name="number of timestamps for this loc", - sample_dimension="obs") + "_row_size", + dim=("loc"), + dtype="int", + attr=dict( + long_name="number of timestamps for this loc", + sample_dimension="obs", + ), ) self.write_var( - "time", dtype="float", dim=('obs'), - attr=dict(long_name="metric time stamp", standard_name="time", - units=self.time_unit) + "time", + dtype="float", + dim=("obs"), + attr=dict( + long_name="metric time stamp", + standard_name="time", + units=self.time_unit, + ), ) def __getitem__(self, key: str) -> Variable: @@ -132,46 +152,52 @@ def variables(self) -> np.array: """Names of all variables in the data set""" return self.dataset.variables.keys() - def _num2date(self, nums:np.array, as_pd_idx:bool=True) -> \ - Union[pd.DatetimeIndex, np.array]: - """ Read time stamps and convert them. """ - dates = num2date(nums,units=self.time_unit, - calendar='standard', only_use_cftime_datetimes=False, - only_use_python_datetimes=True) + def _num2date( + self, nums: np.array, as_pd_idx: bool = True + ) -> Union[pd.DatetimeIndex, np.array]: + """Read time stamps and convert them.""" + dates = num2date( + nums, + units=self.time_unit, + calendar="standard", + only_use_cftime_datetimes=False, + only_use_python_datetimes=True, + ) if as_pd_idx: return pd.DatetimeIndex(dates) else: - return dates.astype('datetime64[ns]') + return dates.astype("datetime64[ns]") - def _date2num(self, dates:Union[pd.DatetimeIndex, np.array]) -> np.array: + def _date2num(self, dates: Union[pd.DatetimeIndex, np.array]) -> np.array: """Convert datetime index or dates to float""" if isinstance(dates, pd.DatetimeIndex): dates = dates.to_pydatetime() - return date2num(dates, units=self.time_unit, calendar='standard') + return date2num(dates, units=self.time_unit, calendar="standard") - def _lonlat2idx(self, lon:float, lat:float) -> int: + def _lonlat2idx(self, lon: float, lat: float) -> int: """Find index of location by coordinates""" - return np.where(np.logical_and(self['lon'][:] == lon, - self['lat'][:] == lat))[0] + return np.where( + np.logical_and(self["lon"][:] == lon, self["lat"][:] == lat) + )[0] - def _idx2lonlat(self, idx:int) -> tuple: + def _idx2lonlat(self, idx: int) -> tuple: """Find coordinates of location by index""" - return (self['lon'][:][idx], self['lat'][:][idx]) + return (self["lon"][:][idx], self["lat"][:][idx]) - def _sel_attr(self, attr:dict, name:str, time:bool=False) -> dict: - """ Select attributes for variable """ + def _sel_attr(self, attr: dict, name: str, time: bool = False) -> dict: + """Select attributes for variable""" if attr is None: attr = {} if name in attr.keys(): var_attr = attr[name] else: var_attr = {} - if 'coordinates' not in var_attr.keys(): + if "coordinates" not in var_attr.keys(): if time: - var_attr['coordinates'] = 'idx lat lon time' + var_attr["coordinates"] = "idx lat lon time" else: - var_attr['coordinates'] = 'idx lat lon' + var_attr["coordinates"] = "idx lat lon" return var_attr @@ -193,14 +219,16 @@ def add_ts_results(self, idx, times, results, attr=None): Only used when the variable is created, not if it is already in the dataset. """ - sel = slice(self['_row_size'][:][:idx].sum(), None) - self['time'][sel] = self._date2num(times) - self['_row_size'][idx] = len(times) # update the time series length + sel = slice(self["_row_size"][:][:idx].sum(), None) + self["time"][sel] = self._date2num(times) + self["_row_size"][idx] = len(times) # update the time series length for name, data in results.items(): if name not in self.variables: var_attr = self._sel_attr(attr, name, False) - self.write_var(name, data=data, dim=('obs'), attr=var_attr) # todo: one or both? + self.write_var( + name, data=data, dim=("obs"), attr=var_attr + ) # todo: one or both? else: self[name][sel] = data @@ -211,9 +239,11 @@ def add_metrics_results(self, lons, lats, results, attr=None): Parameters ---------- lons : np.array - Array of location longitudes, shape must match shape of arrays in data + Array of location longitudes, shape must match shape of arrays + in data lats : np.array - Array of location latitudes, shape must match shape of arrays in data + Array of location latitudes, shape must match shape of arrays + in data results : dict Variable names as dict keys and data arrays as values. As returned by the metric calculators, except the RollingMetrics. Shape of data @@ -229,26 +259,33 @@ def add_metrics_results(self, lons, lats, results, attr=None): Indices of the new locations, can be used to add time results """ n = len(lons) - if not np.all(np.array([len(lons), len(lats)] + [len(d) for d in results.values()]) == n): - raise ValueError('Lon, Lat and data variable must have the same shape') + if not np.all( + np.array( + [len(lons), len(lats)] + [len(d) for d in results.values()] + ) + == n + ): + raise ValueError( + "Lon, Lat and data variable must have the same shape" + ) - idx = self['idx'][:][-1] + 1 if len(self['idx']) != 0 else 0 + idx = self["idx"][:][-1] + 1 if len(self["idx"]) != 0 else 0 sel = slice(idx, None) - self['idx'][sel] = np.arange(idx, idx+n) #+ 1 - self['_row_size'][sel] = 0 - self['lon'][sel], self['lat'][sel] = lons, lats + self["idx"][sel] = np.arange(idx, idx + n) # + 1 + self["_row_size"][sel] = 0 + self["lon"][sel], self["lat"][sel] = lons, lats for name, data in results.items(): if isinstance(name, tuple): name = "__".join(name) if name not in self.variables: var_attr = self._sel_attr(attr, name, False) - self.write_var(name, data=data, dim=('loc'), attr=var_attr) + self.write_var(name, data=data, dim=("loc"), attr=var_attr) else: self[name][sel] = data - return self['idx'][sel].data + return self["idx"][sel].data def add_result(self, lon, lat, data, ts_vars=None, times=None, attr=None): """ @@ -274,44 +311,58 @@ def add_result(self, lon, lat, data, ts_vars=None, times=None, attr=None): if ts_vars is None: ts_vars = [] - metric_results = {k: v for k,v in data.items() if k not in ts_vars} - metric_attrs = {k: v for k,v in attr.items() if k in metric_results.keys()} + metric_results = {k: v for k, v in data.items() if k not in ts_vars} + metric_attrs = { + k: v for k, v in attr.items() if k in metric_results.keys() + } - ts_results = {k: v for k,v in data.items() if k in ts_vars} + ts_results = {k: v for k, v in data.items() if k in ts_vars} if times is None and ts_results: - raise ValueError('Got time series variables, ' - 'but no times passed: {}'.format(ts_results.keys())) + raise ValueError( + "Got time series variables, " + "but no times passed: {}".format(ts_results.keys()) + ) - idx = self.add_metrics_results(lons=np.array([lon]), lats=np.array([lat]), - results=metric_results, attr=metric_attrs) + idx = self.add_metrics_results( + lons=np.array([lon]), + lats=np.array([lat]), + results=metric_results, + attr=metric_attrs, + ) if ts_results: assert len(idx) == 1 - ts_attrs = {k: v for k,v in attr.items() if k in ts_results.keys()} - self.add_ts_results(idx[0], times=times, results=ts_results, attr=ts_attrs) - + ts_attrs = { + k: v for k, v in attr.items() if k in ts_results.keys() + } + self.add_ts_results( + idx[0], times=times, results=ts_results, attr=ts_attrs + ) - def read_ts(self, idx:int) -> pd.DataFrame: - """ Read time series data for a single point""" + def read_ts(self, idx: int) -> pd.DataFrame: + """Read time series data for a single point""" var_data = {} sel = None for var in self.variables: - if var in ['time', 'idx', '_row_size']: + if var in ["time", "idx", "_row_size"]: continue - if 'obs' in self[var].dimensions: + if "obs" in self[var].dimensions: if sel is None: - sel_start = self['_row_size'][:][:idx].sum() - sel = slice(sel_start, sel_start + self['_row_size'][:][idx]) + sel_start = self["_row_size"][:][:idx].sum() + sel = slice( + sel_start, sel_start + self["_row_size"][:][idx] + ) var_data[var] = self[var][sel] - return pd.DataFrame(index=self._num2date(self['time'][sel]), - data=var_data) + return pd.DataFrame( + index=self._num2date(self["time"][sel]), data=var_data + ) - def read_loc(self, idx:Union[int, np.array, None]=None) -> pd.DataFrame: - """ Read loc data for one/multiple/all point(s) """ + def read_loc(self, idx: Union[int, np.array, None] = None) -> pd.DataFrame: + """Read loc data for one/multiple/all point(s)""" if idx is None: - data = pd.DataFrame(index=self['idx'][:]) + data = pd.DataFrame(index=self["idx"][:]) idx = slice(None, None) else: if isinstance(idx, int): @@ -319,16 +370,17 @@ def read_loc(self, idx:Union[int, np.array, None]=None) -> pd.DataFrame: data = pd.DataFrame(index=idx) for var in self.variables: - if var in ['time', 'idx', '_row_size']: + if var in ["time", "idx", "_row_size"]: continue - if not 'obs' in self[var].dimensions: + if "obs" not in self[var].dimensions: data[var] = self[var][:][idx] return data -def netcdf_results_manager(results, save_path, ts_vars:list=None, zlib=True, - attr=None): +def netcdf_results_manager( + results, save_path, ts_vars: list = None, zlib=True, attr=None +): """ Write validation results to netcdf file. @@ -337,9 +389,10 @@ def netcdf_results_manager(results, save_path, ts_vars:list=None, zlib=True, results : dict Validation results as returned by the metrics calculator. Keys are tuples that define the dataset names that were used. - Values contains 'lon' and 'lat' keys for defining the points, and optionally - 'time' which sets the time stamps for each location (if there are metrics - over time in the results - e.g due to RollingMetrics) + Values contains 'lon' and 'lat' keys for defining the points, and + optionally 'time' which sets the time stamps for each location + (if there are metrics over time in the results - e.g due to + RollingMetrics) save_path : str Directory where the netcdf file(s) are are created, filenames follow from the results keysS @@ -358,14 +411,14 @@ def netcdf_results_manager(results, save_path, ts_vars:list=None, zlib=True, filename = build_filename(save_path, ds_names) with PointDataResults(filename, zlib=zlib) as writer: - lons = res.pop('lon') - lats = res.pop('lat') + lons = res.pop("lon") + lats = res.pop("lat") if ts_vars is not None: for i, (lon, lat) in enumerate(zip(lons, lats)): data = {} for k, v in res.items(): - if k.lower() == 'time': - time = pd.DatetimeIndex(res['time'][i]) + if k.lower() == "time": + time = pd.DatetimeIndex(res["time"][i]) elif k in ts_vars: data[k] = v[i] else: @@ -374,8 +427,14 @@ def netcdf_results_manager(results, save_path, ts_vars:list=None, zlib=True, else: data[k] = v[i] - writer.add_result(lon, lat, data=data, ts_vars=ts_vars, - times=time, attr=attr) + writer.add_result( + lon, + lat, + data=data, + ts_vars=ts_vars, + times=time, + attr=attr, + ) else: writer.add_metrics_results(lons, lats, results=res, attr=attr) diff --git a/src/pytesmo/validation_framework/temporal_matchers.py b/src/pytesmo/validation_framework/temporal_matchers.py index 47e261d0..2acee3c9 100644 --- a/src/pytesmo/validation_framework/temporal_matchers.py +++ b/src/pytesmo/validation_framework/temporal_matchers.py @@ -26,11 +26,11 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -''' +""" Created on Sep 24, 2013 @author: Christoph.Paulik@geo.tuwien.ac.at -''' +""" import itertools import pandas as pd @@ -60,8 +60,13 @@ def match(self, reference, *args): """ ref_df = pd.DataFrame(reference) return temporal_matching.combined_temporal_collocation( - ref_df, args, self.window, dropna=True, dropduplicates=True, - add_ref_data=True, combined_dropna="all" + ref_df, + args, + self.window, + dropna=True, + dropduplicates=True, + add_ref_data=True, + combined_dropna="all", ) def combinatory_matcher(self, df_dict, refkey, n=2, **kwargs): @@ -110,8 +115,7 @@ def combinatory_matcher(self, df_dict, refkey, n=2, **kwargs): match_key.append(key) matched_key = tuple([refkey] + sorted(match_key)) - joined = self.match(ref_df, - *match_list) + joined = self.match(ref_df, *match_list) if len(joined) != 0: matched[matched_key] = joined @@ -194,10 +198,16 @@ def matcher(dfs, refname, k=None, **kwargs): # this comes from Validation.temporal_match_datasets but is not # required return dfdict_combined_temporal_collocation( - dfs, refname, k, window=window, dropna=True, - combined_dropna="any", dropduplicates=True, + dfs, + refname, + k, + window=window, + dropna=True, + combined_dropna="any", + dropduplicates=True, **kwargs ) + return matcher diff --git a/src/pytesmo/validation_framework/upscaling.py b/src/pytesmo/validation_framework/upscaling.py index 8744e567..41110e33 100644 --- a/src/pytesmo/validation_framework/upscaling.py +++ b/src/pytesmo/validation_framework/upscaling.py @@ -1,30 +1,30 @@ -# Copyright (c) 2021, Vienna University of Technology (TU Wien), Department -# of Geodesy and Geoinformation (GEO). +# Copyright (c) 2021, TU Wien, Department of Geodesy and Geoinformation # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of the Vienna University of Technology, Department -# of Geodesy and Geoinformation nor the names of its contributors may -# be used to endorse or promote products derived from this software -# without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the TU Wien, Department of Geodesy and +# Geoinformation nor the names of its contributors may be used to endorse +# or promote products derived from this software without specific prior +# written permission. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, # DEPARTMENT OF GEODESY AND GEOINFORMATION 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. +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + import warnings from typing import Union @@ -37,7 +37,8 @@ class MixinReadTs: - """Mixin class to provide the reading function in DataAverager and DataManager""" + """Mixin class to provide the reading function in DataAverager + and DataManager""" def read_ds(self, name, *args): """ @@ -64,23 +65,27 @@ def read_ds(self, name, *args): """ ds = self.datasets[name] args = list(args) - args.extend(ds['args']) + args.extend(ds["args"]) try: - func = getattr(ds['class'], self.read_ts_names[name]) - data_df = func(*args, **ds['kwargs']) + func = getattr(ds["class"], self.read_ts_names[name]) + data_df = func(*args, **ds["kwargs"]) if type(data_df) is TS or issubclass(type(data_df), TS): data_df = data_df.data except IOError: warnings.warn( - "IOError while reading dataset {} with args {:}".format(name, - args)) + "IOError while reading dataset {} with args {:}".format( + name, args + ) + ) return None except RuntimeError as e: if e.args[0] == "No such file or directory": warnings.warn( - "IOError while reading dataset {} with args {:}".format(name, - args)) + "IOError while reading dataset {} with args {:}".format( + name, args + ) + ) return None else: raise e @@ -97,11 +102,13 @@ def read_ds(self, name, *args): # here we use the isoformat since pandas slice behavior is # different when using datetime objects. data_df = data_df[ - self.period[0].isoformat():self.period[1].isoformat()] + self.period[0].isoformat(): self.period[1].isoformat() + ] if len(data_df) == 0: - warnings.warn("No data for dataset {} with arguments {:}".format(name, - args)) + warnings.warn( + "No data for dataset {} with arguments {:}".format(name, args) + ) return None else: @@ -110,10 +117,12 @@ def read_ds(self, name, *args): class Upscaling(MixinReadTs): """ - This class provides methods to combine the measurements of validation datasets (others) that fall under the same - gridpoint of the dataset being validated (reference). + This class provides methods to combine the measurements of validation + datasets (others) that fall under the same gridpoint of the dataset being + validated (reference). - The goal is to include here all identified upscaling methods to provide an estimate at the reference footprint scale. + The goal is to include here all identified upscaling methods to provide + an estimate at the reference footprint scale. Implemented methods: @@ -123,7 +132,8 @@ class Upscaling(MixinReadTs): Parameters ---------- ref_class : of the reference - Class containing the method read_ts for reading the data of the reference + Class containing the method read_ts for reading the data of + the reference others_class : dict Dict of shape {'other_name': } for the other dataset upscaling_lut : dict @@ -133,11 +143,11 @@ class Upscaling(MixinReadTs): """ def __init__( - self, - ref_class, - others_class, - upscaling_lut, - manager_parms, + self, + ref_class, + others_class, + upscaling_lut, + manager_parms, ): self.ref_class = ref_class self.others_class = others_class @@ -148,9 +158,9 @@ def __init__( self.read_ts_names = manager_parms["read_ts_names"] def _read( - self, - points, - other_name, + self, + points, + other_name, ) -> list: """ Get the timeseries for given points info and return them in a list. @@ -177,10 +187,7 @@ def _read( @staticmethod def temporal_match( - to_match, - hours=6, - drop_missing=False, - **kwargs + to_match, hours=6, drop_missing=False, **kwargs ) -> pd.DataFrame: """ Temporal match to the longest timeseries @@ -192,7 +199,8 @@ def temporal_match( hours : int window to perform the temporal matching drop_missing : bool, optional. Default is False. - If true, only time steps when all points have measurements are kept + If true, only time steps when all points have measurements + are kept Returns ------- @@ -227,20 +235,24 @@ def temporal_match( @staticmethod def tstability_filter( - df, - r_min=0.6, - see_max=0.05, - min_n=4, - **kwargs, + df, + r_min=0.6, + see_max=0.05, + min_n=4, + **kwargs, ) -> pd.DataFrame: """ - Uses time stability concepts to filter point-measurements (pms). Determines wether the upscaled measurement - based on a simple average of all the pms is in sufficient agreement with each pm, and if not eliminates pm - from the pool. - - Thresholds are based on Wagner W, Pathe C, Doubkova M, Sabel D, Bartsch A, Hasenauer S, Blöschl G, Scipal K, - Martínez-Fernández J, Löw A. Temporal Stability of Soil Moisture and Radar Backscatter Observed by the Advanced - Synthetic Aperture Radar (ASAR). Sensors. 2008; 8(2):1174-1197. https://doi.org/10.3390/s80201174 + Uses time stability concepts to filter point-measurements (pms). + Determines whether the upscaled measurement based on a simple average + of all the pms is in sufficient agreement with each pm, and if not + eliminates pm from the pool. + + Thresholds are based on: + Wagner W, Pathe C, Doubkova M, Sabel D, Bartsch A, Hasenauer S, + Blöschl G, Scipal K, Martínez-Fernández J, Löw A. + Temporal Stability of Soil Moisture and Radar Backscatter Observed + by the Advanced Synthetic Aperture Radar (ASAR). Sensors. 2008; + 8(2):1174-1197. https://doi.org/10.3390/s80201174 Parameters ---------- @@ -267,10 +279,7 @@ def tstability_filter( filter_out = [] for n, pm in enumerate(df): pm_values = df[pm] - regr = linregress( - estimate, - pm_values - ) + regr = linregress(estimate, pm_values) if regr.rvalue < r_min or regr.stderr > see_max: filter_out.append(pm) @@ -278,9 +287,10 @@ def tstability_filter( return filtered - def upscale(self, df, method='average', **kwargs) -> pd.Series: + def upscale(self, df, method="average", **kwargs) -> pd.Series: """ - Handle the column names and return the upscaled Dataframe with the specified method. + Handle the column names and return the upscaled Dataframe with the + specified method. Parameters ---------- @@ -302,7 +312,10 @@ def upscale(self, df, method='average', **kwargs) -> pd.Series: } if method not in up_function.keys(): raise KeyError( - "The selected method {} is not implemented in the upscaling options".format(method) + "The selected method {} is not implemented in the " + "upscaling options".format( + method + ) ) f = up_function[method] @@ -316,15 +329,16 @@ def _average(df, **kwargs) -> pd.Series: return out def get_upscaled_ts( - self, - gpi, - other_name, - upscaling_method="average", - temporal_stability=False, - **kwargs + self, + gpi, + other_name, + upscaling_method="average", + temporal_stability=False, + **kwargs, ) -> Union[None, pd.DataFrame]: """ - Find the upscale estimate timeseries with given method, for a certain reference gpi + Find the upscale estimate timeseries with given method, for a certain + reference gpi Parameters ---------- @@ -343,7 +357,8 @@ def get_upscaled_ts( Returns ------- upscaled : pd.DataFrame or None - upscaled time series; if there are no points under the specific gpi, None is returned + upscaled time series; if there are no points under the specific + gpi, None is returned """ other_lut = self.lut[other_name] # check that there are points for specific reference gpi @@ -353,10 +368,7 @@ def get_upscaled_ts( other_points = other_lut[gpi] # read non-reference points and filter out Nones - tss = self._read( - points=other_points, - other_name=other_name - ) + tss = self._read(points=other_points, other_name=other_name) tss = [df for df in tss if df is not None] # handle situation with single timeseries or all None @@ -365,13 +377,16 @@ def get_upscaled_ts( return None return tss[0] - # here we collect only the variable columns; flags are irrelevant at this point and can be dropped + # here we collect only the variable columns; flags are irrelevant at + # this point and can be dropped target_column = self.datasets[other_name]["columns"][0] to_match = [] for n, point_df in enumerate(tss): point_ts = point_df[target_column] to_match.append( - point_ts.to_frame(name=target_column + "_{}".format(n)) # avoid name clashing + point_ts.to_frame( + name=target_column + "_{}".format(n) + ) # avoid name clashing ) tss = self.temporal_match(to_match, **kwargs) @@ -379,9 +394,8 @@ def get_upscaled_ts( tss = self.tstability_filter(tss, **kwargs) # perform upscaling and return correct name - upscaled = self.upscale( - tss, - method=upscaling_method - ).to_frame(target_column) + upscaled = self.upscale(tss, method=upscaling_method).to_frame( + target_column + ) return upscaled diff --git a/src/pytesmo/validation_framework/validation.py b/src/pytesmo/validation_framework/validation.py index 05415bb6..cc2e01e3 100644 --- a/src/pytesmo/validation_framework/validation.py +++ b/src/pytesmo/validation_framework/validation.py @@ -25,9 +25,10 @@ class Validation(object): Parameters ---------- - datasets : dict of dicts, or :py:class:`pytesmo.validation_framework.data_manager.DataManager` + datasets : dict of dicts or DataManager :Keys: string, datasets names :Values: dict, containing the following fields + :py:class:`pytesmo.validation_framework.data_manager.DataManager` 'class': object Class containing the method read_ts for reading the data. @@ -50,55 +51,62 @@ class Validation(object): Maximum allowed distance in meters for the lut calculation. spatial_ref: string Name of the dataset used as a spatial, temporal and scaling reference. - temporal and scaling references can be changed if needed. See the optional parameters - ``temporal_ref`` and ``scaling_ref``. + temporal and scaling references can be changed if needed. See the + optional parameters ``temporal_ref`` and ``scaling_ref``. metrics_calculators : dict of functions - The keys of the dict are tuples with the following structure: (n, k) with n >= 2 - and n>=k. n must be equal to the number of datasets now. + The keys of the dict are tuples with the following structure: (n, k) + with n >= 2 and n>=k. n must be equal to the number of datasets now. n is the number of datasets that should be temporally matched to the - reference dataset and k is how many columns the metric calculator will get at once. - What this means is that it is e.g. possible to temporally match 3 datasets with - 3 columns in total and then give the combinations of these columns to the metric - calculator in sets of 2 by specifying the dictionary like: + reference dataset and k is how many columns the metric calculator + will get at once. + What this means is that it is e.g. possible to temporally match 3 + datasets with 3 columns in total and then give the combinations of + these columns to the metric calculator in sets of 2 by specifying the + dictionary like: .. code:: { (3, 2): metric_calculator} - The values are functions that take an input DataFrame with the columns 'ref' - for the reference and 'n1', 'n2' and - so on for other datasets as well as a dictionary mapping the column names - to the names of the original datasets. In this way multiple metric calculators - can be applied to different combinations of n input datasets. + The values are functions that take an input DataFrame with the columns + 'ref' for the reference and 'n1', 'n2' and + so on for other datasets as well as a dictionary mapping the column + names to the names of the original datasets. In this way multiple + metric calculators can be applied to different combinations of n + input datasets. temporal_matcher: function, optional function that takes a dict of dataframes and a reference_key. It performs the temporal matching on the data and returns a dictionary - of matched DataFrames that should be evaluated together by the metric calculator. + of matched DataFrames that should be evaluated together by the metric + calculator. temporal_window: float, optional - Window to allow in temporal matching in days. The window is allowed on both - sides of the timestamp of the temporal reference data. + Window to allow in temporal matching in days. The window is allowed + on both sides of the timestamp of the temporal reference data. Only used with the standard temporal matcher. temporal_ref: string, optional - If the temporal matching should use another dataset than the spatial reference - as a reference dataset then give the dataset name here. + If the temporal matching should use another dataset than the spatial + reference as a reference dataset then give the dataset name here. period : list, optional Of type [datetime start, datetime end]. If given then the two input datasets will be truncated to start <= dates <= end. masking_datasets : dict of dictionaries - Same format as the datasets with the difference that the read_ts method of these - datasets has to return pandas.DataFrames with only boolean columns. True means that the - observations at this timestamp should be masked and False means that it should be kept. + Same format as the datasets with the difference that the `read` + method of these datasets has to return pandas.DataFrames with only + boolean columns. True means that the observations at this timestamp + should be masked and False means that it should be kept. scaling : string, None or class instance - - If set then the data will be scaled into the reference space using the - method specified by the string using the - :py:class:`pytesmo.validation_framework.data_scalers.DefaultScaler` class. + - If set then the data will be scaled into the reference space using + the method specified by the string using the + :py:class:`pytesmo.validation_framework.data_scalers.DefaultScaler` + class. - If set to None then no scaling will be performed. - It can also be set to a class instance that implements a ``scale(self, data, reference_index, gpi_info)`` method. See - :py:class:`pytesmo.validation_framework.data_scalers.DefaultScaler` for an example. + :py:class:`pytesmo.validation_framework.data_scalers.DefaultScaler` + for an example. scaling_ref : string, optional - If the scaling should be done to another dataset than the spatial reference then - give the dataset name here. + If the scaling should be done to another dataset than the spatial + reference then give the dataset name here. Methods ------- @@ -108,12 +116,19 @@ class Validation(object): Returns processing jobs that this process can understand. """ - def __init__(self, datasets, spatial_ref, metrics_calculators, - temporal_matcher=None, temporal_window=1 / 24.0, - temporal_ref=None, - masking_datasets=None, - period=None, - scaling='lin_cdf_match', scaling_ref=None): + def __init__( + self, + datasets, + spatial_ref, + metrics_calculators, + temporal_matcher=None, + temporal_window=1 / 24.0, + temporal_ref=None, + masking_datasets=None, + period=None, + scaling="lin_cdf_match", + scaling_ref=None, + ): if isinstance(datasets, DataManager): self.data_manager = datasets @@ -123,13 +138,16 @@ def __init__(self, datasets, spatial_ref, metrics_calculators, self.temp_matching = temporal_matcher if self.temp_matching is None: warnings.warn( - "You are using the default temporal matcher. If you are using one of the" - " newer metric calculators (PairwiseIntercomparisonMetrics," - " TripleCollocationMetrics) you should probably use `make_combined_temporal_matcher`" - " instead. Have a look at the documentation of the metric calculators for more info." + "You are using the default temporal matcher. If you are using " + "one of the newer metric calculators " + "(PairwiseIntercomparisonMetrics, TripleCollocationMetrics) " + "you should probably use `make_combined_temporal_matcher`" + " instead. Have a look at the documentation of the metric " + "calculators for more info." ) self.temp_matching = temporal_matchers.BasicTemporalMatching( - window=temporal_window).combinatory_matcher + window=temporal_window + ).combinatory_matcher self.temporal_ref = temporal_ref if self.temporal_ref is None: @@ -138,7 +156,7 @@ def __init__(self, datasets, spatial_ref, metrics_calculators, self.metrics_c = metrics_calculators for n, k in self.metrics_c: if n < len(self.data_manager.datasets.keys()): - raise ValueError('n must be equal to the number of datasets') + raise ValueError("n must be equal to the number of datasets") self.masking_dm = None if masking_datasets is not None: @@ -147,9 +165,11 @@ def __init__(self, datasets, spatial_ref, metrics_calculators, # common time stamps. Use _reference here to make a clash with the # names of the masking datasets unlikely masking_datasets.update( - {'_reference': datasets[self.temporal_ref]}) - self.masking_dm = DataManager(masking_datasets, '_reference', - period=period) + {"_reference": datasets[self.temporal_ref]} + ) + self.masking_dm = DataManager( + masking_datasets, "_reference", period=period + ) if type(scaling) == str: self.scaling = DefaultScaler(scaling) @@ -162,8 +182,13 @@ def __init__(self, datasets, spatial_ref, metrics_calculators, self.luts = self.data_manager.get_luts() def calc( - self, gpis, lons, lats, *args, rename_cols=True, - only_with_temporal_ref=False + self, + gpis, + lons, + lats, + *args, + rename_cols=True, + only_with_temporal_ref=False, ): """ The argument iterables (lists or numpy.ndarrays) are processed one @@ -199,31 +224,32 @@ def calc( compact_results : dict of dicts :Keys: result names, combinations of (referenceDataset.column, otherDataset.column) - :Values: dict containing the elements returned by metrics_calculator + :Values: dict containing the elements returned + by metrics_calculator """ results = {} if len(args) > 0: - gpis, lons, lats, args = args_to_iterable(gpis, - lons, - lats, - *args, - n=3) + gpis, lons, lats, args = args_to_iterable( + gpis, lons, lats, *args, n=3 + ) else: gpis, lons, lats = args_to_iterable(gpis, lons, lats) for gpi_info in zip(gpis, lons, lats, *args): - df_dict = self.data_manager.get_data(gpi_info[0], - gpi_info[1], - gpi_info[2]) + df_dict = self.data_manager.get_data( + gpi_info[0], gpi_info[1], gpi_info[2] + ) # if no data is available continue with the next gpi if len(df_dict) == 0: continue matched_data, result, used_data = self.perform_validation( - df_dict, gpi_info, rename_cols=rename_cols, - only_with_temporal_ref=only_with_temporal_ref + df_dict, + gpi_info, + rename_cols=rename_cols, + only_with_temporal_ref=only_with_temporal_ref, ) # add result of one gpi to global results dictionary @@ -240,13 +266,18 @@ def calc( entries = [] for result in results[key]: entries.append(result[field_name][0]) - compact_results[key][field_name] = \ - np.array(entries, dtype=results[key][0][field_name].dtype) + compact_results[key][field_name] = np.array( + entries, dtype=results[key][0][field_name].dtype + ) return compact_results def perform_validation( - self, df_dict, gpi_info, rename_cols=True, only_with_temporal_ref=False + self, + df_dict, + gpi_info, + rename_cols=True, + only_with_temporal_ref=False, ): """ Perform the validation for one grid point index and return the @@ -278,8 +309,7 @@ def perform_validation( if self.masking_dm is not None: ref_df = df_dict[self.temporal_ref] - masked_ref_df = self.mask_dataset(ref_df, - gpi_info) + masked_ref_df = self.mask_dataset(ref_df, gpi_info) if len(masked_ref_df) == 0: return matched_n, results, used_data @@ -297,10 +327,12 @@ def perform_validation( n_matched_data = matched_n[(n, k)] if len(n_matched_data) == 0: continue - result_names = get_result_combinations(self.data_manager.ds_dict, - n=k) - for data, result_key in self.k_datasets_from(n_matched_data, - result_names): + result_names = get_result_combinations( + self.data_manager.ds_dict, n=k + ) + for data, result_key in self.k_datasets_from( + n_matched_data, result_names + ): # it might also be a good idea to move this to # `get_result_combinations` @@ -314,7 +346,7 @@ def perform_validation( # at this stage we can drop the column multiindex and just use # the dataset name - if LooseVersion(pd.__version__) < LooseVersion('0.23'): + if LooseVersion(pd.__version__) < LooseVersion("0.23"): data.columns = data.columns.droplevel(level=1) else: data = data.rename(columns=lambda x: x[0]) @@ -322,11 +354,13 @@ def perform_validation( if self.scaling is not None: # get scaling index by finding the column in the # DataFrame that belongs to the scaling reference - scaling_index = data.columns.tolist().index(self.scaling_ref) + scaling_index = data.columns.tolist().index( + self.scaling_ref + ) try: - data = self.scaling.scale(data, - scaling_index, - gpi_info) + data = self.scaling.scale( + data, scaling_index, gpi_info + ) except ValueError: continue # Drop the scaling reference if it was not in the intended @@ -370,25 +404,26 @@ def mask_dataset(self, ref_df, gpi_info): matched_masking = self.temporal_match_masking_data(ref_df, gpi_info) # this will only be one element since n is the same as the # number of masking datasets - result_names = get_result_names(self.masking_dm.ds_dict, - '_reference', - n=2) + result_names = get_result_names( + self.masking_dm.ds_dict, "_reference", n=2 + ) choose_all = pd.DataFrame(index=ref_df.index) - for data, result in self.k_datasets_from(matched_masking, - result_names, - include_scaling_ref=False): + for data, result in self.k_datasets_from( + matched_masking, result_names, include_scaling_ref=False + ): if len(data) == 0: continue for key in result: - if key[0] != '_reference': + if key[0] != "_reference": # this is necessary since the boolean datatype might have # been changed to float 1.0 and 0.0 issue with temporal # resampling that is not easily resolved since most # datatypes have no nan representation. - choose = pd.Series((data[key] == False), index=data.index) - choose = choose.reindex(index=choose_all.index, - fill_value=True) + choose = pd.Series((data[key] is False), index=data.index) + choose = choose.reindex( + index=choose_all.index, fill_value=True + ) choose_all[key] = choose.copy() choosing = choose_all.apply(np.all, axis=1) @@ -408,18 +443,18 @@ def temporal_match_masking_data(self, ref_df, gpi_info): Returns ------- matched_masking: dict of pandas.DataFrames - Contains temporally matched masking data. This dict has only one key - being a tuple that contains the matched datasets. + Contains temporally matched masking data. This dict has only one + key being a tuple that contains the matched datasets. """ # read only masking datasets and use the already read reference - masking_df_dict = self.masking_dm.get_other_data(gpi_info[0], - gpi_info[1], - gpi_info[2]) - masking_df_dict.update({'_reference': ref_df}) - matched_masking = self.temp_matching(masking_df_dict, - '_reference', - n=2) + masking_df_dict = self.masking_dm.get_other_data( + gpi_info[0], gpi_info[1], gpi_info[2] + ) + masking_df_dict.update({"_reference": ref_df}) + matched_masking = self.temp_matching( + masking_df_dict, "_reference", n=2 + ) return matched_masking def temporal_match_datasets(self, df_dict): @@ -440,16 +475,17 @@ def temporal_match_datasets(self, df_dict): matched_n = {} for n, k in self.metrics_c: - matched_data = self.temp_matching(df_dict, - self.temporal_ref, - n=n, k=k) + matched_data = self.temp_matching( + df_dict, self.temporal_ref, n=n, k=k + ) matched_n[(n, k)] = matched_data return matched_n - def k_datasets_from(self, n_matched_data, result_names, - include_scaling_ref=True): + def k_datasets_from( + self, n_matched_data, result_names, include_scaling_ref=True + ): """ Extract k datasets from n temporally matched ones. @@ -474,19 +510,24 @@ def k_datasets_from(self, n_matched_data, result_names, temporally matched datasets result: tuple Tuple describing which datasets and columns are in - the returned data. ((dataset_name, column_name), (dataset_name2, column_name2)) + the returned data. ((dataset_name, column_name), + (dataset_name2, column_name2)) """ for result in result_names: result_extract = result if self.scaling is not None and include_scaling_ref: - # always make sure the scaling reference is included in the results - # otherwise the scaling will fail - scaling_ref_column = self.data_manager.datasets[self.scaling_ref]['columns'][0] + # always make sure the scaling reference is included in the + # results otherwise the scaling will fail + scaling_ref_column = self.data_manager.datasets[ + self.scaling_ref + ]["columns"][0] scaling_result_name = (self.scaling_ref, scaling_ref_column) if scaling_result_name not in result: result_extract = result + (scaling_result_name,) - data = self.get_data_for_result_tuple(n_matched_data, result_extract) + data = self.get_data_for_result_tuple( + n_matched_data, result_extract + ) yield data, result def get_data_for_result_tuple(self, n_matched_data, result_tuple): @@ -501,7 +542,8 @@ def get_data_for_result_tuple(self, n_matched_data, result_tuple): The key is a tuple of the dataset names. result_tuple: tuple Tuple describing which datasets and columns should be - extracted. ((dataset_name, column_name), (dataset_name2, column_name2)) + extracted. ((dataset_name, column_name), + (dataset_name2, column_name2)) Returns ------- @@ -537,11 +579,12 @@ def get_data_for_result_tuple(self, n_matched_data, result_tuple): # temporal reference. # This guarantees that we only select columns from dataframes for - # which the temporal reference dataset was included in the temporal - # matching + # which the temporal reference dataset was included in the + # temporal matching first_match = [ - key for key in n_matched_data if self.temporal_ref == key[0]] + key for key in n_matched_data if self.temporal_ref == key[0] + ] found_key = None for key in first_match: for dsk in dskey: @@ -570,12 +613,20 @@ def get_processing_jobs(self): if type(self.data_manager.reference_grid) is CellGrid: cells = self.data_manager.reference_grid.get_cells() for cell in cells: - (cell_gpis, - cell_lons, - cell_lats) = self.data_manager.reference_grid.grid_points_for_cell(cell) + ( + cell_gpis, + cell_lons, + cell_lats, + ) = self.data_manager.reference_grid.grid_points_for_cell( + cell + ) jobs.append([cell_gpis, cell_lons, cell_lats]) else: - gpis, lons, lats = self.data_manager.reference_grid.get_grid_points() + ( + gpis, + lons, + lats, + ) = self.data_manager.reference_grid.get_grid_points() jobs = [gpis, lons, lats] return jobs @@ -593,8 +644,8 @@ def args_to_iterable(*args, **kwargs): n : int, optional number of explicit arguments """ - if 'n' in kwargs: - n = kwargs['n'] + if "n" in kwargs: + n = kwargs["n"] else: n = len(args) diff --git a/tests/test_validation_framework/test_adapters.py b/tests/test_validation_framework/test_adapters.py index 294333ba..4adb26c8 100644 --- a/tests/test_validation_framework/test_adapters.py +++ b/tests/test_validation_framework/test_adapters.py @@ -1,32 +1,5 @@ -# Copyright (c) 2016,Vienna University of Technology, -# Department of Geodesy and Geoinformation -# All rights reserved. import pytest -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of the Vienna University of Technology, Department of -# Geodesy and Geoinformation nor the names of its contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL VIENNA UNIVERSITY OF TECHNOLOGY, DEPARTMENT -# OF GEODESY AND GEOINFORMATION 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. - """ Test for the adapters. """ @@ -147,7 +120,7 @@ def test_anomaly_adapter(): def test_anomaly_adapter_one_column(): ds = TestDataset("", n=20) ds_anom = AnomalyAdapter(ds, columns=["x"]) - data_anom = ds_anom.read_ts() + data_anom = ds_anom.read() nptest.assert_almost_equal(data_anom["x"].values[0], -8.5) nptest.assert_almost_equal(data_anom["y"].values[0], 0) @@ -171,8 +144,22 @@ def test_anomaly_clim_adapter_one_column(): nptest.assert_almost_equal(data_anom["y"].values[4], 2) -# the ascat reader gives back an ascat timeseries instead of a dataframe - make -# sure the adapters can deal with that +def test_adapters_custom_fct_name(): + def assert_all_read_fcts(reader): + assert(np.all(reader.read() == reader.read_ts())) + assert(np.all(reader.read() == reader.alias_read())) + + base = TestDataset("", n=20) + assert_all_read_fcts(base) + sma = SelfMaskingAdapter(base, '>=', 5, column_name='y', + read_name='alias_read') + assert_all_read_fcts(sma) + smanom = AnomalyAdapter(sma, read_name='alias_read') + assert_all_read_fcts(smanom) + + +# the ascat reader gives back an ascat timeseries instead of a dataframe - +# make sure the adapters can deal with that def test_adapters_with_ascat(): ascat_data_folder = os.path.join( os.path.dirname(__file__), @@ -270,12 +257,14 @@ def test_timezone_removal(): def test_column_comb_adapter(): ds = TestDataset("", n=20) orig = ds.read() - ds_adapted = ColumnCombineAdapter(ds, func=pd.DataFrame.mean, columns=["x", "y"], - func_kwargs={'skipna': True}, new_name='xy_mean') + ds_adapted = ColumnCombineAdapter( + ds, func=pd.DataFrame.mean, columns=["x", "y"], + func_kwargs={'skipna': True}, new_name='xy_mean') ds_mean1 = ds_adapted.read_ts() ds_mean2 = ds_adapted.read() for ds_mean in [ds_mean1, ds_mean2]: nptest.assert_equal(ds_mean["x"].values, orig["x"].values) nptest.assert_equal(ds_mean["y"].values, orig["y"].values) - nptest.assert_equal(ds_mean["xy_mean"].values, (ds_mean["x"] + ds_mean["y"]) / 2.) + nptest.assert_equal(ds_mean["xy_mean"].values, + (ds_mean["x"] + ds_mean["y"]) / 2.) diff --git a/tests/test_validation_framework/test_datasets.py b/tests/test_validation_framework/test_datasets.py index 4176b6a2..31a3b847 100644 --- a/tests/test_validation_framework/test_datasets.py +++ b/tests/test_validation_framework/test_datasets.py @@ -61,6 +61,9 @@ def read(self, *args, **kwargs): df = pd.DataFrame({'x': x, 'y': y}, columns=['x', 'y'], index=index) return df + def alias_read(self, *args, **kwargs): + return self.read(*args, **kwargs) + def write(self, gpi, data): return None diff --git a/tests/test_validation_framework/test_metric_calculators.py b/tests/test_validation_framework/test_metric_calculators.py index 3fe7200f..b7069927 100644 --- a/tests/test_validation_framework/test_metric_calculators.py +++ b/tests/test_validation_framework/test_metric_calculators.py @@ -523,7 +523,7 @@ class DummyReader: def __init__(self, df, name): self.data = pd.DataFrame(df[name]) - def read_ts(self, *args, **kwargs): + def read(self, *args, **kwargs): return self.data diff --git a/tests/test_validation_framework/test_validation.py b/tests/test_validation_framework/test_validation.py index 5ae8c115..6d13a91d 100644 --- a/tests/test_validation_framework/test_validation.py +++ b/tests/test_validation_framework/test_validation.py @@ -200,7 +200,7 @@ def test_ascat_ismn_validation(ascat_reader, ismn_reader): }, } - read_ts_names = {"ASCAT": "read", "ISMN": "read_ts"} + read_ts_names = {"ASCAT": "read", "ISMN": "read"} period = [datetime(2007, 1, 1), datetime(2014, 12, 31)] datasets = DataManager( @@ -325,7 +325,7 @@ def test_ascat_ismn_validation_metadata(ascat_reader, ismn_reader): }, } - read_ts_names = {"ASCAT": "read", "ISMN": "read_ts"} + read_ts_names = {"ASCAT": "read", "ISMN": "read"} period = [datetime(2007, 1, 1), datetime(2014, 12, 31)] datasets = DataManager( @@ -471,7 +471,7 @@ def test_validation_with_averager(ascat_reader, ismn_reader): }, } - read_ts_names = {"ASCAT": "read", "ISMN": "read_ts"} + read_ts_names = {"ASCAT": "read", "ISMN": "read"} period = [datetime(2007, 1, 1), datetime(2014, 12, 31)] datasets = DataManager( @@ -1115,7 +1115,7 @@ def test_ascat_ismn_validation_metadata_rolling(ascat_reader, ismn_reader): }, } - read_ts_names = {"ASCAT": "read", "ISMN": "read_ts"} + read_ts_names = {"ASCAT": "read", "ISMN": "read"} period = [datetime(2007, 1, 1), datetime(2014, 12, 31)] datasets = DataManager( @@ -1271,7 +1271,7 @@ class DummyReader: def __init__(self, dfs, name): self.data = [pd.DataFrame(dfs[i][name]) for i in range(len(dfs))] - def read_ts(self, gpi, *args, **kwargs): + def read(self, gpi, *args, **kwargs): return self.data[gpi] @@ -1279,7 +1279,7 @@ class DummyNoneReader: def __init__(self, dfs, name): self.data = [pd.DataFrame(dfs[i][name]) for i in range(len(dfs))] - def read_ts(self, gpi, *args, **kwargs): + def read(self, gpi, *args, **kwargs): names = self.data[gpi].columns return pd.DataFrame(np.zeros((0, len(names))), columns=names)