diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000000..46eb1b4359d --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,71 @@ +# config based on examples from SciPy & NumPy repositories, which +# themselves credit an original example by Olivier Grisel at +# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml +clone_depth: 50 +max_jobs: 100 + +cache: + - '%LOCALAPPDATA%\pip\Cache' + +image: + - Visual Studio 2015 + +environment: + global: + CONDA_CHANNELS: conda-forge + CONDA_DEPENDENCIES: pip setuptools wheel cython mock six biopython networkx joblib matplotlib scipy vs2015_runtime pytest mmtf-python GridDataFormats hypothesis pytest-cov codecov + PIP_DEPENDENCIES: gsd==1.5.2 duecredit + DEBUG: "False" + MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin + OPENBLAS_64: https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win64.zip + APPVEYOR_SAVE_CACHE_ON_ERROR: true + APPVEYOR_SKIP_FINALIZE_ON_EXIT: true + TEST_TIMEOUT: 1000 + PYTHON: "C:\\conda" + MINICONDA_VERSION: "latest" + + matrix: + - PYTHON_VERSION: 3.6 + PYTHON_ARCH: 64 + MSVC_VERSION: "Visual Studio 10 Win64" + +init: + - ps: Write-Host ${env:PYTHON} ${env:PYTHON_VERSION} ${env:PYTHON_ARCH} + - ps: Write-Host ${env:APPVEYOR_SCHEDULED_BUILD} + # cancel build if newer one is submitted; complicated + # details for getting this to work are credited to JuliaLang + # developers + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + raise "There are newer queued builds for this pull request, skipping build." + } + +install: + # set up a conda env + - ps: git clone -q --depth 1 git://github.com/astropy/ci-helpers.git + - ps: ci-helpers/appveyor/install-miniconda.ps1 + - ps: $env:PATH = "${env:PYTHON};${env:PYTHON}\Scripts;" + $env:PATH + # deal with missing stdint.h as previously described + # see https://github.com/swistakm/pyimgui/blob/master/.appveyor.yml + - ps: cp "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h" "C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" + - ps: activate test + +build_script: + - cmd: cd package + - cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1 + +test_script: + - cmd: cd ..\testsuite + - cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1 + - cmd: cd MDAnalysisTests + - cmd: C:\conda\envs\test\Scripts\pytest.exe --cov=MDAnalysis --disable-pytest-warnings 3>&1 + - cmd: codecov + +after_build: + # cache cleanup + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete + # Show size of cache + - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache" diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 00000000000..18bae6d566d --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,2 @@ +service_name: travis-pro +repo_token: wTp3SXSqCNiZPb5xMojbKrADQXVgbrQFT \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8b600597796..65301cdd05b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,10 +6,10 @@ Thanks for contributing to MDAnalysis! If you've found a defect with MDAnalysis we'd love to know so we can fix it. Please follow the Issue template so we can quickly diagnose the problem, in particular the piece of code that causes the problem. -If your issue isn't a defect with the code and instead you require help using MDAnalysis, drop by the [discussion board](http://help.mdanalysis.org). +If your issue isn't a defect with the code and instead you require help using MDAnalysis, drop by the [discussion board](https://groups.google.com/forum/#!forum/mdnalysis-discussion). #### Contributing code If you're contributing code, please check out the [Style guide](https://github.com/MDAnalysis/mdanalysis/wiki/Style-Guide). -MDAnalysis devs are most easily reached through the [development board](http://developers.mdanalysis.org). +MDAnalysis devs are most easily reached through the [development board](https://groups.google.com/forum/#!forum/mdnalysis-devel). diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8d285c83339..67cbc79c5d2 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,3 +1,31 @@ + ### Expected behaviour @@ -17,3 +45,4 @@ u = mda.Universe(top, trj) ### Currently version of MDAnalysis: (run `python -c "import MDAnalysis as mda; print(mda.__version__)"`) + diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..318de99eb9e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +**Expected behavior** + +A clear and concise description of what you want to do and what you think should happen. (Code to reproduce the behavior can be added below). + + +**Actual behavior** + +What happened instead. Add as much detail as you can. Include (copy and paste) stack traces and any output. + + +**Code to reproduce the behavior** + +Show us how to reproduce the failiure. If you can, use trajectory files from the test data. + +``` python +import MDAnalysis as mda +from MDAnalysis.tests.datafiles import PSF, DCD, GRO, PDB, TPR, XTC, TRR, PRMncdf, NCDF + +u = mda.Universe(PSF, DCD) + +.... + +``` + +**Currently version of MDAnalysis** + +- Which version are you using? (run `python -c "import MDAnalysis as mda; print(mda.__version__)"`) +- Which version of Python (`python -V`)? +- Which operating system? diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..066b2d920a2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/questions.md b/.github/ISSUE_TEMPLATE/questions.md new file mode 100644 index 00000000000..d8d1762199b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/questions.md @@ -0,0 +1,24 @@ +--- +name: Questions +about: If you want to ask a question please use the mailing list! + +--- + +If you have a **QUESTION** such as + +- how to use MDAnalysis in general +- how to accomplish something specific, +- what output means +- ... or similar questions related to USING MDAnalysis + +then please *ask this question on the user mailing list* + + https://groups.google.com/forum/#!forum/mdnalysis-discussion + +The issue tracker is meant for DEFECTS ("BUGS"), new FEATURES, and decisions on the API. In order to keep the volume of work on the issue tracker manageable for our volunteer developers, we will IMMEDIATELY CLOSE ISSUES THAT ARE BETTER ANSWERED ON THE USER MAILINGLIST. + +We really appreciate you as a user getting in touch with us --- no matter what you want to discuss. But we need your help keeping the amount of work manageable so please use the mailing list for questions and the issue tracker for code-related issues. + +Thank you! + +The MDAnalysis Development Team diff --git a/.travis.yml b/.travis.yml index 1c218dfa44f..7f22990a3bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,14 +21,14 @@ env: # Set default python version to avoid repetition later - PYTHON_VERSION=3.5 - BUILD_DOCS=false - - COVERALLS=false + - CODECOV=false - PYTEST_FLAGS="--disable-pytest-warnings --numprocesses 2 --durations=50" - PYTEST_LIST="testsuite/MDAnalysisTests" - MAIN_CMD="pytest ${PYTEST_LIST}" - SETUP_CMD="${PYTEST_FLAGS}" - - BUILD_CMD="pip install -v package/ && pip install testsuite/" - - CONDA_MIN_DEPENDENCIES="mmtf-python mock six biopython networkx cython joblib matplotlib scipy griddataformats hypothesis gsd" - - CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn coveralls" + - BUILD_CMD="pip install -v package/ && (cd testsuite/ && python setup.py build)" + - CONDA_MIN_DEPENDENCIES="mmtf-python mock six biopython networkx cython joblib matplotlib scipy griddataformats hypothesis gsd codecov" + - CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn" - CONDA_CHANNELS='biobuilds conda-forge' - CONDA_CHANNEL_PRIORITY=True - PIP_DEPENDENCIES="duecredit" @@ -36,11 +36,11 @@ env: - INSTALL_HOLE="true" matrix: - # Run a coverage test - - COVERALLS="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - PYTHON_VERSION=3.6 - - PYTHON_VERSION=3.4 - - PYTHON_VERSION=2.7 + # Run a coverage test for most versions + - CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + - PYTHON_VERSION=3.6 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + - PYTHON_VERSION=3.4 NUMPY_VERSION=1.14 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + - PYTHON_VERSION=2.7 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - NUMPY_VERSION=1.10.4 - NUMPY_VERSION=dev EVENT_TYPE="cron" @@ -53,6 +53,7 @@ matrix: BUILD_DOCS=true BUILD_CMD="cd ${TRAVIS_BUILD_DIR}/package && python setup.py build_ext --inplace" INSTALL_HOLE="false" + PIP_DEPENDENCIES="${PIP_DEPENDENCIES} sphinx-sitemap" - env: NAME="Lint" PYLINTRC="${TRAVIS_BUILD_DIR}/package/.pylintrc" @@ -71,10 +72,10 @@ matrix: - env: NAME='minimal' CONDA_DEPENDENCIES=${CONDA_MIN_DEPENDENCIES} INSTALL_HOLE="false" + CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + allow_failures: - env: NUMPY_VERSION=dev EVENT_TYPE="cron" - - env: PYTHON_VERSION=3.4 - - os: osx before_install: # Workaround for Travis CI macOS bug (https://github.com/travis-ci/travis-ci/issues/6307) @@ -106,8 +107,8 @@ script: after_success: - | - if [[ $COVERALLS == 'true' ]]; then \ - coveralls; \ + if [[ $CODECOV == 'true' ]]; then \ + codecov; \ fi # can't use test here since this leads to travis fails even though the build passes - if [[ ${TRAVIS_PULL_REQUEST} == "false" ]] && [[ ${BUILD_DOCS} == "true" ]] && [[ ${TRAVIS_BRANCH} == ${GH_DOC_BRANCH} ]]; then diff --git a/README.rst b/README.rst index 069ec44afc1..9aff2028aea 100644 --- a/README.rst +++ b/README.rst @@ -102,17 +102,17 @@ to find uncovered code. :target: https://www.mdanalysis.org/mdanalysis/ .. |build| image:: https://travis-ci.org/MDAnalysis/mdanalysis.svg?branch=develop - :alt: Build Status - :target: https://travis-ci.org/MDAnalysis/mdanalysis + :alt: Build Status + :target: https://travis-ci.org/MDAnalysis/mdanalysis -.. |cov| image:: https://coveralls.io/repos/MDAnalysis/mdanalysis/badge.svg?branch=develop - :alt: Coverage Status - :target: https://coveralls.io/r/MDAnalysis/mdanalysis?branch=develop +.. |cov| image:: https://codecov.io/gh/MDAnalysis/mdanalysis/branch/develop/graph/badge.svg + :alt: Coverage Status + :target: https://codecov.io/gh/MDAnalysis/mdanalysis .. |anaconda| image:: https://anaconda.org/conda-forge/mdanalysis/badges/version.svg - :alt: Anaconda - :target: https://anaconda.org/conda-forge/mdanalysis + :alt: Anaconda + :target: https://anaconda.org/conda-forge/mdanalysis .. |mybinder| image:: https://mybinder.org/badge.svg - :alt: My Binder - :target: https://mybinder.org/v2/gh/MDAnalysis/binder-notebook/master + :alt: My Binder + :target: https://mybinder.org/v2/gh/MDAnalysis/binder-notebook/master diff --git a/benchmarks/benchmarks/GRO.py b/benchmarks/benchmarks/GRO.py index 9a2cdc37ae4..0b4c31bf7ca 100644 --- a/benchmarks/benchmarks/GRO.py +++ b/benchmarks/benchmarks/GRO.py @@ -2,12 +2,20 @@ import numpy as np from MDAnalysis.coordinates.GRO import GROReader +from MDAnalysis.topology.GROParser import GROParser from MDAnalysisTests.datafiles import GRO +import MDAnalysis as mda class GROReadBench(object): - - def time_read_GRO_file(self): - """Benchmark reading of standard test - suite GRO file. - """ + def time_read_GRO_coordinates(self): + """Benchmark reading of standard testsuite GRO file.""" GROReader(GRO) + + def time_parse_GRO_file(self): + """Time to create topology from GRO file""" + p = GROParser(GRO) + top = p.parse() + + def time_create_GRO_universe(self): + """Time to create MDA Universe of GRO""" + u = mda.Universe(GRO) diff --git a/benchmarks/benchmarks/ag_methods.py b/benchmarks/benchmarks/ag_methods.py index 410ec5419ac..d6edc8ec27d 100644 --- a/benchmarks/benchmarks/ag_methods.py +++ b/benchmarks/benchmarks/ag_methods.py @@ -4,7 +4,7 @@ import numpy as np try: - from MDAnalysisTests.datafiles import GRO + from MDAnalysisTests.datafiles import GRO, TPR, XTC from MDAnalysis.exceptions import NoDataError except: pass @@ -24,8 +24,11 @@ def setup(self, num_atoms): self.u = MDAnalysis.Universe(GRO) self.ag = self.u.atoms[:num_atoms] self.weights = np.ones(num_atoms) - self.vdwradii = {'NA':1.0, - 'M':1.0} + self.vdwradii = {'H':1.0, + 'C':1.0, + 'N':1.0, + 'O':1.0, + 'DUMMY':1.0} self.rot_matrix = np.ones((3,3)) self.trans = np.ones((4,4)) @@ -319,3 +322,17 @@ def time_bond(self, num_atoms): Requires ag of size 2. """ self.ag[:2].bond + + +class FragmentFinding(object): + """Test how quickly we find fragments (distinct molecules from bonds)""" + params = [(TPR, XTC), # single large fragment, many small solvents + (PSF, DCD), # single large fragment + (TRZ_psf, TRZ)] # 20ish polymer chains + param_names = ['universe'] + + def setup(self, universe): + self.u = MDAnalysis.Universe(*universe) + + def test_find_fragments(self, universe): + frags = self.u.atoms.fragments diff --git a/benchmarks/benchmarks/analysis/rdf.py b/benchmarks/benchmarks/analysis/rdf.py index 7be6ad35789..a91c12eb139 100644 --- a/benchmarks/benchmarks/analysis/rdf.py +++ b/benchmarks/benchmarks/analysis/rdf.py @@ -17,21 +17,23 @@ class SimpleRdfBench(object): """ params = ([20,75,200], - [[0,5], [0,15], [0,20]]) + [[0,5], [0,15], [0,20]], + [1, 100, 1000, 10000]) param_names = ['nbins', - 'range_val'] + 'range_val', + 'natoms'] - def setup(self, nbins, range_val): + def setup(self, nbins, range_val, natoms): self.sel_str = 'name OW' self.u = MDAnalysis.Universe(TPR, XTC) try: - self.sel = self.u.select_atoms(self.sel_str)[:200] + self.sel = self.u.select_atoms(self.sel_str)[:natoms] except AttributeError: - self.sel = self.u.selectAtoms(self.sel_str)[:200] + self.sel = self.u.selectAtoms(self.sel_str)[:natoms] # do not include initialization of the # InterRDF object in the benchmark itself diff --git a/benchmarks/benchmarks/analysis/rms.py b/benchmarks/benchmarks/analysis/rms.py index 882eaafcef8..c9811a5984d 100644 --- a/benchmarks/benchmarks/analysis/rms.py +++ b/benchmarks/benchmarks/analysis/rms.py @@ -96,13 +96,10 @@ def setup(self, n_atoms, step, weights): self.u = MDAnalysis.Universe(PSF, DCD) self.ag = self.u.atoms[:n_atoms] self.RMSF_inst = rms.RMSF(atomgroup=self.ag, - start=None, - stop=None, - step=step, weights=weights) def time_RMSF(self, n_atoms, step, weights): """Benchmark RMSF.run() method, which parses over the entire trajectory. """ - self.RMSF_inst.run() + self.RMSF_inst.run(step=step) diff --git a/benchmarks/benchmarks/import.py b/benchmarks/benchmarks/import.py new file mode 100644 index 00000000000..d1ca3cb43bd --- /dev/null +++ b/benchmarks/benchmarks/import.py @@ -0,0 +1,6 @@ +class ImportBench(object): + def time_import(self): + """Benchmark time needed to import MDAnalysis + """ + import MDAnalysis as mda + pass diff --git a/benchmarks/benchmarks/topology.py b/benchmarks/benchmarks/topology.py new file mode 100644 index 00000000000..c45e6b380a5 --- /dev/null +++ b/benchmarks/benchmarks/topology.py @@ -0,0 +1,32 @@ +import MDAnalysis +import numpy as np +from MDAnalysis.topology import guessers + +try: + from MDAnalysisTests.datafiles import GRO + from MDAnalysis.exceptions import NoDataError +except: + pass + +class TopologyGuessBench(object): + """Benchmarks for individual + topology functions + """ + params = (10, 100, 1000, 10000) + param_names = ['num_atoms'] + + def setup(self, num_atoms): + self.u = MDAnalysis.Universe(GRO) + self.ag = self.u.atoms[:num_atoms] + self.vdwradii = {'H':1.0, + 'C':1.0, + 'N':1.0, + 'O':1.0, + 'DUMMY':1.0} + + def time_guessbonds(self, num_atoms): + """Benchmark for guessing bonds""" + guessers.guess_bonds(self.ag, self.ag.positions, + box=self.ag.dimensions, + vdwradii=self.vdwradii) + diff --git a/maintainer/adapt_sitemap.py b/maintainer/adapt_sitemap.py new file mode 100755 index 00000000000..593b4c4cf4b --- /dev/null +++ b/maintainer/adapt_sitemap.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# +# +# Adjust path in sitemap.xml + +from __future__ import print_function + +from xml.etree import ElementTree +import argparse + +# defaults for MDAnalysis, see https://github.com/MDAnalysis/mdanalysis/pull/1890 +# and https://github.com/MDAnalysis/MDAnalysis.github.io/issues/78 + +RELEASE_URL = "https://www.mdanalysis.org/docs/" +DEVELOP_URL = "https://www.mdanalysis.org/mdanalysis/" + +# change if sitemaps.org updates their schema +NAMESPACE = {"sitemaps": "http://www.sitemaps.org/schemas/sitemap/0.9"} + +def replace_loc(tree, search, replace, namespace=NAMESPACE): + root = tree.getroot() + urls = root.findall("sitemaps:url", namespace) + if len(urls) == 0: + raise ValueError("No sitemaps:url element found: check if the namespace in the XML file " + "is still xmlns='{0[sitemaps]}'".format(namespace)) + for url in urls: + loc = url.find("sitemaps:loc", namespace) + try: + loc.text = loc.text.replace(search, replace) + except AttributError: + raise ValueError("No sitemaps:loc element found: check if the namespace in the XML file " + "is still xmlns='{0[sitemaps]}'".format(namespace)) + return tree + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Change top level loc in sitemap.', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + + parser.add_argument('sitemap', metavar="FILE", + help="path to sitemap.xml file, will be changed in place") + parser.add_argument('--output', '-o', metavar="FILE", + default="sitemap_release.xml", + help="write altered XML to output FILE") + parser.add_argument("--search", "-s", metavar="URL", + default=DEVELOP_URL, + help="search this URL in the loc elements") + parser.add_argument("--replace", "-r", metavar="URL", + default=RELEASE_URL, + help="replace the searched URL with this URL in the loc elements") + args = parser.parse_args() + + + with open(args.sitemap) as xmlfile: + tree = ElementTree.parse(xmlfile) + + tree = replace_loc(tree, args.search, args.replace) + + with open(args.output, "wb") as xmlfile: + tree.write(xmlfile, encoding="utf-8", xml_declaration=True, + default_namespace=NAMESPACE['sitemaps']) + + print("adapt_sitemap.py: Created output file {} with change in loc:".format(args.output)) + print("adapt_sitemap.py: {0} --> {1}".format(args.search, args.replace)) diff --git a/maintainer/conda/MDAnalysis/meta.yaml b/maintainer/conda/MDAnalysis/meta.yaml index c328c541d63..18921993190 100644 --- a/maintainer/conda/MDAnalysis/meta.yaml +++ b/maintainer/conda/MDAnalysis/meta.yaml @@ -1,12 +1,12 @@ package: name: mdanalysis # This has to be changed after a release - version: "0.18.0" + version: "0.19.0" source: git_url: https://github.com/MDAnalysis/mdanalysis # git_branch: develop - git_tag: release-0.17.0 + git_tag: release-0.19.0 # specify the subversion of the conda package. Defaults to 0. If you make # changes to the conda package alone with out an increase in the source package diff --git a/maintainer/deploy_master_docs.sh b/maintainer/deploy_master_docs.sh index 39123162698..2c9d5b8e03a 100755 --- a/maintainer/deploy_master_docs.sh +++ b/maintainer/deploy_master_docs.sh @@ -25,6 +25,14 @@ # (cd package && python setup.py build_sphinx) # +# The release sitemap.xml is generated from the development +# sitemap.xml by changing MDA_DEVELOPMENT_DOCS_URL --> MDA_RELEASE_DOCS_URL +# +# See comment in package/doc/sphinx/source/conf.py for site_url. +# +MDA_RELEASE_DOCS_URL="https://www.mdanalysis.org/docs/" +MDA_DEVELOPMENT_DOCS_URL="https://www.mdanalysis.org/mdanalysis/" + GH_REPOSITORY=github.com/MDAnalysis/docs.git #MDA_DOCDIR=${TRAVIS_BUILD_DIR}/package/doc/html/html MDA_DOCDIR=package/doc/html/html @@ -44,6 +52,9 @@ function die () { } rev=$(git rev-parse --short HEAD) +rootdir="$(git rev-parse --show-toplevel)" + +maintainer_dir="${rootdir}/maintainer" # the following tests should be superfluous because of -o nounset test -n "${GH_TOKEN}" || die "GH_TOKEN is empty: need OAuth GitHub token to continue" 100 @@ -60,7 +71,7 @@ git config user.name "${GIT_CI_USER}" git config user.email "${GIT_CI_EMAIL}" git remote add docs "https://${GH_TOKEN}@${GH_REPOSITORY}" -git fetch --depth 50 docs master +git fetch --depth 10 docs master git reset docs/master touch . @@ -68,6 +79,13 @@ touch .nojekyll git add -A . git commit -m "rebuilt html docs from branch ${GH_DOC_BRANCH} with sphinx at MDAnalysis/mdanalysis@${rev}" + +# fix sitemap.xml for release docs +${maintainer_dir}/adapt_sitemap.py --search ${MDA_DEVELOPMENT_DOCS_URL} --replace ${MDA_RELEASE_DOCS_URL} -o sitemap.xml sitemap.xml + +git add sitemap.xml +git commit -m "adjusted sitemap.xml for release docs at ${MDA_RELEASE_DOCS_URL}" + git push -q docs HEAD:master diff --git a/package/.pylintrc b/package/.pylintrc index ab966147016..da780ce8ac3 100644 --- a/package/.pylintrc +++ b/package/.pylintrc @@ -200,7 +200,6 @@ enable=abstract-class-instantiated, xrange-builtin, zip-builtin-not-iterating, map-builtin-not-iterating, - range-builtin-not-iterating, # Things we'd like to try. # Procedure: diff --git a/package/AUTHORS b/package/AUTHORS index 0a05e9c163a..3214839a3c9 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -98,10 +98,16 @@ Chronological list of authors 2018 - Nabarun Pal - Mateusz Bieniek + - Paul Smith - Navya Khare - Johannes Zeman - Ayush Suhane - Davide Cruz + - Shujie Fan + - Andrew R. McCluskey + - Henry Mull + - Irfan Alibay + External code ------------- diff --git a/package/CHANGELOG b/package/CHANGELOG index 9ea9082392e..725694789b6 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -13,6 +13,149 @@ The rules for this file: * release numbers follow "Semantic Versioning" http://semver.org ------------------------------------------------------------------------------ +10/09/18 tylerjereddy, richardjgowers, palnabarun, orbeckst, kain88-de, zemanj, + VOD555, davidercruz, jbarnoud, ayushsuhane, hfmull, micaela-matta, + sebastien.buchoux, arm61, p-j-smith, IAlibay + + * 0.19.0 + +Enhancements + * Added bond/angle/dihedral reading in PARM7 TOPParser (PR #2052) + * Replaced multiple apply (_apply_distmat, _apply_kdtree) + methods in distance based selections with + lib.distances.capped_distance for automatic selection of + distance evaluation method. (PR #2035) + * Modified analysis.rdf.InterRDF to use lib.distances.capped_distance + to handle rdf calculations for large systems. (PR #2013) + * Added return_distances argument in lib.distances.capped_distances + to evaluate and return distances only when required. Modified + the optimization rules in lib.distances._determine_method for + faster computations. (PR #2041) + * Added method search_tree in lib.pkdtree to find all the pairs between + two kdtrees. (PR #2041) + * Added a wrapper of lib.nsgrid in lib.distances.self_capped_distance + and lib.distances.capped_distanceto automatically chose the fastest + method for distance based calculations. (PR #2008) + * Added Grid search functionality in lib.nsgrid for faster distance based + calculations. (PR #2008) + * Modified around selections to work with KDTree and periodic boundary + conditions. Should reduce memory usage (#974 PR #2022) + * Modified topology.guessers.guess_bonds to automatically select the + fastest method for guessing bonds using + lib.distance.self_capped_distance (PR # 2006) + * Added lib.distances.self_capped_distance to internally select the + optimized method for distance evaluations of coordinates with itself. (PR # 2006) + * Added augment functionality to create relevant images of particles + in the vicinity of central cell to handle periodic boundary + conditions (PR #1977) + * Added lib.distances.capped_distance function to quickly calculate all distances + up to a given maximum distance (PR #1941) + * Added a rotation coordinate transformation (PR #1937) + * Added a box centering trajectory transformation (PR #1946) + * Added a on-the-fly trajectory transformations API and a coordinate translation + function (Issue #786) + * Added various duecredit stubs + * Import time reduced by a factor two (PR #1881) + * Added compound kwarg to center, centroid, center_of_geometry, center_of_mass (PR #1903) + * Added rdf.InterRDF_s to calculate site-specific pair distribution + functions (PR #1815) + * Increased performance of (repeated) calls to AtomGroup.pack_into_box() + (PR #1922) + * Added boolean property *Group.isunique (PR #1922) + * Added *Group.copy() methods returning an identical copy of the respective + group (PR #1922) + * Use a faster function to deduplicate indices (PR #1951) + * Calculations in *Group.center() are performed in double precision (#PR1936) + * Functions in lib.distances accept coordinate arrays of arbitrary dtype + (PR #1936) + * Added pbc kwarg to Bond/Angle/Dihedral/Improper object value method, + default True. (Issue #1938) + * ChainReader can correctly handle continuous trajectories split into multiple files, + generated with gromacs -noappend (PR #1728) + * MDAnalysis.lib.mdamath now supports triclinic boxes and rewrote in Cython (PR #1965) + * AtomGroup.write can write a trajectory of selected frames (Issue #1037) + * Added dihedrals.py with Dihedral, Ramachandran, and Janin classes to + analysis module (PR #1997, PR #2033) + * Added the analysis.data module for reference data used in analysis (PR #2033) + * Added analysis.dihedrals with Ramachandran class to analysis module (PR #1997) + * Added augment functionality to create relevant images of particles + * Most functions in `MDanalysis.lib.distances` previously only accepting + arrays of coordinates now also accept single coordinates as input (PR #2048, + Issues #1262 #1938) + * Performance improvements to make_whole (PR #1965) + * Performance improvements to fragment finding (PR #2028) + * Added user-defined boxes in density code (PR #2005) + * MemoryReader now can accept velocities and forces (PR #2080) + * Universe.transfer_to_memory now copies dimensions, velocities and forces + (where possible) (Issue #1041 PR #2080) + +Fixes + * Rewind in the SingleFrameReader now reads the frame from the file (Issue #1929) + * Fixed order of indices in Angle/Dihedral/Improper repr + * coordinates.memory.MemoryReader now takes np.ndarray only (Issue #1685) + * Silenced warning when duecredit is not installed (Issue #1872) + * Fixed HBondAnalysis not considering PBC for distances (Issue #1878) + * Adding new TopologyAttrs with values defined always coerces this into + a numpy array (Issue #1876) + * Groups passed to select_atoms() are now type checked (Issue #1852) + * Fixed inconsistent handling of groups with/without duplicates in + pack_into_box() (Issue #1911) + * Fixed format of MODEL number in PDB file writing (Issue #1950) + * PDBWriter now properly sets start value + * Introduced compatibility for pbd files hybrid36 format encoding (Issue #1897) + * Zero length TopologyGroup now return proper shape array via to_indices + (Issue #1974) + * Added periodic boundary box support to the Tinker file reader (Issue #2001) + * Modifying coordinates by assignation is consistently persistent when using + the memory reader (Issue #2018) + * Allow import of WaterBridgeAnalysis from analysis.hbonds (#2064) + * Fixed SphericalLayer and SphericalZone selections with pbc=True. Previously + these shifted all atoms to inside the primary unit cell when calculating the + center of the reference group (Issue #1795) + * PCA analysis now uses start frame as reference frame rather than 0th frame + (PR #2055) + * Fixed trajectory iteration from a MDAnalysis.Universe.empty (#2076) + * Fixed copies MemoryReader not linking to the underlying coordinate array + on initial Timestep (Issue #2081 PR #2080) + +Changes + * TopologyAttrs are now statically typed (Issue #1876) + * updated meta data for new PyPi (#1837) + * AtomGroup.atoms, ResidueGroup.residues, and SegmentGroup.segments now return + themselves instead of a new object to increase performance (PR #1922) + * *Group.unique now returns a new object only if the respective group contains + duplicates. Otherwise, the group itself is returned. Repeated access of + *Group.unique will always return the same object unless the group is + updated or modified. (PR #1922) + * SurvivalProbability does not dilute SP anymore when the reference frame (t0) + cannot find any molecules in the first place. (PR #1995) + * The TPR parser reads SETTLE constraints as bonds. (Issue #1949) + * Indexing a trajectory with a slice or an array now returns an iterable + (Issue #1894) + * Removed unused function MDAnalysis.lb.mdamath.one_to_many_pointers() + (issue #2010) + * Box input for functions in `MDAnalysis.lib.distances` is now consistently + enforced to be of the form ``[lx, ly, lz, alpha, beta, gamma]`` as required + by the docs (Issue #2046, PR #2048) + * Added periodic keyword to select_atoms (#759) + * PCA.transform now requires that PCA.run() has already been called + otherwise a ValueError is raised (PR #2055) + * The quiet keyword has been removed and replaced with verbose (Issue #1975 + PR #2055) + * MDAnalysis.Universe.empty now creates a MemoryReader trajectory (#2076 #2077) + +Deprecations + * start/stop/step are deprecated in the initialization of Analysis classes. + These parameters should instead be given to the run() method of the class. + (Issue #1463 #1979 PR #2055) + * Almost all "save()", "save_results()", "save_table()" methods in + analysis classes were deprecated and will be removed in 1.0 (Issue + #1972 and #1745) + * Deprecated use of core.flags. For use_pbc, the pbc keyword should + be used, use_KDTree_routines is obsolete as all distance calculations + select the fastest method, all other uses of flags are deprecated. + (#782) + 04/15/18 tylerjereddy, richardjgowers, palnabarun, bieniekmateusz, kain88-de, orbeckst, xiki-tempula, navyakhare, zemanj, ayushsuhane, davidercruz, jbarnoud diff --git a/package/MDAnalysis/__init__.py b/package/MDAnalysis/__init__.py index ca51bcc9584..fadd6d97ded 100644 --- a/package/MDAnalysis/__init__.py +++ b/package/MDAnalysis/__init__.py @@ -220,18 +220,10 @@ "note={Austin, TX, SciPy.} " "}" )), - description= - "Description of recent updates and new functionality " - "in MDAnalysis since release 0.7.2 (March 2011) up to " - "release 0.16.0 (April 2017). Please cite together with " - "Michaud-Agrawal et al 2011. ", - path="MDAnalysis/", cite_module=True) + description="Molecular simulation analysis library", + path="MDAnalysis", cite_module=True) due.cite(Doi("10.1002/jcc.21787"), - description= - "Description of MDAnalysis up to release 0.7.2 (March 2011), " - "including the basic philosophy of the library and the " - "LeafletFinder algorithm. Please cite together with " - "Gowers et al 2016. ", - path="MDAnalysis/", cite_module=True) + description="Molecular simulation analysis library", + path="MDAnalysis", cite_module=True) del Doi, BibTeX diff --git a/package/MDAnalysis/analysis/__init__.py b/package/MDAnalysis/analysis/__init__.py index 929568cec0f..9fcfb17e476 100644 --- a/package/MDAnalysis/analysis/__init__.py +++ b/package/MDAnalysis/analysis/__init__.py @@ -124,6 +124,7 @@ 'polymer', 'psa', 'rdf', + 'rdf_s', 'rms', 'waterdynamics', ] diff --git a/package/MDAnalysis/analysis/align.py b/package/MDAnalysis/analysis/align.py index 6c3dbccf195..09fa2e3497c 100644 --- a/package/MDAnalysis/analysis/align.py +++ b/package/MDAnalysis/analysis/align.py @@ -204,7 +204,7 @@ from MDAnalysis.exceptions import SelectionError, SelectionWarning import MDAnalysis.analysis.rms as rms from MDAnalysis.coordinates.memory import MemoryReader -from MDAnalysis.lib.util import get_weights +from MDAnalysis.lib.util import get_weights, deprecate from .base import AnalysisBase @@ -679,7 +679,10 @@ def _conclude(self): if not self._verbose: logging.disable(logging.NOTSET) + @deprecate(release="0.19.0", remove="1.0") def save(self, rmsdfile): + """save rmsd as a numpy array + """ # these are the values of the new rmsd between the aligned trajectory # and reference structure np.savetxt(rmsdfile, self.rmsd) diff --git a/package/MDAnalysis/analysis/base.py b/package/MDAnalysis/analysis/base.py index ddf45904029..0d41b1dc2c9 100644 --- a/package/MDAnalysis/analysis/base.py +++ b/package/MDAnalysis/analysis/base.py @@ -32,11 +32,12 @@ from six.moves import range, zip import inspect import logging +import warnings import numpy as np from MDAnalysis import coordinates from MDAnalysis.core.groups import AtomGroup -from MDAnalysis.lib.log import ProgressMeter, _set_verbose +from MDAnalysis.lib.log import ProgressMeter logger = logging.getLogger(__name__) @@ -84,30 +85,34 @@ def _conclude(self): .. code-block:: python - na = NewAnalysis(u.select_atoms('name CA'), 35).run() + na = NewAnalysis(u.select_atoms('name CA'), 35).run(start=10, stop=20) print(na.result) """ - def __init__(self, trajectory, start=None, - stop=None, step=None, verbose=None, quiet=None): + def __init__(self, trajectory, verbose=False, **kwargs): """ Parameters ---------- trajectory : mda.Reader A trajectory Reader - start : int, optional - start frame of analysis - stop : int, optional - stop frame of analysis - step : int, optional - number of frames to skip between each analysed frame verbose : bool, optional - Turn on verbosity + Turn on more logging and debugging, default ``False`` """ - self._verbose = _set_verbose(verbose, quiet, default=False) - self._quiet = not self._verbose - self._setup_frames(trajectory, start, stop, step) + self._trajectory = trajectory + self._verbose = verbose + # do deprecated kwargs + # remove in 1.0 + deps = [] + for arg in ['start', 'stop', 'step']: + if arg in kwargs and not kwargs[arg] is None: + deps.append(arg) + setattr(self, arg, kwargs[arg]) + if deps: + warnings.warn('Setting the following kwargs should be ' + 'done in the run() method: {}'.format( + ', '.join(deps)), + DeprecationWarning) def _setup_frames(self, trajectory, start=None, stop=None, step=None): """ @@ -126,6 +131,11 @@ def _setup_frames(self, trajectory, start=None, stop=None, step=None): number of frames to skip between each analysed frame """ self._trajectory = trajectory + # TODO: Remove once start/stop/step are deprecated from init + # See if these have been set as class attributes, and use that + start = getattr(self, 'start', start) + stop = getattr(self, 'stop', stop) + step = getattr(self, 'step', step) start, stop, step = trajectory.check_slice_indices(start, stop, step) self.start = start self.stop = stop @@ -135,21 +145,9 @@ def _setup_frames(self, trajectory, start=None, stop=None, step=None): if interval == 0: interval = 1 - # ensure _verbose is set when __init__ wasn't called, this is to not - # break pre 0.16.0 API usage of AnalysisBase - if not hasattr(self, '_verbose'): - if hasattr(self, '_quiet'): - # Here, we are in the odd case where a children class defined - # self._quiet without going through AnalysisBase.__init__. - warnings.warn("The *_quiet* attribute of analyses is " - "deprecated (from 0.16)use *_verbose* instead.", - DeprecationWarning) - self._verbose = not self._quiet - else: - self._verbose = True - self._quiet = not self._verbose + verbose = getattr(self, '_verbose', False) self._pm = ProgressMeter(self.n_frames if self.n_frames else 1, - interval=interval, verbose=self._verbose) + interval=interval, verbose=verbose) def _single_frame(self): """Calculate data from a single frame of trajectory @@ -169,8 +167,25 @@ def _conclude(self): """ pass - def run(self): - """Perform the calculation""" + def run(self, start=None, stop=None, step=None, verbose=None): + """Perform the calculation + + Parameters + ---------- + start : int, optional + start frame of analysis + stop : int, optional + stop frame of analysis + step : int, optional + number of frames to skip between each analysed frame + verbose : bool, optional + Turn on verbosity + """ + logger.info("Choosing frames to analyze") + # if verbose unchanged, use class default + verbose = getattr(self, '_verbose', False) if verbose is None else verbose + + self._setup_frames(self._trajectory, start, stop, step) logger.info("Starting preparation") self._prepare() for i, ts in enumerate( @@ -241,10 +256,15 @@ def __init__(self, function, trajectory=None, *args, **kwargs): self.function = function self.args = args - base_kwargs, self.kwargs = _filter_baseanalysis_kwargs(self.function, - kwargs) - super(AnalysisFromFunction, self).__init__(trajectory, **base_kwargs) + # TODO: Remove in 1.0 + my_kwargs = {} + for depped_arg in ['start', 'stop', 'step']: + if depped_arg in kwargs: + my_kwargs[depped_arg] = kwargs.pop(depped_arg) + self.kwargs = kwargs + + super(AnalysisFromFunction, self).__init__(trajectory, **my_kwargs) def _prepare(self): self.results = [] @@ -272,7 +292,7 @@ def analysis_class(function): >>> def RotationMatrix(mobile, ref): >>> return mda.analysis.align.rotation_matrix(mobile, ref)[0] - >>> rot = RotationMatrix(u.trajectory, mobile, ref, step=2).run() + >>> rot = RotationMatrix(u.trajectory, mobile, ref).run(step=2) >>> print(rot.results) """ diff --git a/package/MDAnalysis/analysis/contacts.py b/package/MDAnalysis/analysis/contacts.py index 6b2370f8add..66f8d0470ff 100644 --- a/package/MDAnalysis/analysis/contacts.py +++ b/package/MDAnalysis/analysis/contacts.py @@ -208,13 +208,12 @@ def is_any_closer(r, r0, dist=2.5): import bz2 import numpy as np -from numpy.lib.utils import deprecate import logging import MDAnalysis import MDAnalysis.lib.distances -from MDAnalysis.lib.util import openany +from MDAnalysis.lib.util import openany, deprecate from MDAnalysis.analysis.distances import distance_array from MDAnalysis.core.groups import AtomGroup from .base import AnalysisBase @@ -389,14 +388,6 @@ def __init__(self, u, selection, refgroup, method="hard_cut", radius=4.5, kwargs : dict, optional dictionary of additional kwargs passed to `method`. Check respective functions for reasonable values. - start : int, optional - First frame of trajectory to analyse, Default: None becomes 0. - stop : int, optional - Frame index to stop analysis. Default: None becomes - n_frames. Iteration stops *before* this frame number, - which means that the trajectory would be read until the end. - step : int, optional - Step between frames to analyse, Default: None becomes 1. verbose : bool (optional) Show detailed progress of the calculation if set to ``True``; the default is ``False``. @@ -454,6 +445,7 @@ def _single_frame(self): def _conclude(self): self.timeseries = np.array(self.timeseries, dtype=float) + @deprecate(release="0.19.0", remove="1.0.0") def save(self, outfile): """save contacts timeseries @@ -510,4 +502,3 @@ def q1q2(u, selection='all', radius=4.5, radius=radius, method=radius_cut_q, start=start, stop=stop, step=step, kwargs={'radius': radius}) - diff --git a/testsuite/__init__.py b/package/MDAnalysis/analysis/data/__init__.py similarity index 100% rename from testsuite/__init__.py rename to package/MDAnalysis/analysis/data/__init__.py diff --git a/package/MDAnalysis/analysis/data/filenames.py b/package/MDAnalysis/analysis/data/filenames.py new file mode 100644 index 00000000000..795ca9db37c --- /dev/null +++ b/package/MDAnalysis/analysis/data/filenames.py @@ -0,0 +1,85 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +"""Analysis data files +=================== + +:mod:`MDAnalysis.analysis.data` contains data files that are used as part of +analysis. These can be experimental or theoretical data. Files are stored +inside the package and made accessible via variables in +:mod:`MDAnalysis.analysis.data.filenames`. These variables are documented +below, including references to the literature and where they are used +inside :mod:`MDAnalysis.analysis`. + +Data files +---------- + +.. data:: Rama_ref + + Reference Ramachandran histogram for :class:`MDAnalysis.analysis.dihedrals.Ramachandran`. + The data were calculated on a data set of 500 PDB structures taken from [Lovell2003]_. + This is a numpy array in the :math:`\phi` and :math:`psi` backbone dihedral angles. + + Load and plot it with :: + + import numpy as np + import matplotlib.pyplot as plt + from MDAnalysis.analysis.data.filenames import Rama_ref + X, Y = np.meshgrid(np.arange(-180, 180, 4), np.arange(-180, 180, 4)) + Z = np.load(Rama_ref) + ax.contourf(X, Y, Z, levels=[1, 17, 15000]) + + The given levels will draw contours that contain 90% and 99% of the data + points. See the :ref:`Ramachandran plot figure ` as an + example. + +.. data:: Janin_ref + + Reference Janin histogram for :class:`MDAnalysis.analysis.dihedrals.Janin`. + The data were calculated on a data set of 500 PDB structures taken from [Lovell2003]_. + This is a numpy array in the :math:`\chi_1` and :math:`chi_2` sidechain dihedral angles. + + Load and plot it with :: + + import numpy as np + import matplotlib.pyplot as plt + from MDAnalysis.analysis.data.filenames import Janin_ref + X, Y = np.meshgrid(np.arange(-180, 180, 4), np.arange(-180, 180, 4)) + Z = np.load(Janin_ref) + ax.contourf(X, Y, Z, levels=[1, 6, 600]) + + The given levels will draw contours that contain 90% and 98% of the + data. See the :ref:`Janin plot figure ` as an example. + +""" +from __future__ import absolute_import + +__all__ = [ + "Rama_ref", "Janin_ref" # reference plots for Ramachandran and Janin classes +] + +from pkg_resources import resource_filename + +Rama_ref = resource_filename(__name__, 'rama_ref_data.npy') +Janin_ref = resource_filename(__name__, 'janin_ref_data.npy') + +# This should be the last line: clean up namespace +del resource_filename diff --git a/package/MDAnalysis/analysis/data/janin_ref_data.npy b/package/MDAnalysis/analysis/data/janin_ref_data.npy new file mode 100644 index 00000000000..ea55d2a48f5 Binary files /dev/null and b/package/MDAnalysis/analysis/data/janin_ref_data.npy differ diff --git a/package/MDAnalysis/analysis/data/rama_ref_data.npy b/package/MDAnalysis/analysis/data/rama_ref_data.npy new file mode 100644 index 00000000000..f1ef85f1aec Binary files /dev/null and b/package/MDAnalysis/analysis/data/rama_ref_data.npy differ diff --git a/package/MDAnalysis/analysis/density.py b/package/MDAnalysis/analysis/density.py index 80c17c912e3..e384e6b4b38 100644 --- a/package/MDAnalysis/analysis/density.py +++ b/package/MDAnalysis/analysis/density.py @@ -184,7 +184,6 @@ logger = logging.getLogger("MDAnalysis.analysis.density") - class Density(Grid): r"""Class representing a density on a regular cartesian grid. @@ -278,7 +277,6 @@ class Density(Grid): -------- gridData.core.Grid : the base class of :class:`Density`. - Examples -------- Typical use: @@ -497,12 +495,66 @@ def __repr__(self): grid_type = 'histogram' return '' + +def _set_user_grid(gridcenter, xdim, ydim, zdim, smin, smax): + """Helper function to set the grid dimensions to user defined values + + Parameters + ---------- + gridcenter : numpy ndarray, float32 + 3 element ndarray containing the x, y and z coordinates of the grid + box center + xdim : float + Box edge length in the x dimension + ydim : float + Box edge length in the y dimension + zdim : float + Box edge length in the y dimension + smin : numpy ndarray, float32 + Minimum x,y,z coordinates for the input selection + smax : numpy ndarray, float32 + Maximum x,y,z coordinates for the input selection + + Returns + ------- + umin : numpy ndarray, float32 + Minimum x,y,z coordinates of the user defined grid + umax : numpy ndarray, float32 + Maximum x,y,z coordinates of the user defined grid + """ + # Check user inputs + try: + gridcenter = np.asarray(gridcenter, dtype=np.float32) + except ValueError: + raise ValueError("Non-number values assigned to gridcenter") + if gridcenter.shape != (3,): + raise ValueError("gridcenter must be a 3D coordinate") + try: + xyzdim = np.array([xdim, ydim, zdim], dtype=np.float32) + except ValueError: + raise ValueError("xdim, ydim, and zdim must be numbers") + + # Set min/max by shifting by half the edge length of each dimension + umin = gridcenter - xyzdim/2 + umax = gridcenter + xyzdim/2 + + # Here we test if coords of selection fall outside of the defined grid + # if this happens, we warn users they may want to resize their grids + if any(smin < umin) or any(smax > umax): + msg = ("Atom selection does not fit grid --- " + "you may want to define a larger box") + warnings.warn(msg) + logger.warning(msg) + return umin, umax + + def density_from_Universe(universe, delta=1.0, atomselection='name OH2', start=None, stop=None, step=None, metadata=None, padding=2.0, cutoff=0, soluteselection=None, use_kdtree=True, update_selection=False, - verbose=None, interval=1, quiet=None, - parameters=None): + verbose=False, interval=1, quiet=None, + parameters=None, + gridcenter=None, xdim=None, ydim=None, zdim=None): """Create a density grid from a :class:`MDAnalysis.Universe` object. The trajectory is read, frame by frame, and the atoms selected with `atomselection` are @@ -527,7 +579,7 @@ def density_from_Universe(universe, delta=1.0, atomselection='name OH2', are passed through as they are. padding : float (optional) increase histogram dimensions by padding (on top of initial box size) - in Angstroem [2.0] + in Angstroem. Padding is ignored when setting a user defined grid. [2.0] soluteselection : str (optional) MDAnalysis selection for the solute, e.g. "protein" [``None``] cutoff : float (optional) @@ -550,6 +602,18 @@ def density_from_Universe(universe, delta=1.0, atomselection='name OH2', Show status update every `interval` frame [1] parameters : dict (optional) `dict` with some special parameters for :class:`Density` (see docs) + gridcenter : numpy ndarray, float32 (optional) + 3 element numpy array detailing the x, y and z coordinates of the + center of a user defined grid box in Angstroem [``None``] + xdim : float (optional) + User defined x dimension box edge in ångström; ignored if + gridcenter is ``None`` + ydim : float (optional) + User defined y dimension box edge in ångström; ignored if + gridcenter is ``None`` + zdim : float (optional) + User defined z dimension box edge in ångström; ignored if + gridcenter is ``None`` Returns ------- @@ -595,6 +659,32 @@ def density_from_Universe(universe, delta=1.0, atomselection='name OH2', (Using the special case for the bulk with `soluteselection` and `cutoff` improves performance over the simple `update_selection` approach.) + If you are interested in explicitly setting a grid box of a given edge size + and origin, you can use the gridcenter and x/y/zdim arguments. For example + to plot the density of waters within 5 Å of a ligand (in this case the + ligand has been assigned the residue name "LIG") in a cubic grid with 20 Å + edges which is centered on the centre of mass (COM) of the ligand:: + + # Create a selection based on the ligand + ligand_selection = universe.select_atoms("resname LIG") + + # Extract the COM of the ligand + ligand_COM = ligand_selection.center_of_mass() + + # Generate a density of waters on a cubic grid centered on the ligand COM + # In this case, we update the atom selection as shown above. + water_density = density_from_Universe(universe, delta=1.0, + atomselection='name OW around 5 resname LIG', + update_selection=True, + gridcenter=ligand_COM, + xdim=20.0, ydim=20.0, zdim=20.0) + + (It should be noted that the `padding` keyword is not used when a user + defined grid is assigned). + + .. versionchanged:: 0.19.0 + *gridcenter*, *xdim*, *ydim* and *zdim* keywords added to allow for user + defined boxes .. versionchanged:: 0.13.0 *update_selection* and *quiet* keywords added @@ -632,15 +722,23 @@ def current_coordinates(): warnings.warn(msg) logger.warning(msg) - # Make the box bigger to avoid as much as possible 'outlier'. This - # is important if the sites are defined at a high density: in this - # case the bulk regions don't have to be close to 1 * n0 but can - # be less. It's much more difficult to deal with outliers. The - # ideal solution would use images: implement 'looking across the - # periodic boundaries' but that gets complicate when the box - # rotates due to RMS fitting. - smin = np.min(coord, axis=0) - padding - smax = np.max(coord, axis=0) + padding + if gridcenter is not None: + # Generate a copy of smin/smax from coords to later check if the + # defined box might be too small for the selection + smin = np.min(coord, axis=0) + smax = np.max(coord, axis=0) + # Overwrite smin/smax with user defined values + smin, smax = _set_user_grid(gridcenter, xdim, ydim, zdim, smin, smax) + else: + # Make the box bigger to avoid as much as possible 'outlier'. This + # is important if the sites are defined at a high density: in this + # case the bulk regions don't have to be close to 1 * n0 but can + # be less. It's much more difficult to deal with outliers. The + # ideal solution would use images: implement 'looking across the + # periodic boundaries' but that gets complicate when the box + # rotates due to RMS fitting. + smin = np.min(coord, axis=0) - padding + smax = np.max(coord, axis=0) + padding BINS = fixedwidth_bins(delta, smin, smax) arange = np.vstack((BINS['min'], BINS['max'])) @@ -653,7 +751,7 @@ def current_coordinates(): h = grid.copy() pm = ProgressMeter(u.trajectory.n_frames, interval=interval, - verbose=verbose, quiet=quiet, + verbose=verbose, format="Histogramming %(n_atoms)6d atoms in frame " "%(step)5d/%(numsteps)d [%(percentage)5.1f%%]\r") start, stop, step = u.trajectory.check_slice_indices(start, stop, step) diff --git a/package/MDAnalysis/analysis/diffusionmap.py b/package/MDAnalysis/analysis/diffusionmap.py index 20d36d12762..0de2c618b9c 100644 --- a/package/MDAnalysis/analysis/diffusionmap.py +++ b/package/MDAnalysis/analysis/diffusionmap.py @@ -170,11 +170,12 @@ import logging import warnings -from MDAnalysis.core.universe import Universe import numpy as np +from MDAnalysis.core.universe import Universe from .rms import rmsd from .base import AnalysisBase +from MDAnalysis.lib.util import deprecate logger = logging.getLogger("MDAnalysis.analysis.diffusionmap") @@ -195,14 +196,9 @@ class DistanceMatrix(AnalysisBase): Array of all possible ij metric distances between frames in trajectory. This matrix is symmetric with zeros on the diagonal. - Methods - ------- - save(filename) - Save the `dist_matrix` to a given filename """ def __init__(self, u, select='all', metric=rmsd, cutoff=1E0-5, - weights=None, start=None, stop=None, step=None, - **kwargs): + weights=None, **kwargs): """ Parameters ---------- @@ -229,14 +225,6 @@ def __init__(self, u, select='all', metric=rmsd, cutoff=1E0-5, Default: 1EO-5 weights : array, optional Weights to be given to coordinates for metric calculation - start : int, optional - First frame of trajectory to analyse, Default: None becomes 0. - stop : int, optional - Frame index to stop analysis. Default: None becomes - n_frames. Iteration stops *before* this frame number, - which means that the trajectory would be read until the end. - step : int, optional - Step between frames to analyse, Default: None becomes 1. verbose : bool (optional) Show detailed progress of the calculation if set to ``True``; the default is ``False``. @@ -245,8 +233,7 @@ def __init__(self, u, select='all', metric=rmsd, cutoff=1E0-5, traj = self._u.trajectory # remember that this must be called before referencing self.n_frames - super(DistanceMatrix, self).__init__(self._u.trajectory, - start=start, stop=stop, step=step, **kwargs) + super(DistanceMatrix, self).__init__(self._u.trajectory, **kwargs) self.atoms = self._u.select_atoms(select) self._metric = metric @@ -276,7 +263,17 @@ def _single_frame(self): def _conclude(self): self._calculated = True + @deprecate(release="0.19.0", remove="1.0.0", + message="Use ``np.save(filename, DistanceMatrix.dist_matrix)`` instead.") def save(self, filename): + """save squared distance matrix + + Parameters + ---------- + outfile : str + file to save distance matrix + + """ np.save(filename, self.dist_matrix) logger.info("Wrote the distance-squared matrix to file %r", filename) @@ -318,7 +315,7 @@ def __init__(self, u, epsilon=1, **kwargs): **kwargs Parameters to be passed for the initialization of a :class:`DistanceMatrix`. - """ + """ if isinstance(u, Universe): self._dist_matrix = DistanceMatrix(u, **kwargs) elif isinstance(u, DistanceMatrix): @@ -327,20 +324,32 @@ def __init__(self, u, epsilon=1, **kwargs): raise ValueError("U is not a Universe or DistanceMatrix and" " so the DiffusionMap has no data to work with.") self._epsilon = epsilon + + def run(self, start=None, stop=None, step=None): + """ Create and decompose the diffusion matrix in preparation + for a diffusion map. + + Parameters + ---------- + start : int, optional + start frame of analysis + stop : int, optional + stop frame of analysis + step : int, optional + number of frames to skip between each analysed frame + + .. versionchanged:: 0.19.0 + Added start/stop/step kwargs + """ + # run only if distance matrix not already calculated + if not self._dist_matrix._calculated: + self._dist_matrix.run(start=start, stop=stop, step=step) # important for transform function and length of .run() method self._n_frames = self._dist_matrix.n_frames if self._n_frames > 5000: warnings.warn("The distance matrix is very large, and can " "be very slow to compute. Consider picking a larger " "step size in distance matrix initialization.") - - - def run(self): - """ Create and decompose the diffusion matrix in preparation - for a diffusion map.""" - # run only if distance matrix not already calculated - if not self._dist_matrix._calculated: - self._dist_matrix.run() self._scaled_matrix = (self._dist_matrix.dist_matrix ** 2 / self._epsilon) # take negative exponent of scaled matrix to create Isotropic kernel diff --git a/package/MDAnalysis/analysis/dihedrals.py b/package/MDAnalysis/analysis/dihedrals.py new file mode 100644 index 00000000000..71360709a7e --- /dev/null +++ b/package/MDAnalysis/analysis/dihedrals.py @@ -0,0 +1,466 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +r"""Dihedral angles analysis --- :mod:`MDAnalysis.analysis.dihedrals` +=========================================================================== + +:Author: Henry Mull +:Year: 2018 +:Copyright: GNU Public License v2 + +.. versionadded:: 0.19.0 + +This module contains classes for calculating dihedral angles for a given set of +atoms or residues. This can be done for selected frames or whole trajectories. + +A list of time steps that contain angles of interest is generated and can be +easily plotted if desired. For the :class:`~MDAnalysis.analysis.dihedrals.Ramachandran` +and :class:`~MDAnalysis.analysis.dihedrals.Janin` classes, basic plots can be +generated using the method :meth:`Ramachandran.plot()` or :meth:`Janin.plot()`. +These plots are best used as references, but they also allow for user customization. + + +See Also +-------- +:func:`MDAnalysis.lib.distances.calc_dihedrals()` + function to calculate dihedral angles from atom positions + + +Example applications +-------------------- + +General dihedral analysis +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The :class:`~MDAnalysis.analysis.dihedrals.Dihedral` class is useful for calculating +angles for many dihedrals of interest. For example, we can find the phi angles +for residues 5-10 of adenylate kinase (AdK). The trajectory is included within +the test data files:: + + import MDAnalysis as mda + from MDAnalysisTests.datafiles import GRO, XTC + u = mda.Universe(GRO, XTC) + + # selection of atomgroups + ags = [res.phi_selection() for res in u.residues[4:9]] + + from MDAnalysis.analysis.dihedrals import Dihedral + R = Dihedral(ags).run() + +The angles can then be accessed with :attr:`Dihedral.angles`. + +Ramachandran analysis +~~~~~~~~~~~~~~~~~~~~~ + +The :class:`~MDAnalysis.analysis.dihedrals.Ramachandran` class allows for the +quick calculation of phi and psi angles. Unlike the :class:`~MDanalysis.analysis.dihedrals.Dihedral` +class which takes a list of `atomgroups`, this class only needs a list of +residues or atoms from those residues. The previous example can repeated with:: + + u = mda.Universe(GRO, XTC) + r = u.select_atoms("resid 5-10") + + R = Ramachandran(r).run() + +Then it can be plotted using the built-in plotting method :meth:`Ramachandran.plot()`:: + + import matplotlib.pyplot as plt + fig, ax = plt.subplots(figsize=plt.figaspect(1)) + R.plot(ax=ax, color='k', marker='s') + +as shown in the example :ref:`Ramachandran plot figure `. + +.. _figure-ramachandran: + +.. figure:: /images/rama_demo_plot.png + :scale: 50 % + :alt: Ramachandran plot + + Ramachandran plot for residues 5 to 10 of AdK, sampled from the AdK test + trajectory (XTC). The contours in the background are the "allowed region" + and the "marginally allowed" regions. + +The Janin class works in the same way, only needing a list of residues; see the +:ref:`Janin plot figure ` as an example. To plot the data +yourself, the angles can be accessed using :attr:`Ramachandran.angles` or +:attr:`Janin.angles`. + +Reference plots can be added to the axes for both the Ramachandran and Janin +classes using the kwarg ``ref=True``. The Ramachandran reference data +(:data:`~MDAnalysis.analysis.data.filenames.Rama_ref`) and Janin reference data +(:data:`~MDAnalysis.analysis.data.filenames.Janin_ref`) were made using data +obtained from a large selection of 500 PDB files, and were analyzed using these +classes. The allowed and marginally allowed regions of the Ramachandran reference +plt have cutoffs set to include 90% and 99% of the data points, and the Janin +reference plot has cutoffs for 90% and 98% of the data points. The list of PDB +files used for the referece plots was taken from [Lovell2003]_ and information +about general Janin regions was taken from [Janin1978]_. + +.. Note:: + These classes are prone to errors if the topology contains duplicate or missing + atoms (e.g. atoms with `altloc` or incomplete residues). If the topology has as + an `altloc` attribute, you must specify only one `altloc` for the atoms with + more than one (``"protein and not altloc B"``). + + +.. _figure-janin: + +.. figure:: /images/janin_demo_plot.png + :scale: 50 % + :alt: Janin plot + + Janin plot for residues 5 to 10 of AdK, sampled from the AdK test trajectory + (XTC). The contours in the background are the "allowed region" and the + "marginally allowed" regions for all possible residues. + + +Analysis Classes +---------------- + +.. autoclass:: Dihedral + :members: + :inherited-members: + + .. attribute:: angles + + Contains the time steps of the angles for each atomgroup in the list as + an ``n_frames×len(atomgroups)`` :class:`numpy.ndarray` with content + ``[[angle 1, angle 2, ...], [time step 2], ...]``. + +.. autoclass:: Ramachandran + :members: + :inherited-members: + + .. attribute:: angles + + Contains the time steps of the :math:`\phi` and :math:`\psi` angles for + each residue as an ``n_frames×n_residues×2`` :class:`numpy.ndarray` with + content ``[[[phi, psi], [residue 2], ...], [time step 2], ...]``. + +.. autoclass:: Janin + :members: + :inherited-members: + + .. attribute:: angles + + Contains the time steps of the :math:`\chi_1` and :math:`\chi_2` angles + for each residue as an ``n_frames×n_residues×2`` :class:`numpy.ndarray` + with content ``[[[chi1, chi2], [residue 2], ...], [time step 2], ...]``. + +References +---------- +.. [Lovell2003] Simon C. Lovell, Ian W. Davis, W. Bryan Arendall III, + Paul I. W. de Bakker, J. Michael Word, Michael G. Prisant, + Jane S. Richardson, and David C. Richardson (2003). "Structure validation by + :math:`C_{\alpha}` geometry: :math:`\phi`, :math:`\psi`, and + :math:`C_{\beta}` deviation". *Proteins* 50(3): 437-450. doi: + `10.1002/prot.10286 `_ + +.. [Janin1978] Joël Janin, Shoshanna Wodak, Michael Levitt, and Bernard + Maigret. (1978). "Conformation of amino acid side-chains in + proteins". *Journal of Molecular Biology* 125(3): 357-386. doi: + `10.1016/0022-2836(78)90408-4 `_ + +""" +from __future__ import absolute_import +from six.moves import zip, range + +import numpy as np +import matplotlib.pyplot as plt + +import warnings + +import MDAnalysis as mda +from MDAnalysis.analysis.base import AnalysisBase +from MDAnalysis.lib.distances import calc_dihedrals +from MDAnalysis.analysis.data.filenames import Rama_ref, Janin_ref + + +class Dihedral(AnalysisBase): + """Calculate dihedral angles for specified atomgroups. + + Dihedral angles will be calculated for each atomgroup that is given for + each step in the trajectory. Each :class:`~MDAnalysis.core.groups.AtomGroup` + must contain 4 atoms. + + Note + ---- + This class takes a list as an input and is most useful for a large + selection of atomgroups. If there is only one atomgroup of interest, then + it must be given as a list of one atomgroup. + + """ + def __init__(self, atomgroups, **kwargs): + """Parameters + ---------- + atomgroups : list + a list of atomgroups for which the dihedral angles are calculated + + Raises + ------ + ValueError + If any atomgroups do not contain 4 atoms + + """ + super(Dihedral, self).__init__(atomgroups[0].universe.trajectory, **kwargs) + self.atomgroups = atomgroups + + if any([len(ag) != 4 for ag in atomgroups]): + raise ValueError("All AtomGroups must contain 4 atoms") + + self.ag1 = mda.AtomGroup([ag[0] for ag in atomgroups]) + self.ag2 = mda.AtomGroup([ag[1] for ag in atomgroups]) + self.ag3 = mda.AtomGroup([ag[2] for ag in atomgroups]) + self.ag4 = mda.AtomGroup([ag[3] for ag in atomgroups]) + + def _prepare(self): + self.angles = [] + + def _single_frame(self): + angle = calc_dihedrals(self.ag1.positions, self.ag2.positions, + self.ag3.positions, self.ag4.positions, + box=self.ag1.dimensions) + self.angles.append(angle) + + def _conclude(self): + self.angles = np.rad2deg(np.array(self.angles)) + +class Ramachandran(AnalysisBase): + """Calculate :math:`\phi` and :math:`\psi` dihedral angles of selected residues. + + :math:`\phi` and :math:`\psi` angles will be calculated for each residue + corresponding to `atomgroup` for each time step in the trajectory. A + :class:`~MDAnalysis.ResidueGroup` is generated from `atomgroup` which is + compared to the protein to determine if it is a legitimate selection. + + Note + ---- + If the residue selection is beyond the scope of the protein, then an error + will be raised. If the residue selection includes the first or last residue, + then a warning will be raised and they will be removed from the list of + residues, but the analysis will still run. If a :math:`\phi` or :math:`\psi` + selection cannot be made, that residue will be removed from the analysis. + + """ + def __init__(self, atomgroup, **kwargs): + """Parameters + ---------- + atomgroup : AtomGroup or ResidueGroup + atoms for residues for which :math:`\phi` and :math:`\psi` are + calculated + + Raises + ------ + ValueError + If the selection of residues is not contained within the protein + + """ + super(Ramachandran, self).__init__(atomgroup.universe.trajectory, **kwargs) + self.atomgroup = atomgroup + residues = self.atomgroup.residues + protein = self.atomgroup.universe.select_atoms("protein").residues + + if not residues.issubset(protein): + raise ValueError("Found atoms outside of protein. Only atoms " + "inside of a 'protein' selection can be used to " + "calculate dihedrals.") + elif not residues.isdisjoint(protein[[0, -1]]): + warnings.warn("Cannot determine phi and psi angles for the first " + "or last residues") + residues = residues.difference(protein[[0, -1]]) + + phi_sel = [res.phi_selection() for res in residues] + psi_sel = [res.psi_selection() for res in residues] + # phi_selection() and psi_selection() currently can't handle topologies + # with an altloc attribute so this removes any residues that have either + # angle return none instead of a value + if any(sel is None for sel in phi_sel): + warnings.warn("Some residues in selection do not have phi selections") + remove = [i for i, sel in enumerate(phi_sel) if sel is None] + phi_sel = [sel for i, sel in enumerate(phi_sel) if i not in remove] + psi_sel = [sel for i, sel in enumerate(psi_sel) if i not in remove] + if any(sel is None for sel in psi_sel): + warnings.warn("Some residues in selection do not have psi selections") + remove = [i for i, sel in enumerate(psi_sel) if sel is None] + phi_sel = [sel for i, sel in enumerate(phi_sel) if i not in remove] + psi_sel = [sel for i, sel in enumerate(psi_sel) if i not in remove] + self.ag1 = mda.AtomGroup([atoms[0] for atoms in phi_sel]) + self.ag2 = mda.AtomGroup([atoms[1] for atoms in phi_sel]) + self.ag3 = mda.AtomGroup([atoms[2] for atoms in phi_sel]) + self.ag4 = mda.AtomGroup([atoms[3] for atoms in phi_sel]) + self.ag5 = mda.AtomGroup([atoms[3] for atoms in psi_sel]) + + def _prepare(self): + self.angles = [] + + def _single_frame(self): + phi_angles = calc_dihedrals(self.ag1.positions, self.ag2.positions, + self.ag3.positions, self.ag4.positions, + box=self.ag1.dimensions) + psi_angles = calc_dihedrals(self.ag2.positions, self.ag3.positions, + self.ag4.positions, self.ag5.positions, + box=self.ag1.dimensions) + phi_psi = [(phi, psi) for phi, psi in zip(phi_angles, psi_angles)] + self.angles.append(phi_psi) + + def _conclude(self): + self.angles = np.rad2deg(np.array(self.angles)) + + + def plot(self, ax=None, ref=False, **kwargs): + """Plots data into standard ramachandran plot. Each time step in + :attr:`Ramachandran.angles` is plotted onto the same graph. + + Parameters + ---------- + ax : :class:`matplotlib.axes.Axes` + If no `ax` is supplied or set to ``None`` then the plot will + be added to the current active axes. + + ref : bool, optional + Adds a general Ramachandran plot which shows allowed and + marginally allowed regions + + Returns + ------- + ax : :class:`matplotlib.axes.Axes` + Axes with the plot, either `ax` or the current axes. + + """ + if ax is None: + ax = plt.gca() + ax.axis([-180,180,-180,180]) + ax.axhline(0, color='k', lw=1) + ax.axvline(0, color='k', lw=1) + ax.set(xticks=range(-180, 181, 60), yticks=range(-180, 181, 60), + xlabel=r"$\phi$ (deg)", ylabel=r"$\psi$ (deg)") + if ref == True: + X, Y = np.meshgrid(np.arange(-180, 180, 4), np.arange(-180, 180, 4)) + levels = [1, 17, 15000] + colors = ['#A1D4FF', '#35A1FF'] + ax.contourf(X, Y, np.load(Rama_ref), levels=levels, colors=colors) + a = self.angles.reshape(np.prod(self.angles.shape[:2]), 2) + ax.scatter(a[:,0], a[:,1], **kwargs) + return ax + +class Janin(Ramachandran): + """Calculate :math:`\chi_1` and :math:`\chi_2` dihedral angles of selected residues. + + :math:`\chi_1` and :math:`\chi_2` angles will be calculated for each residue + corresponding to `atomgroup` for each time step in the trajectory. A + :class:`~MDAnalysis.ResidueGroup` is generated from `atomgroup` which is + compared to the protein to determine if it is a legitimate selection. + + Note + ---- + If the residue selection is beyond the scope of the protein, then an error + will be raised. If the residue selection includes the residues ALA, CYS, + GLY, PRO, SER, THR, or VAL, then a warning will be raised and they will be + removed from the list of residues, but the analysis will still run. Some + topologies have altloc attribues which can add duplicate atoms to the + selection and must be removed. + + """ + def __init__(self, atomgroup, **kwargs): + """Parameters + ---------- + atomgroup : AtomGroup or ResidueGroup + atoms for residues for which :math:`\chi_1` and :math:`\chi_2` are + calculated + + Raises + ------ + ValueError + If the selection of residues is not contained within the protein + + ValueError + If not enough or too many atoms are found for a residue in the + selection, usually due to missing atoms or alternative locations + + """ + super(Ramachandran, self).__init__(atomgroup.universe.trajectory, **kwargs) + self.atomgroup = atomgroup + residues = atomgroup.residues + protein = atomgroup.universe.select_atoms("protein").residues + remove = residues.atoms.select_atoms("resname ALA CYS GLY PRO SER" + " THR VAL").residues + + if not residues.issubset(protein): + raise ValueError("Found atoms outside of protein. Only atoms " + "inside of a 'protein' selection can be used to " + "calculate dihedrals.") + elif len(remove) != 0: + warnings.warn("All ALA, CYS, GLY, PRO, SER, THR, and VAL residues" + " have been removed from the selection.") + residues = residues.difference(remove) + + self.ag1 = residues.atoms.select_atoms("name N") + self.ag2 = residues.atoms.select_atoms("name CA") + self.ag3 = residues.atoms.select_atoms("name CB") + self.ag4 = residues.atoms.select_atoms("name CG CG1") + self.ag5 = residues.atoms.select_atoms("name CD CD1 OD1 ND1 SD") + + # if there is an altloc attribute, too many atoms will be selected which + # must be removed before using the class, or the file is missing atoms + # for some residues which must also be removed + if any(len(self.ag1) != len(ag) for ag in [self.ag2, self.ag3, + self.ag4, self.ag5]): + raise ValueError("Too many or too few atoms selected. Check for " + "missing or duplicate atoms in topology.") + + def _conclude(self): + self.angles = (np.rad2deg(np.array(self.angles)) + 360) % 360 + + def plot(self, ax=None, ref=False, **kwargs): + """Plots data into standard Janin plot. Each time step in + :attr:`Janin.angles` is plotted onto the same graph. + + Parameters + ---------- + ax : :class:`matplotlib.axes.Axes` + If no `ax` is supplied or set to ``None`` then the plot will + be added to the current active axes. + + ref : bool, optional + Adds a general Janin plot which shows allowed and marginally + allowed regions + + Returns + ------- + ax : :class:`matplotlib.axes.Axes` + Axes with the plot, either `ax` or the current axes. + + """ + if ax is None: + ax = plt.gca() + ax.axis([0, 360, 0, 360]) + ax.axhline(180, color='k', lw=1) + ax.axvline(180, color='k', lw=1) + ax.set(xticks=range(0, 361, 60), yticks=range(0, 361, 60), + xlabel=r"$\chi1$ (deg)", ylabel=r"$\chi2$ (deg)") + if ref == True: + X, Y = np.meshgrid(np.arange(0, 360, 6), np.arange(0, 360, 6)) + levels = [1, 6, 600] + colors = ['#A1D4FF', '#35A1FF'] + ax.contourf(X, Y, np.load(Janin_ref), levels=levels, colors=colors) + a = self.angles.reshape(np.prod(self.angles.shape[:2]), 2) + ax.scatter(a[:,0], a[:,1], **kwargs) + return ax diff --git a/package/MDAnalysis/analysis/encore/__init__.py b/package/MDAnalysis/analysis/encore/__init__.py index f6cbf1777f2..06e124564e7 100644 --- a/package/MDAnalysis/analysis/encore/__init__.py +++ b/package/MDAnalysis/analysis/encore/__init__.py @@ -34,3 +34,10 @@ from .utils import merge_universes __all__ = ['covariance', 'similarity', 'confdistmatrix', 'clustering'] + +from ...due import due, Doi + +due.cite(Doi("10.1371/journal.pcbi.1004415"), + description="ENCORE Ensemble Comparison", + path="MDAnalysis.analysis.encore", + cite_module=True) diff --git a/package/MDAnalysis/analysis/encore/clustering/__init__.py b/package/MDAnalysis/analysis/encore/clustering/__init__.py index a0baef507ae..6e17f25868b 100644 --- a/package/MDAnalysis/analysis/encore/clustering/__init__.py +++ b/package/MDAnalysis/analysis/encore/clustering/__init__.py @@ -29,4 +29,3 @@ 'ClusteringMethod.AffinityPropagationNative' 'ClusteringMethod.AffinityPropagation' 'ClusteringMethod.DBSCAN'] - diff --git a/package/MDAnalysis/analysis/encore/clustering/affinityprop.c b/package/MDAnalysis/analysis/encore/clustering/affinityprop.c index 6d9ae915199..b282110f633 100644 --- a/package/MDAnalysis/analysis/encore/clustering/affinityprop.c +++ b/package/MDAnalysis/analysis/encore/clustering/affinityprop.c @@ -1,11 +1,11 @@ -/* Generated by Cython 0.28.2 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", "MDAnalysis/analysis/encore/clustering/include/ap.h" ], "extra_compile_args": [ @@ -15,7 +15,7 @@ "-funroll-loops" ], "include_dirs": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include", "MDAnalysis/analysis/encore/clustering/include" ], "libraries": [ @@ -38,7 +38,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_2" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -484,6 +484,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -681,7 +682,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -789,7 +790,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -863,7 +864,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -872,7 +873,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -881,7 +882,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -890,7 +891,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -899,7 +900,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -908,7 +909,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -917,7 +918,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -926,7 +927,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -935,7 +936,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -944,7 +945,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -953,7 +954,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -962,7 +963,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -971,7 +972,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -980,7 +981,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -989,7 +990,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -998,7 +999,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1007,7 +1008,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1016,7 +1017,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1025,7 +1026,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1034,7 +1035,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1043,7 +1044,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1078,7 +1079,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1087,7 +1088,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1096,7 +1097,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1105,7 +1106,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -3909,7 +3910,7 @@ static PyObject *__pyx_pf_10MDAnalysis_8analysis_6encore_10clustering_12affinity return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -3957,7 +3958,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3966,7 +3967,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3975,7 +3976,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -3984,7 +3985,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3998,7 +3999,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4009,7 +4010,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4018,7 +4019,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -4031,7 +4032,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4040,7 +4041,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4054,7 +4055,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4065,7 +4066,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4074,7 +4075,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -4087,7 +4088,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4096,7 +4097,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -4105,7 +4106,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -4114,7 +4115,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4124,7 +4125,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -4133,7 +4134,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -4142,7 +4143,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -4154,7 +4155,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -4163,7 +4164,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -4173,7 +4174,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4183,7 +4184,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -4193,7 +4194,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -4204,7 +4205,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -4213,7 +4214,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -4222,7 +4223,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -4231,7 +4232,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -4240,7 +4241,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -4252,7 +4253,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -4265,7 +4266,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -4275,7 +4276,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -4285,7 +4286,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4305,7 +4306,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4322,7 +4323,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4331,7 +4332,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4344,7 +4345,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4353,7 +4354,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -4365,7 +4366,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -4376,7 +4377,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -4387,7 +4388,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -4398,7 +4399,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -4409,7 +4410,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -4420,7 +4421,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -4431,7 +4432,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -4442,7 +4443,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -4453,7 +4454,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -4464,7 +4465,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -4475,7 +4476,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -4486,7 +4487,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -4497,7 +4498,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -4508,7 +4509,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -4519,7 +4520,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -4530,7 +4531,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -4542,7 +4543,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -4563,7 +4564,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -4572,7 +4573,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -4582,7 +4583,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -4591,7 +4592,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -4601,7 +4602,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -4610,7 +4611,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -4619,7 +4620,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -4629,7 +4630,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -4639,7 +4640,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -4671,7 +4672,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4695,7 +4696,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4705,7 +4706,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -4714,7 +4715,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4723,7 +4724,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4733,7 +4734,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -4742,7 +4743,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4751,7 +4752,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4763,7 +4764,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4777,7 +4778,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -4791,7 +4792,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4810,7 +4811,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4824,7 +4825,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -4838,7 +4839,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4857,7 +4858,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4871,7 +4872,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -4885,7 +4886,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -4904,7 +4905,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4918,7 +4919,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -4932,7 +4933,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -4951,7 +4952,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4965,7 +4966,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -4979,7 +4980,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -4998,7 +4999,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -5012,7 +5013,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -5022,7 +5023,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -5034,7 +5035,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -5043,7 +5044,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -5057,7 +5058,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -5072,7 +5073,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5101,7 +5102,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5110,7 +5111,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5119,7 +5120,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5142,7 +5143,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -5159,7 +5160,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -5194,7 +5195,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -5211,7 +5212,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -5224,7 +5225,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -5233,7 +5234,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5253,7 +5254,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5270,7 +5271,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5279,7 +5280,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -5292,7 +5293,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5301,7 +5302,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -5317,7 +5318,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -5326,7 +5327,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -5335,7 +5336,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -5346,7 +5347,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -5356,7 +5357,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5366,7 +5367,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -5378,7 +5379,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5388,7 +5389,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -5401,7 +5402,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5410,7 +5411,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -5428,7 +5429,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -5446,7 +5447,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -5464,7 +5465,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -5482,7 +5483,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -5500,7 +5501,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -5518,7 +5519,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -5536,7 +5537,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -5554,7 +5555,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -5572,7 +5573,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -5590,7 +5591,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -5608,7 +5609,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -5626,7 +5627,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -5644,7 +5645,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -5664,7 +5665,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -5684,7 +5685,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -5704,7 +5705,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -5722,7 +5723,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -5741,7 +5742,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -5750,7 +5751,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5760,7 +5761,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -5773,7 +5774,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5783,7 +5784,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -5793,7 +5794,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5818,7 +5819,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5833,7 +5834,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5844,7 +5845,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5853,7 +5854,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5863,7 +5864,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -5873,7 +5874,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -5884,7 +5885,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5893,7 +5894,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5902,7 +5903,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5914,7 +5915,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5928,7 +5929,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5938,7 +5939,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -5949,7 +5950,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5958,7 +5959,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -5972,7 +5973,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5987,7 +5988,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -6008,7 +6009,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -6024,7 +6025,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -6033,7 +6034,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -6047,7 +6048,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -6062,7 +6063,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -6078,7 +6079,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -6093,7 +6094,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -6116,7 +6117,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -6137,7 +6138,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -6153,7 +6154,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -6162,7 +6163,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -6176,7 +6177,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -6191,7 +6192,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -6207,7 +6208,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -6222,7 +6223,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -6245,7 +6246,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6266,7 +6267,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -6282,7 +6283,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -6291,7 +6292,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -6305,7 +6306,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -6319,7 +6320,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -6333,7 +6334,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -6348,7 +6349,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6510,7 +6511,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -6521,7 +6522,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -6532,7 +6533,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6543,7 +6544,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -6554,7 +6555,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6565,7 +6566,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -6576,7 +6577,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -6587,7 +6588,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -6598,7 +6599,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -6730,8 +6731,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -6954,7 +6955,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -7517,7 +7518,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -7532,7 +7533,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -8598,7 +8599,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -8652,6 +8653,9 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); @@ -9727,14 +9731,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i #ifndef offsetof @@ -478,6 +478,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -675,7 +676,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -783,7 +784,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -857,7 +858,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -866,7 +867,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -875,7 +876,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -884,7 +885,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -893,7 +894,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -902,7 +903,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -911,7 +912,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -920,7 +921,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -929,7 +930,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -938,7 +939,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -947,7 +948,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -956,7 +957,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -965,7 +966,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -974,7 +975,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -983,7 +984,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -992,7 +993,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1001,7 +1002,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1010,7 +1011,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1019,7 +1020,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1028,7 +1029,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1037,7 +1038,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1072,7 +1073,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1081,7 +1082,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1090,7 +1091,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1099,7 +1100,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1925,7 +1926,7 @@ static PyObject *__pyx_pf_10MDAnalysis_8analysis_6encore_6cutils_PureRMSD(CYTHON return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -1973,7 +1974,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -1982,7 +1983,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -1991,7 +1992,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -2000,7 +2001,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2014,7 +2015,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2025,7 +2026,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2034,7 +2035,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -2047,7 +2048,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2056,7 +2057,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2070,7 +2071,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2081,7 +2082,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2090,7 +2091,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -2103,7 +2104,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2112,7 +2113,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -2121,7 +2122,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -2130,7 +2131,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2140,7 +2141,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -2149,7 +2150,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -2158,7 +2159,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -2170,7 +2171,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -2179,7 +2180,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -2189,7 +2190,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2199,7 +2200,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -2209,7 +2210,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -2220,7 +2221,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -2229,7 +2230,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -2238,7 +2239,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -2247,7 +2248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -2256,7 +2257,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -2268,7 +2269,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -2281,7 +2282,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -2291,7 +2292,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -2301,7 +2302,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -2321,7 +2322,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -2338,7 +2339,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -2347,7 +2348,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -2360,7 +2361,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -2369,7 +2370,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -2381,7 +2382,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -2392,7 +2393,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -2403,7 +2404,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -2414,7 +2415,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -2425,7 +2426,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -2436,7 +2437,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -2447,7 +2448,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -2458,7 +2459,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -2469,7 +2470,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -2480,7 +2481,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -2491,7 +2492,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -2502,7 +2503,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -2513,7 +2514,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -2524,7 +2525,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -2535,7 +2536,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -2546,7 +2547,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -2558,7 +2559,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -2579,7 +2580,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -2588,7 +2589,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -2598,7 +2599,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -2607,7 +2608,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -2617,7 +2618,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -2626,7 +2627,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -2635,7 +2636,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -2645,7 +2646,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -2655,7 +2656,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -2687,7 +2688,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -2711,7 +2712,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -2721,7 +2722,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -2730,7 +2731,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -2739,7 +2740,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2749,7 +2750,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -2758,7 +2759,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2767,7 +2768,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -2779,7 +2780,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -2793,7 +2794,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -2807,7 +2808,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -2826,7 +2827,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -2840,7 +2841,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -2854,7 +2855,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -2873,7 +2874,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -2887,7 +2888,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -2901,7 +2902,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -2920,7 +2921,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -2934,7 +2935,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -2948,7 +2949,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -2967,7 +2968,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -2981,7 +2982,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -2995,7 +2996,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3014,7 +3015,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -3028,7 +3029,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -3038,7 +3039,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -3050,7 +3051,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -3059,7 +3060,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -3073,7 +3074,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -3088,7 +3089,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -3117,7 +3118,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3126,7 +3127,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3135,7 +3136,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -3158,7 +3159,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -3175,7 +3176,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -3210,7 +3211,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -3227,7 +3228,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -3240,7 +3241,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -3249,7 +3250,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3269,7 +3270,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3286,7 +3287,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3295,7 +3296,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -3308,7 +3309,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3317,7 +3318,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -3333,7 +3334,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -3342,7 +3343,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -3351,7 +3352,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -3362,7 +3363,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -3372,7 +3373,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -3382,7 +3383,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -3394,7 +3395,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -3404,7 +3405,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -3417,7 +3418,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -3426,7 +3427,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -3444,7 +3445,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -3462,7 +3463,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -3480,7 +3481,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -3498,7 +3499,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -3516,7 +3517,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -3534,7 +3535,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -3552,7 +3553,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -3570,7 +3571,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -3588,7 +3589,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -3606,7 +3607,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -3624,7 +3625,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -3642,7 +3643,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -3660,7 +3661,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -3680,7 +3681,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -3700,7 +3701,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -3720,7 +3721,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -3738,7 +3739,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -3757,7 +3758,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -3766,7 +3767,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -3776,7 +3777,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -3789,7 +3790,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -3799,7 +3800,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -3809,7 +3810,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -3834,7 +3835,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -3849,7 +3850,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -3860,7 +3861,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -3869,7 +3870,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -3879,7 +3880,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -3889,7 +3890,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -3900,7 +3901,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -3909,7 +3910,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -3918,7 +3919,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -3930,7 +3931,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -3944,7 +3945,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -3954,7 +3955,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -3965,7 +3966,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -3974,7 +3975,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -3988,7 +3989,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4003,7 +4004,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4024,7 +4025,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4040,7 +4041,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -4049,7 +4050,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4063,7 +4064,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -4078,7 +4079,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4094,7 +4095,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4109,7 +4110,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4132,7 +4133,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4153,7 +4154,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4169,7 +4170,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4178,7 +4179,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4192,7 +4193,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4207,7 +4208,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4223,7 +4224,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4238,7 +4239,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4261,7 +4262,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4282,7 +4283,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4298,7 +4299,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4307,7 +4308,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4321,7 +4322,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4335,7 +4336,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4349,7 +4350,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4364,7 +4365,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4475,7 +4476,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -4486,7 +4487,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -4497,7 +4498,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4508,7 +4509,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -4519,7 +4520,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4530,7 +4531,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -4541,7 +4542,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4552,7 +4553,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4563,7 +4564,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4693,8 +4694,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -4883,7 +4884,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6143,7 +6144,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -6158,7 +6159,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -6242,7 +6243,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -6347,6 +6348,9 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); @@ -7422,14 +7426,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i #include #include -#include + +#ifdef __unix__ + #include +#endif + +#ifdef _WIN32 + #include +#endif #define EPSILON 1e-8 @@ -186,10 +193,8 @@ double CStochasticProximityEmbedding( double t = 0.0; double finalstress = 0.0; - srand(time(NULL)+getpid()*getpid()); /* random init of d */ - - + srand(time(NULL)+getpid()*getpid()); for (int i=0; i 0) - printf("Cycle %d - Residual stress: %.3f, lambda %.3f\n", i, neighbours_stress(s, d_coords, dim, nelem, rco),lam); + //if (i % stressfreq == 0 && i != 0 && stressfreq > 0) + //printf("Cycle %d - Residual stress: %.3f, lambda %.3f\n", i, neighbours_stress(s, d_coords, dim, nelem, rco),lam); } finalstress = neighbours_stress(s, d_coords, dim, nelem, rco); //printf("Calculation finished. - Residual stress: %.3f\n", finalstress); diff --git a/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.c b/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.c index 20163d2386d..73b4a8f858a 100644 --- a/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.c +++ b/package/MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed.c @@ -1,11 +1,11 @@ -/* Generated by Cython 0.28.2 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", "MDAnalysis/analysis/encore/dimensionality_reduction/include/spe.h" ], "extra_compile_args": [ @@ -15,7 +15,7 @@ "-funroll-loops" ], "include_dirs": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include", "MDAnalysis/analysis/encore/dimensionality_reduction/include" ], "libraries": [ @@ -38,7 +38,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_2" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -484,6 +484,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -681,7 +682,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -789,7 +790,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -863,7 +864,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -872,7 +873,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -881,7 +882,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -890,7 +891,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -899,7 +900,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -908,7 +909,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -917,7 +918,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -926,7 +927,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -935,7 +936,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -944,7 +945,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -953,7 +954,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -962,7 +963,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -971,7 +972,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -980,7 +981,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -989,7 +990,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -998,7 +999,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1007,7 +1008,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1016,7 +1017,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1025,7 +1026,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1034,7 +1035,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1043,7 +1044,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1078,7 +1079,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1087,7 +1088,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1096,7 +1097,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1105,7 +1106,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -2187,7 +2188,7 @@ static PyObject *__pyx_pf_10MDAnalysis_8analysis_6encore_24dimensionality_reduct return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -2235,7 +2236,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -2244,7 +2245,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -2253,7 +2254,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -2262,7 +2263,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2276,7 +2277,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2287,7 +2288,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2296,7 +2297,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -2309,7 +2310,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2318,7 +2319,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2332,7 +2333,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -2343,7 +2344,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2352,7 +2353,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -2365,7 +2366,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2374,7 +2375,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -2383,7 +2384,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -2392,7 +2393,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2402,7 +2403,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -2411,7 +2412,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -2420,7 +2421,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -2432,7 +2433,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -2441,7 +2442,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -2451,7 +2452,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2461,7 +2462,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -2471,7 +2472,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -2482,7 +2483,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -2491,7 +2492,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -2500,7 +2501,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -2509,7 +2510,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -2518,7 +2519,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -2530,7 +2531,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -2543,7 +2544,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -2553,7 +2554,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -2563,7 +2564,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -2583,7 +2584,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -2600,7 +2601,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -2609,7 +2610,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -2622,7 +2623,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -2631,7 +2632,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -2643,7 +2644,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -2654,7 +2655,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -2665,7 +2666,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -2676,7 +2677,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -2687,7 +2688,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -2698,7 +2699,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -2709,7 +2710,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -2720,7 +2721,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -2731,7 +2732,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -2742,7 +2743,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -2753,7 +2754,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -2764,7 +2765,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -2775,7 +2776,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -2786,7 +2787,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -2797,7 +2798,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -2808,7 +2809,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -2820,7 +2821,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -2841,7 +2842,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -2850,7 +2851,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -2860,7 +2861,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -2869,7 +2870,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -2879,7 +2880,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -2888,7 +2889,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -2897,7 +2898,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -2907,7 +2908,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -2917,7 +2918,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -2949,7 +2950,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -2973,7 +2974,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -2983,7 +2984,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -2992,7 +2993,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3001,7 +3002,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3011,7 +3012,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -3020,7 +3021,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3029,7 +3030,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3041,7 +3042,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3055,7 +3056,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3069,7 +3070,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3088,7 +3089,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3102,7 +3103,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3116,7 +3117,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3135,7 +3136,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3149,7 +3150,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3163,7 +3164,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3182,7 +3183,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3196,7 +3197,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -3210,7 +3211,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3229,7 +3230,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3243,7 +3244,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -3257,7 +3258,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3276,7 +3277,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -3290,7 +3291,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -3300,7 +3301,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -3312,7 +3313,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -3321,7 +3322,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -3335,7 +3336,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -3350,7 +3351,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -3379,7 +3380,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3388,7 +3389,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3397,7 +3398,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -3420,7 +3421,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -3437,7 +3438,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -3472,7 +3473,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -3489,7 +3490,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -3502,7 +3503,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -3511,7 +3512,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3531,7 +3532,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3548,7 +3549,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3557,7 +3558,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -3570,7 +3571,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3579,7 +3580,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -3595,7 +3596,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -3604,7 +3605,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -3613,7 +3614,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -3624,7 +3625,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -3634,7 +3635,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -3644,7 +3645,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -3656,7 +3657,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -3666,7 +3667,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -3679,7 +3680,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -3688,7 +3689,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -3706,7 +3707,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -3724,7 +3725,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -3742,7 +3743,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -3760,7 +3761,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -3778,7 +3779,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -3796,7 +3797,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -3814,7 +3815,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -3832,7 +3833,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -3850,7 +3851,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -3868,7 +3869,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -3886,7 +3887,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -3904,7 +3905,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -3922,7 +3923,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -3942,7 +3943,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -3962,7 +3963,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -3982,7 +3983,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -4000,7 +4001,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -4019,7 +4020,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -4028,7 +4029,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4038,7 +4039,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -4051,7 +4052,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4061,7 +4062,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -4071,7 +4072,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4096,7 +4097,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4111,7 +4112,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4122,7 +4123,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -4131,7 +4132,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4141,7 +4142,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -4151,7 +4152,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -4162,7 +4163,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -4171,7 +4172,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -4180,7 +4181,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4192,7 +4193,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4206,7 +4207,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4216,7 +4217,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -4227,7 +4228,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4236,7 +4237,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -4250,7 +4251,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4265,7 +4266,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4286,7 +4287,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4302,7 +4303,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -4311,7 +4312,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4325,7 +4326,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -4340,7 +4341,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4356,7 +4357,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4371,7 +4372,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4394,7 +4395,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4415,7 +4416,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4431,7 +4432,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4440,7 +4441,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4454,7 +4455,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4469,7 +4470,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4485,7 +4486,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4500,7 +4501,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4523,7 +4524,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4544,7 +4545,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4560,7 +4561,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -4569,7 +4570,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4583,7 +4584,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4597,7 +4598,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4611,7 +4612,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4626,7 +4627,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4757,7 +4758,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -4768,7 +4769,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -4779,7 +4780,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4790,7 +4791,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -4801,7 +4802,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4812,7 +4813,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -4823,7 +4824,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -4834,7 +4835,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4845,7 +4846,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -4976,8 +4977,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -5178,7 +5179,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6444,7 +6445,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -6459,7 +6460,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -6543,7 +6544,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -6648,6 +6649,9 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); @@ -7723,14 +7727,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i Acceptors") - ns_acceptors = AtomNeighborSearch(self._s2_acceptors) + ns_acceptors = AtomNeighborSearch(self._s2_acceptors, box) for i, donor_h_set in self._s1_donors_h.items(): d = self._s1_donors[i] for h in donor_h_set: res = ns_acceptors.search(h, self.distance) for a in res: - box = self.u.dimensions if self.pbc else None - angle = self.calc_angle(d, h, a, box=box) + angle = distances.calc_angles(d.position, + h.position, + a.position, box=box) + angle = np.rad2deg(angle) donor_atom = h if self.distance_type != 'heavy' else d - dist = self.calc_eucl_distance(donor_atom, a) + dist = distances.calc_bonds(donor_atom.position, a.position, box=box) if angle >= self.angle and dist <= self.distance: self.logger_debug( "S1-D: {0!s} <-> S2-A: {1!s} {2:f} A, {3:f} DEG".format(h.index, a.index, dist, angle)) @@ -1005,7 +993,7 @@ def _get_timestep(): already_found[(h.index, a.index)] = True if self.selection1_type in ('acceptor', 'both') and self._s1_acceptors: self.logger_debug("Selection 1 Acceptors <-> Donors") - ns_acceptors = AtomNeighborSearch(self._s1_acceptors) + ns_acceptors = AtomNeighborSearch(self._s1_acceptors, box) for i, donor_h_set in self._s2_donors_h.items(): d = self._s2_donors[i] for h in donor_h_set: @@ -1015,10 +1003,12 @@ def _get_timestep(): (h.index, a.index) in already_found or (a.index, h.index) in already_found): continue - box = self.u.dimensions if self.pbc else None - angle = self.calc_angle(d, h, a, box=box) + angle = distances.calc_angles(d.position, + h.position, + a.position, box=box) + angle = np.rad2deg(angle) donor_atom = h if self.distance_type != 'heavy' else d - dist = self.calc_eucl_distance(donor_atom, a) + dist = distances.calc_bonds(donor_atom.position, a.position, box=box) if angle >= self.angle and dist <= self.distance: self.logger_debug( "S1-A: {0!s} <-> S2-D: {1!s} {2:f} A, {3:f} DEG".format(a.index, h.index, dist, angle)) @@ -1033,21 +1023,6 @@ def _get_timestep(): logger.info("HBond analysis: complete; timeseries %s.timeseries", self.__class__.__name__) - @staticmethod - def calc_angle(d, h, a, box=None): - """Calculate the angle (in degrees) between two atoms with H at apex.""" - v1= d.position - v2= h.position - v3= a.position - angle= calc_angles(v1[None, :], v2[None, :], v3[None, :], box=box) - - return np.rad2deg(angle[0]) - - @staticmethod - def calc_eucl_distance(a1, a2): - """Calculate the Euclidean distance between two atoms. """ - return norm(a2.position - a1.position) - @property def timeseries(self): """Time series of hydrogen bonds. @@ -1180,6 +1155,9 @@ def generate_table(self): self.table = out.view(np.recarray) logger.debug("HBond: Stored results as table with %(num_records)d entries.", vars()) + @deprecate(release="0.19.0", remove="1.0.0", + message="You can instead use ``np.save(filename, " + "HydrogendBondAnalysis.table)``.") def save_table(self, filename="hbond_table.pickle"): """Saves :attr:`~HydrogenBondAnalysis.table` to a pickled file. diff --git a/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py b/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py index a7e5b697243..05f20abfc17 100644 --- a/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py +++ b/package/MDAnalysis/analysis/hbonds/hbond_autocorrel.py @@ -30,7 +30,7 @@ .. versionadded:: 0.9.0 Description ---------------- +----------- Calculates the time autocorrelation function, :math:`C_x(t)`, for the hydrogen bonds in the selections passed to it. The population of hydrogen bonds at a @@ -142,18 +142,17 @@ plt.show() -.. autoclass:: HydrogenBondAutoCorrel - - .. automethod:: run +Classes +------- - .. automethod:: solve - - .. automethod:: save_results +.. autoclass:: HydrogenBondAutoCorrel + :members: """ from __future__ import division, absolute_import from six.moves import zip + import numpy as np import scipy.optimize @@ -161,6 +160,14 @@ from MDAnalysis.lib.log import ProgressMeter from MDAnalysis.lib.distances import distance_array, calc_angles, calc_bonds +from MDAnalysis.lib.util import deprecate + +from MDAnalysis.due import due, Doi +due.cite(Doi("10.1063/1.4922445"), + description="Hydrogen bonding autocorrelation time", + path='MDAnalysis.analysis.hbonds.hbond_autocorrel', +) +del Doi class HydrogenBondAutoCorrel(object): @@ -396,6 +403,10 @@ def _single_run(self, start, stop): return results + @deprecate(release="0.19.0", remove="1.0.0", + message="You can instead use " + "``np.savez(filename, time=HydrogenBondAutoCorrel.solution['time'], " + "results=HydrogenBondAutoCorrel.solution['results'])``.") def save_results(self, filename='hbond_autocorrel'): """Saves the results to a numpy zipped array (.npz, see np.savez) @@ -405,6 +416,7 @@ def save_results(self, filename='hbond_autocorrel'): ---------- filename : str, optional The desired filename [hbond_autocorrel] + """ if self.solution['results'] is not None: np.savez(filename, time=self.solution['time'], diff --git a/package/MDAnalysis/analysis/hbonds/wbridge_analysis.py b/package/MDAnalysis/analysis/hbonds/wbridge_analysis.py index cbe45968e18..6f81b22c029 100644 --- a/package/MDAnalysis/analysis/hbonds/wbridge_analysis.py +++ b/package/MDAnalysis/analysis/hbonds/wbridge_analysis.py @@ -281,16 +281,19 @@ class WaterBridgeAnalysis_OtherFF(WaterBridgeAnalysis): import pandas as pd df = pd.DataFrame.from_records(w.table) """ +from __future__ import absolute_import, division import six from collections import defaultdict -import numpy as np import logging import warnings +import numpy as np + from .hbond_analysis import HydrogenBondAnalysis from MDAnalysis.lib.NeighborSearch import AtomNeighborSearch -from MDAnalysis.lib.log import ProgressMeter, _set_verbose +from MDAnalysis.lib.log import ProgressMeter +from MDAnalysis.lib import distances from MDAnalysis import SelectionWarning logger = logging.getLogger('MDAnalysis.analysis.wbridges') @@ -316,8 +319,7 @@ def __init__(self, universe, selection1='protein', update_selection2=False, update_water_selection=True, filter_first=True, distance_type='hydrogen', distance=3.0, angle=120.0, forcefield='CHARMM27', donors=None, - acceptors=None, start=None, stop=None, step=None, debug=None, - verbose=None): + acceptors=None, debug=None, verbose=False, **kwargs): """Set up the calculation of water bridges between two selections in a universe. @@ -403,16 +405,6 @@ def __init__(self, universe, selection1='protein', Extra H acceptor atom types (in addition to those in :attr:`~HydrogenBondAnalysis.DEFAULT_ACCEPTORS`), must be a sequence. - start : int (optional) - starting frame-index for analysis, ``None`` is the first one, 0. - `start` and `stop` are 0-based frame indices and are used to slice - the trajectory (if supported) [``None``] - stop : int (optional) - last trajectory frame for analysis, ``None`` is the last one - [``None``] - step : int (optional) - read every `step` between `start` (included) and `stop` (excluded), - ``None`` selects 1. [``None``] distance_type : {"hydrogen", "heavy"} (optional) Measure hydrogen bond lengths between donor and acceptor heavy attoms ("heavy") or between donor hydrogen and acceptor heavy @@ -448,7 +440,7 @@ def __init__(self, universe, selection1='protein', update_selection2=update_selection2, filter_first=filter_first, distance_type=distance_type, distance=distance, angle=angle, forcefield=forcefield, donors=donors, acceptors=acceptors, - start=start, stop=stop, step=step, debug=debug, verbose=verbose) + debug=debug, verbose=verbose, **kwargs) self._update_water_selection() def _log_parameters(self): @@ -544,7 +536,7 @@ def _update_water_selection(self): 'name {0}'.format(' '.join(self.acceptors))) self.logger_debug("Water acceptors: {0}".format(len(self._water_acceptors))) - def run(self, **kwargs): + def run(self, start=None, stop=None, step=None, verbose=None, debug=None): """Analyze trajectory and produce timeseries. Stores the water bridge data per frame as @@ -553,6 +545,16 @@ def run(self, **kwargs): Parameters ---------- + start : int (optional) + starting frame-index for analysis, ``None`` is the first one, 0. + `start` and `stop` are 0-based frame indices and are used to slice + the trajectory (if supported) [``None``] + stop : int (optional) + last trajectory frame for analysis, ``None`` is the last one + [``None``] + step : int (optional) + read every `step` between `start` (included) and `stop` (excluded), + ``None`` selects 1. [``None``] verbose : bool (optional) toggle progress meter output :class:`~MDAnalysis.lib.log.ProgressMeter` [``True``] @@ -568,12 +570,13 @@ def run(self, **kwargs): :meth:`WaterBridgeAnalysis.generate_table` : processing the data into a different format. """ + self._setup_frames(self.u.trajectory, start, stop, step) + logger.info("WBridge analysis: starting") logger.debug("WBridge analysis: donors %r", self.donors) logger.debug("WBridge analysis: acceptors %r", self.acceptors) logger.debug("WBridge analysis: water bridge %r", self.water_selection) - debug = kwargs.pop('debug', None) if debug is not None and debug != self.debug: self.debug = debug logger.debug("Toggling debug to %r", self.debug) @@ -584,26 +587,16 @@ def run(self, **kwargs): self.timesteps = [] self._water_network = [] - logger.info("checking trajectory...") # n_frames can take a while! - try: - frames = np.arange(self.u.trajectory.n_frames)[self.traj_slice] - except: - logger.error("Problem reading trajectory or trajectory slice incompatible.") - logger.exception() - raise - verbose = _set_verbose(verbose=kwargs.get('verbose', None), - quiet=kwargs.get('quiet', None), - default=True) - pm = ProgressMeter(len(frames), + if verbose is None: + verbose = self._verbose + pm = ProgressMeter(self.n_frames, format="WBridge frame {current_step:5d}: {step:5d}/{numsteps} [{percentage:5.1f}%]\r", verbose=verbose) logger.info("Starting analysis (frame index start=%d stop=%d, step=%d)", - (self.traj_slice.start or 0), - (self.traj_slice.stop or self.u.trajectory.n_frames), - self.traj_slice.step or 1) + self.start, self.stop, self.step) - for progress, ts in enumerate(self.u.trajectory[self.traj_slice]): + for progress, ts in enumerate(self.u.trajectory[self.start:self.stop:self.step]): # all bonds for this timestep # dict of tuples (atom.index, atom.index) for quick check if @@ -633,9 +626,12 @@ def run(self, **kwargs): res = ns_acceptors.search(h, self.distance) for a in res: donor_atom = h if self.distance_type != 'heavy' else d - dist = self.calc_eucl_distance(donor_atom, a) + dist = distances.calc_bonds(donor_atom.position, + a.position) if dist <= self.distance: - angle = self.calc_angle(d, h, a) + angle = distances.calc_angles(d.position, h.position, + a.position) + angle = np.rad2deg(angle) if angle >= self.angle: self.logger_debug( "S1-D: {0!s} <-> W-A: {1!s} {2:f} A, {3:f} DEG"\ @@ -657,9 +653,12 @@ def run(self, **kwargs): res = ns_acceptors.search(h, self.distance) for a in res: donor_atom = h if self.distance_type != 'heavy' else d - dist = self.calc_eucl_distance(donor_atom, a) + dist = distances.calc_bonds(donor_atom.position, + a.position) if dist <= self.distance: - angle = self.calc_angle(d, h, a) + angle = distances.calc_angles(d.position, h.position, + a.position) + angle = np.rad2deg(angle) if angle >= self.angle: self.logger_debug( "S1-A: {0!s} <-> W-D: {1!s} {2:f} A, {3:f} DEG"\ @@ -705,9 +704,12 @@ def run(self, **kwargs): res = ns_acceptors.search(h, self.distance) for a in res: donor_atom = h if self.distance_type != 'heavy' else d - dist = self.calc_eucl_distance(donor_atom, a) + dist = distances.calc_bonds(donor_atom.position, + a.position) if dist <= self.distance: - angle = self.calc_angle(d, h, a) + angle = distances.calc_angles(d.position, h.position, + a.position) + angle = np.rad2deg(angle) if angle >= self.angle: self.logger_debug( "WB-D: {0!s} <-> S2-A: {1!s} {2:f} A, {3:f} DEG"\ @@ -727,9 +729,12 @@ def run(self, **kwargs): res = ns_acceptors.search(h, self.distance) for a in res: donor_atom = h if self.distance_type != 'heavy' else d - dist = self.calc_eucl_distance(donor_atom, a) + dist = distances.calc_bonds(donor_atom.position, + a.position) if dist <= self.distance: - angle = self.calc_angle(d, h, a) + angle = distances.calc_angles(d.position, h.position, + a.position) + angle = np.rad2deg(angle) if angle >= self.angle: self.logger_debug( "WB-A: {0!s} <-> S2-D: {1!s} {2:f} A, {3:f} DEG"\ @@ -834,26 +839,6 @@ def generate_table(self): """ super(WaterBridgeAnalysis, self).generate_table() - def save_table(self, filename="wbridge_table.pickle"): - """Saves :attr:`~WaterBridgeAnalysis.table` to a pickled file. - - If :attr:`~WaterBridgeAnalysis.table` does not exist yet, - :meth:`generate_table` is called first. - - Parameters - ---------- - filename : str (optional) - path to the filename - - Example - ------- - Load with :: - - import cPickle - table = cPickle.load(open(filename)) - """ - super(WaterBridgeAnalysis, self).save_table(filename) - def count_by_type(self): """Counts the frequency of water bridge of a specific type. diff --git a/package/MDAnalysis/analysis/helanal.py b/package/MDAnalysis/analysis/helanal.py index d1b88f89a10..963c628a9b6 100644 --- a/package/MDAnalysis/analysis/helanal.py +++ b/package/MDAnalysis/analysis/helanal.py @@ -124,7 +124,7 @@ import MDAnalysis from MDAnalysis import FinishTimeException -from MDAnalysis.lib.log import ProgressMeter, _set_verbose +from MDAnalysis.lib.log import ProgressMeter from MDAnalysis.lib import mdamath import logging @@ -168,7 +168,7 @@ def helanal_trajectory(universe, selection="name CA", bend_filename="local_bend.xvg", twist_filename="unit_twist.xvg", prefix="helanal_", ref_axis=None, - verbose=None, quiet=None): + verbose=False): """Perform HELANAL helix analysis on all frames in `universe`. Parameters @@ -236,7 +236,6 @@ def helanal_trajectory(universe, selection="name CA", `verbose` one. """ - verbose = _set_verbose(verbose, quiet, default=True) if ref_axis is None: ref_axis = np.array([0., 0., 1.]) else: diff --git a/package/MDAnalysis/analysis/hole.py b/package/MDAnalysis/analysis/hole.py index 2421238faaf..a92363ded0d 100644 --- a/package/MDAnalysis/analysis/hole.py +++ b/package/MDAnalysis/analysis/hole.py @@ -28,9 +28,10 @@ :Copyright: GNU Public License v2 With the help of this module, the :program:`hole` program from the HOLE_ suite -of tools [Smart1993]_ [Smart1996]_ can be run on frames in a trajectory. Data -can be combined and analyzed. - +of tools [Smart1993]_ [Smart1996]_ can be run on frames in an MD trajectory or +NMR ensemble in order to analyze an ion channel pore or transporter pathway +[Stelzl2014]_ as a function of time or arbitrary order parameters. Data can be +combined and analyzed. HOLE_ must be installed separately and can be obtained in binary form from http://www.holeprogram.org/ or as source from @@ -224,10 +225,16 @@ .. [Smart1993] O.S. Smart, J.M. Goodfellow and B.A. Wallace. The Pore Dimensions of Gramicidin A. Biophysical Journal 65:2455-2460, 1993. + DOI: 10.1016/S0006-3495(93)81293-1 .. [Smart1996] O.S. Smart, J.G. Neduvelil, X. Wang, B.A. Wallace, and M.S.P. Sansom. HOLE: A program for the analysis of the pore dimensions of ion channel structural models. J.Mol.Graph., 14:354–360, 1996. + DOI: 10.1016/S0263-7855(97)00009-X URL http://www.holeprogram.org/ +.. [Stelzl2014] L. S. Stelzl, P. W. Fowler, M. S. P. Sansom, and O. Beckstein. + Flexible gates generate occluded intermediates in the transport cycle + of LacY. J Mol Biol, 426:735–751, 2014. + DOI: 10.1016/j.jmb.2013.10.024 .. Footnotes @@ -272,8 +279,24 @@ from MDAnalysis import Universe from MDAnalysis.exceptions import ApplicationError -from MDAnalysis.lib.util import which, realpath, asiterable -from MDAnalysis.lib.util import FORTRANReader +from MDAnalysis.lib.util import (which, realpath, asiterable, + FORTRANReader, deprecate) + +from ..due import due, Doi + +due.cite(Doi("10.1016/S0006-3495(93)81293-1"), + description="HOLE program", + path="MDAnalysis.analysis.hole", + cite_module=True) +due.cite(Doi("10.1016/S0263-7855(97)00009-X"), + description="HOLE program", + path="MDAnalysis.analysis.hole", + cite_module=True) +due.cite(Doi("10.1016/j.jmb.2013.10.024"), + description="HOLE trajectory analysis with orderparameters", + path="MDAnalysis.analysis.hole", + cite_module=True) +del Doi logger = logging.getLogger("MDAnalysis.analysis.hole") @@ -369,6 +392,9 @@ def seq2str(v): class BaseHOLE(object): """Baseclass for HOLE analysis, providing plotting and utility functions""" + @deprecate(release="0.19.0", remove="1.0.0", + message="You can instead use " + "``cPickle.dump(HOLE.profiles, open(filename, 'wb'))``.") def save(self, filename="hole.pickle"): """Save :attr:`profiles` as a Python pickle file *filename*. @@ -377,6 +403,7 @@ def save(self, filename="hole.pickle"): import cPickle profiles = cPickle.load(open(filename)) + """ cPickle.dump(self.profiles, open(filename, "wb"), cPickle.HIGHEST_PROTOCOL) diff --git a/package/MDAnalysis/analysis/leaflet.py b/package/MDAnalysis/analysis/leaflet.py index 664a286c017..d36ec32c250 100644 --- a/package/MDAnalysis/analysis/leaflet.py +++ b/package/MDAnalysis/analysis/leaflet.py @@ -79,6 +79,14 @@ from .. import core from . import distances +from ..due import due, Doi + +due.cite(Doi("10.1002/jcc.21787"), + description="LeafletFinder algorithm", + path="MDAnalysis.analysis.leaflet", + cite_module=True) +del Doi + class LeafletFinder(object): """Identify atoms in the same leaflet of a lipid bilayer. diff --git a/package/MDAnalysis/analysis/lineardensity.py b/package/MDAnalysis/analysis/lineardensity.py index 291920141a8..dba1caf5e86 100644 --- a/package/MDAnalysis/analysis/lineardensity.py +++ b/package/MDAnalysis/analysis/lineardensity.py @@ -30,19 +30,19 @@ from __future__ import division, absolute_import import os.path as path + import numpy as np from MDAnalysis.analysis.base import AnalysisBase - +from MDAnalysis.lib.util import deprecate class LinearDensity(AnalysisBase): """Linear density profile - LinearDensity(selection, grouping='atoms', binsize=0.25) Parameters ---------- selection : AtomGroup - Any atomgroup + any atomgroup grouping : str {'atoms', 'residues', 'segments', 'fragments'} Density profiles will be computed on the center of geometry of a selected group of atoms ['atoms'] @@ -60,6 +60,13 @@ class LinearDensity(AnalysisBase): Show detailed progress of the calculation if set to ``True``; the default is ``False``. + Attributes + ---------- + results : dict + Keys 'x', 'y', and 'z' for the three directions. Under these + keys, find 'pos', 'pos_std' (mass-weighted density and + standard deviation), 'char', 'char_std' (charge density and + its standard deviation), 'slice_volume' (volume of bin). Example ------- @@ -69,15 +76,9 @@ class LinearDensity(AnalysisBase): ldens = LinearDensity(selection) ldens.run() - Density profiles can be written to file through the `save` method:: - - ldens.save(description='mydensprof', form='txt') - - which will output the density profiles in a file named - `.mydensprof_.ldens`. - Results can be saved in npz format by specifying `form='npz'` .. versionadded:: 0.14.0 + """ def __init__(self, selection, grouping='atoms', binsize=0.25, **kwargs): @@ -190,8 +191,12 @@ def _conclude(self): self.results[dim]['pos_std'] /= self.results[dim]['slice volume'] * k self.results[dim]['char_std'] /= self.results[dim]['slice volume'] * k + @deprecate(release="0.19.0", remove="1.0.0", + message="Instead save the :attr:`results` dictionary directly in " + "your favorite format (pickle, json, hdf5, ...).") def save(self, description='', form='txt'): """Save density profile to file + Allows to save the density profile to either a ASCII txt file or a binary numpy npz file. Output file has extension 'ldens' and begins with the name of the trajectory file. @@ -214,6 +219,7 @@ def save(self, description='', form='txt'): which will output the linear density profiles in a file named `.mydensprof_.ldens`. + """ # Take root of trajectory filename for output file naming trajname = path.splitext(path.basename( @@ -230,6 +236,7 @@ def save(self, description='', form='txt'): raise ValueError('form argument must be either txt or npz') def _savetxt(self, filename): + # DEPRECATED: remove in 1.0.0 bins = np.linspace(0.0, max(self.dimensions), num=self.nbins) # Create list of results which will be output @@ -253,6 +260,7 @@ def _savetxt(self, filename): header=header) def _savez(self, filename): + # DEPRECATED: remove in 1.0.0 bins = np.linspace(0.0, max(self.dimensions), num=self.nbins) dictionary = {'bins': bins} diff --git a/package/MDAnalysis/analysis/pca.py b/package/MDAnalysis/analysis/pca.py index 7d7c82a88e1..370c11dcb9b 100644 --- a/package/MDAnalysis/analysis/pca.py +++ b/package/MDAnalysis/analysis/pca.py @@ -160,6 +160,10 @@ class PCA(AnalysisBase): Notes ----- Computation can be speed up by supplying a precalculated mean structure + + .. versionchanged:: 0.19.0 + The start frame is used when performing selections and calculating + mean positions. Previously the 0th frame was always used. """ def __init__(self, universe, select='all', align=False, mean=None, @@ -181,46 +185,39 @@ def __init__(self, universe, select='all', align=False, mean=None, n_components : int, optional The number of principal components to be saved, default saves all principal components, Default: None - start : int, optional - First frame of trajectory to use for generation - of covariance matrix, Default: None - stop : int, optional - Last frame of trajectory to use for generation - of covariance matrix, Default: None - step : int, optional - Step between frames of trajectory to use for generation - of covariance matrix, Default: None verbose : bool (optional) Show detailed progress of the calculation if set to ``True``; the default is ``False``. """ - super(PCA, self).__init__(universe.trajectory, - **kwargs) - if self.n_frames == 1: - raise ValueError('No covariance information can be gathered from a' - 'single trajectory frame.\n') - + super(PCA, self).__init__(universe.trajectory, **kwargs) self._u = universe # for transform function self.align = align - # access 0th index - self._u.trajectory[0] - # reference will be 0th index - self._reference = self._u.select_atoms(select) - self._atoms = self._u.select_atoms(select) + + self._calculated = False self.n_components = n_components + self._select = select + self._mean = mean + + def _prepare(self): + # access start index + self._u.trajectory[self.start] + # reference will be start index + self._reference = self._u.select_atoms(self._select) + self._atoms = self._u.select_atoms(self._select) self._n_atoms = self._atoms.n_atoms - self._calculated = False - if mean is None: + if self._mean is None: self.mean = np.zeros(self._n_atoms*3) self._calc_mean = True else: - self.mean = mean.positions + self.mean = self._mean.positions self._calc_mean = False - def _prepare(self): + if self.n_frames == 1: + raise ValueError('No covariance information can be gathered from a' + 'single trajectory frame.\n') n_dim = self._n_atoms * 3 self.cov = np.zeros((n_dim, n_dim)) self._ref_atom_positions = self._reference.positions @@ -303,9 +300,13 @@ def transform(self, atomgroup, n_components=None, start=None, stop=None, Returns ------- pca_space : array, shape (number of frames, number of components) + + .. versionchanged:: 0.19.0 + Transform now requires that :meth:`run` has been called before, + otherwise a :exc:`ValueError` is raised. """ if not self._calculated: - self.run() + raise ValueError('Call run() on the PCA before using transform') if isinstance(atomgroup, Universe): atomgroup = atomgroup.atoms diff --git a/package/MDAnalysis/analysis/psa.py b/package/MDAnalysis/analysis/psa.py index 78bdb709d48..ace947639b7 100644 --- a/package/MDAnalysis/analysis/psa.py +++ b/package/MDAnalysis/analysis/psa.py @@ -216,24 +216,32 @@ from six.moves import range, cPickle from six import string_types +import os +import warnings +import numbers + import numpy as np from scipy import spatial, cluster from scipy.spatial.distance import directed_hausdorff import matplotlib -import warnings -import numbers - import MDAnalysis import MDAnalysis.analysis.align from MDAnalysis import NoDataError - -import os +from MDAnalysis.lib.util import deprecate import logging logger = logging.getLogger('MDAnalysis.analysis.psa') +from ..due import due, Doi + +due.cite(Doi("10.1371/journal.pcbi.1004568"), + description="Path Similarity Analysis algorithm and implementation", + path="MDAnalysis.analysis.psa", + cite_module=True) +del Doi + def get_path_metric_func(name): """Selects a path metric function by name. @@ -1498,14 +1506,27 @@ def run(self, **kwargs): store : bool if ``True`` then writes :attr:`PSAnalysis.D` to text and compressed npz (numpy) files [``True``] + + .. deprecated:: 0.19.0 + `store` will be removed together with :meth:`save_results` in 1.0.0. + filename : str string, filename to save :attr:`PSAnalysis.D` + .. deprecated:: 0.19.0 + `filename` will be removed together with :meth:`save_results` in 1.0.0. + + """ metric = kwargs.pop('metric', 'hausdorff') start = kwargs.pop('start', None) stop = kwargs.pop('stop', None) step = kwargs.pop('step', None) + # DEPRECATED 0.19.0: remove in 1.0 + if 'store' in kwargs: + warnings.warn("PSAnalysis.run(): 'store' was deprecated in 0.19.0 " + "and will be removed in 1.0", + category=DeprecationWarning) store = kwargs.pop('store', True) if isinstance(metric, string_types): @@ -1523,6 +1544,11 @@ def run(self, **kwargs): D[j,i] = D[i,j] self.D = D if store: + # DEPRECATED 0.19.0: remove in 1.0 + if 'filename' in kwargs: + warnings.warn("PSAnalysis.run(): 'filename' was deprecated in " + "0.19.0 and will be removed in 1.0", + category=DeprecationWarning) filename = kwargs.pop('filename', metric) if not isinstance(metric, string_types): filename = 'custom_metric' @@ -1586,7 +1612,9 @@ def run_pairs_analysis(self, **kwargs): self._HP.append(pp.get_hausdorff_pair()) self.D = D - + @deprecate(release="0.19.0", remove="1.0.0", + message="You can save the distance matrix :attr:`D` to a numpy " + "file with ``np.save(filename, PSAnalysis.D)``.") def save_result(self, filename=None): """Save distance matrix :attr:`PSAnalysis.D` to a numpy compressed npz file and text file. @@ -1955,7 +1983,7 @@ def plot_nearest_neighbors(self, filename=None, idx=0, \ if self._NN is None: raise ValueError("No nearest neighbor data; run " - "'PSAnalysis.run_nearest_neighbors()' first.") + "'PSAnalysis.run_pairs_analysis(neighbors=True)' first.") sns.set_style('whitegrid') diff --git a/package/MDAnalysis/analysis/rdf.py b/package/MDAnalysis/analysis/rdf.py index e69565db673..83f2890012e 100644 --- a/package/MDAnalysis/analysis/rdf.py +++ b/package/MDAnalysis/analysis/rdf.py @@ -20,12 +20,84 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -Radial Distribution Functions --- :mod:`MDAnalysis.analysis.rdf` +r"""Radial Distribution Functions --- :mod:`MDAnalysis.analysis.rdf` ================================================================ -Tools for calculating pair distribution functions ("radial -distribution functions" or "RDF"). +This module contains two classes to calculate radial +`pair distribution functions`_ (`radial distribution functions`_ or "RDF"). +The RDF :math:`g_{ab}(r)` between types of particles :math:`a` and :math:`b` is + +.. math:: + + g_{ab}(r) = (N_{a} N_{b})^{-1} \sum_{i=1}^{N_a} \sum_{j=1}^{N_b} + \langle \delta(|\mathbf{r}_i - \mathbf{r}_j| - r) \rangle + +which is normalized so that the RDF becomes 1 for large separations in a +homogenous system. The RDF effectively counts the average number of :math:`b` +neighbours in a shell at distance :math:`r` around a :math:`a` particle and +represents it as a density. + +The radial cumulative distribution function is + +.. math:: + + G_{ab}(r) = \int_0^r \!\!dr' 4\pi r'^2 g_{ab}(r') + +and the average number of :math:`b` particles within radius :math:`r` + +.. math:: + + N_{ab}(r) = \rho G_{ab}(r) + +(with the appropriate density :math:`\rho`). The latter function can be used to +compute, for instance, coordination numbers such as the number of neighbors in +the first solvation shell :math:`N(r_1)` where :math:`r_1` is the position of +the first minimum in :math:`g(r)`. + + +.. _`pair distribution functions`: + https://en.wikipedia.org/wiki/Pair_distribution_function +.. _`radial distribution functions`: + https://en.wikipedia.org/wiki/Radial_distribution_function + + +Average radial distribution function +------------------------------------ + +:class:`InterRDF` is a tool to calculate average radial distribution functions +between two groups of atoms. Suppose we have two AtomGroups ``A`` and +``B``. ``A`` contains atom ``A1``, ``A2``, and ``B`` contains ``B1``, +``B2``. Give ``A`` and ``B`` to class:`InterRDF`, the output will be the +average of RDFs between ``A1`` and ``B1``, ``A1`` and ``B2``, ``A2`` and +``B1``, ``A2`` and ``B2``. A typical application is to calculate the RDF of +solvent with itself or with another solute. + +.. autoclass:: InterRDF + :members: + :inherited-members: + + +Site-specific radial distribution function +------------------------------------------ + +:class:`InterRDF_s` calculates site-specific radial distribution +functions. Instead of two groups of atoms it takes as input a list of pairs of +AtomGroup, ``[[A, B], [C, D], ...]``. Give the same ``A`` and ``B`` to +:class:`InterRDF_s`, the output will be a list of RDFs between ``A1`` and +``B1``, ``A1`` and ``B2``, ``A2`` and ``B1``, ``A2`` and ``B2`` (and similarly +for ``C`` and ``D``). These site-specific radial distribution functions are +typically calculated if one is interested in the solvation shells of a ligand +in a binding site or the solvation of specific residues in a protein. A common +use case is to choose ``A`` and ``C`` to be AtomGroups that only contain a +single atom and ``W`` all solvent molecules: ``InterRDF_s(u, [[A, W], [B, +W]])`` will then produce the RDF of solvent around atom ``A[0]`` and around +atom ``B[0]``. + + +.. autoclass:: InterRDF_s + :members: + :inherited-members: + .. Not Implemented yet: .. - Structure factor? @@ -38,6 +110,7 @@ from ..lib.util import blocks_of from ..lib import distances from .base import AnalysisBase +from six.moves import zip, range class InterRDF(AnalysisBase): @@ -114,26 +187,23 @@ def _prepare(self): # Need to know average volume self.volume = 0.0 + # Set the max range to filter the search radius + self._maxrange = self.rdf_settings['range'][1] - # Allocate a results array which we will reuse - self._result = np.zeros((len(self.g1), len(self.g2)), dtype=np.float64) - # If provided exclusions, create a mask of _result which - # lets us take these out - if self._exclusion_block is not None: - self._exclusion_mask = blocks_of(self._result, - *self._exclusion_block) - self._maxrange = self.rdf_settings['range'][1] + 1.0 - else: - self._exclusion_mask = None def _single_frame(self): - distances.distance_array(self.g1.positions, self.g2.positions, - box=self.u.dimensions, result=self._result) + pairs, dist = distances.capped_distance(self.g1.positions, + self.g2.positions, + self._maxrange, + box=self.u.dimensions) # Maybe exclude same molecule distances - if self._exclusion_mask is not None: - self._exclusion_mask[:] = self._maxrange + if self._exclusion_block is not None: + idxA, idxB = pairs[:, 0]//self._exclusion_block[0], pairs[:, 1]//self._exclusion_block[1] + mask = np.where(idxA != idxB)[0] + dist = dist[mask] + - count = np.histogram(self._result, **self.rdf_settings)[0] + count = np.histogram(dist, **self.rdf_settings)[0] self.count += count self.volume += self._ts.volume @@ -161,3 +231,159 @@ def _conclude(self): rdf = self.count / (density * vol * self.n_frames) self.rdf = rdf + + +class InterRDF_s(AnalysisBase): + """Site-specific intermolecular pair distribution function + + Arguments + --------- + u : Universe + a Universe that contains atoms in `ags` + ags : list + a list of pairs of :class:`~MDAnalysis.core.groups.AtomGroup` + instances + nbins : int (optional) + Number of bins in the histogram [75] + range : tuple or list (optional) + The size of the RDF [0.0, 15.0] + start : int (optional) + The frame to start at (default is first) + stop : int (optional) + The frame to end at (default is last) + step : int (optional) + The step size through the trajectory in frames (default is + every frame) + + Example + ------- + + First create the :class:`InterRDF_s` object, by supplying one Universe and + one list of pairs of AtomGroups, then use the :meth:`~InterRDF_s.run` + method:: + + from MDAnalysisTests.datafiles import GRO_MEMPROT, XTC_MEMPROT + u = mda.Universe(GRO_MEMPROT, XTC_MEMPROT) + + s1 = u.select_atoms('name ZND and resid 289') + s2 = u.select_atoms('(name OD1 or name OD2) and resid 51 and sphzone 5.0 (resid 289)') + s3 = u.select_atoms('name ZND and (resid 291 or resid 292)') + s4 = u.select_atoms('(name OD1 or name OD2) and sphzone 5.0 (resid 291)') + ags = [[s1, s2], [s3, s4]] + + rdf = InterRDF_s(u, ags) + rdf.run() + + Results are available through the :attr:`bins` and :attr:`rdf` attributes:: + + plt.plot(rdf.bins, rdf.rdf[0][0][0]) + + (Which plots the rdf between the first atom in ``s1`` and the first atom in + ``s2``) + + To generate the *cumulative distribution function* (cdf), use the + :meth:`~InterRDF_s.get_cdf` method :: + + cdf = rdf.get_cdf() + + Results are available through the :attr:'cdf' attribute:: + + plt.plot(rdf.bins, rdf.cdf[0][0][0]) + + (Which plots the cdf between the first atom in ``s1`` and the first atom in + ``s2``) + + + .. versionadded:: 0.19.0 + + """ + def __init__(self, u, ags, + nbins=75, range=(0.0, 15.0), density=True, **kwargs): + super(InterRDF_s, self).__init__(u.universe.trajectory, **kwargs) + + # List of pairs of AtomGroups + self.ags = ags + self.u = u + self._density = density + self.rdf_settings = {'bins': nbins, + 'range': range} + + def _prepare(self): + # Empty list to store the RDF + count_list = [] + count, edges = np.histogram([-1], **self.rdf_settings) + count_list = [np.zeros((ag1.n_atoms, ag2.n_atoms, len(count)), dtype=np.float64) + for ag1, ag2 in self.ags] + + self.count = count_list + self.edges = edges + self.bins = 0.5 * (edges[:-1] + edges[1:]) + + # Need to know average volume + self.volume = 0.0 + self._maxrange = self.rdf_settings['range'][1] + + + def _single_frame(self): + for i, (ag1, ag2) in enumerate(self.ags): + pairs, dist = distances.capped_distance(ag1.positions, + ag2.positions, + self._maxrange, + box=self.u.dimensions) + + for j, (idx1, idx2) in enumerate(pairs): + self.count[i][idx1, idx2, :] += np.histogram(dist[j], + **self.rdf_settings)[0] + + self.volume += self._ts.volume + + + def _conclude(self): + # Volume in each radial shell + vol = np.power(self.edges[1:], 3) - np.power(self.edges[:-1], 3) + vol *= 4/3.0 * np.pi + + # Empty lists to restore indices, RDF + indices = [] + rdf = [] + + for i, (ag1, ag2) in enumerate(self.ags): + # Number of each selection + nA = len(ag1) + nB = len(ag2) + N = nA * nB + indices.append([ag1.indices, ag2.indices]) + + # Average number density + box_vol = self.volume / self.n_frames + density = N / box_vol + + if self._density: + rdf.append(self.count[i] / (density * vol * self.n_frames)) + else: + rdf.append(self.count[i] / (vol * self.n_frames)) + + self.rdf = rdf + self.indices = indices + + def get_cdf(self): + """Calculate the cumulative distribution functions (CDF) for all sites. + Note that this is the actual count within a given radius, i.e., + :math:`N(r)`. + Returns + ------- + cdf : list + list of arrays with the same structure as :attr:`rdf` + """ + # Calculate cumulative distribution function + # Empty list to restore CDF + cdf = [] + + for count in self.count: + cdf.append(np.cumsum(count, axis=2) / self.n_frames) + + # Results stored in self.cdf + # self.cdf is a list of cdf between pairs of AtomGroups in ags + self.cdf = cdf + + return cdf diff --git a/package/MDAnalysis/analysis/rms.py b/package/MDAnalysis/analysis/rms.py index b28da093c2a..1e3fefd29d1 100644 --- a/package/MDAnalysis/analysis/rms.py +++ b/package/MDAnalysis/analysis/rms.py @@ -136,16 +136,17 @@ from six.moves import zip from six import string_types + import numpy as np + import logging import warnings - import MDAnalysis.lib.qcprot as qcp from MDAnalysis.analysis.base import AnalysisBase from MDAnalysis.exceptions import SelectionError, NoDataError -from MDAnalysis.lib.log import ProgressMeter, _set_verbose -from MDAnalysis.lib.util import asiterable, iterable, get_weights +from MDAnalysis.lib.log import ProgressMeter +from MDAnalysis.lib.util import asiterable, iterable, get_weights, deprecate logger = logging.getLogger('MDAnalysis.analysis.rmsd') @@ -325,6 +326,7 @@ class RMSD(AnalysisBase): def __init__(self, atomgroup, reference=None, select='all', groupselections=None, filename="rmsd.dat", weights=None, tol_mass=0.1, ref_frame=0, **kwargs): + # DEPRECATION: remove filename kwarg in 1.0 r"""Parameters ---------- atomgroup : AtomGroup or Universe @@ -368,17 +370,12 @@ def __init__(self, atomgroup, reference=None, select='all', .. Note:: Experimental feature. Only limited error checking implemented. - - start : int (optional) - starting frame, default None becomes 0. - stop : int (optional) - Frame index to stop analysis. Default: None becomes - n_frames. Iteration stops *before* this frame number, - which means that the trajectory would be read until the end. - step : int (optional) - step between frames, default ``None`` becomes 1. filename : str (optional) write RMSD into file with :meth:`RMSD.save` + + .. deprecated:; 0.19.0 + `filename` will be removed together with :meth:`save` in 1.0. + weights : {"mass", ``None``} or array_like (optional) choose weights. With ``"mass"`` uses masses as weights; with ``None`` weigh each atom equally. If a float array of the same length as @@ -460,6 +457,8 @@ def __init__(self, atomgroup, reference=None, select='all', .. versionchanged:: 0.17.0 removed deprecated `mass_weighted` keyword; `groupselections` are *not* rotationally superimposed any more. + .. deprecated:: 0.19.0 + `filename` will be removed in 1.0 """ super(RMSD, self).__init__(atomgroup.universe.trajectory, @@ -473,7 +472,7 @@ def __init__(self, atomgroup, reference=None, select='all', self.weights = weights self.tol_mass = tol_mass self.ref_frame = ref_frame - self.filename = filename + self.filename = filename # DEPRECATED in 0.19.0, remove in 1.0.0 self.ref_atoms = self.reference.select_atoms(*select['reference']) self.mobile_atoms = self.atomgroup.select_atoms(*select['mobile']) @@ -645,6 +644,9 @@ def _single_frame(self): self._pm.rmsd = self.rmsd[self._frame_index, 2] + @deprecate(release="0.19.0", remove="1.0.0", + message="You can instead use " + "``np.savetxt(filename, RMSD.rmsd)``.") def save(self, filename=None): """Save RMSD from :attr:`RMSD.rmsd` to text file *filename*. @@ -653,6 +655,7 @@ def save(self, filename=None): filename : str (optional) if no filename is given the default provided to the constructor is used. + """ filename = filename or self.filename if filename is not None: @@ -798,20 +801,6 @@ def __init__(self, atomgroup, **kwargs): super(RMSF, self).__init__(atomgroup.universe.trajectory, **kwargs) self.atomgroup = atomgroup - def run(self, start=None, stop=None, step=None, verbose=None, quiet=None): - """Perform the analysis.""" - - if any([el is not None for el in (start, stop, step, quiet)]): - warnings.warn("run arguments are deprecated. Please pass them at " - "class construction. These options will be removed in 0.17.0", - category=DeprecationWarning) - verbose = _set_verbose(verbose, quiet, default=False) - # regenerate class with correct args - super(RMSF, self).__init__(self.atomgroup.universe.trajectory, - start=start, stop=stop, step=step, - verbose=verbose) - return super(RMSF, self).run() - def _prepare(self): self.sumsquares = np.zeros((self.atomgroup.n_atoms, 3)) self.mean = self.sumsquares.copy() diff --git a/package/MDAnalysis/analysis/waterdynamics.py b/package/MDAnalysis/analysis/waterdynamics.py index 72f5d14bf04..efc2b5949b2 100644 --- a/package/MDAnalysis/analysis/waterdynamics.py +++ b/package/MDAnalysis/analysis/waterdynamics.py @@ -283,23 +283,24 @@ import MDAnalysis from MDAnalysis.analysis.waterdynamics import SurvivalProbability as SP + import matplotlib.pyplot as plt - u = MDAnalysis.Universe(pdb, trajectory) + universe = MDAnalysis.Universe(pdb, trajectory) selection = "byres name OH2 and sphzone 12.3 (resid 42 or resid 26 or resid 34 or resid 80) " - SP_analysis = SP(universe, selection, 0, 100, 20) - SP_analysis.run() - #now we print data ready to graph. The graph - #represents SP vs t - time = 0 - for sp in SP_analysis.timeseries: - print("{time} {sp}".format(time=time, sp=sp)) - time += 1 + sp = SP(universe, selection, verbose=True) + sp.run(start=0, stop=100, tau_max=20) + tau_timeseries = sp.tau_timeseries + sp_timeseries = sp.sp_timeseries - #Plot - plt.xlabel('time') + # print in console + for tau, sp in zip(tau_timeseries, sp_timeseries): + print("{time} {sp}".format(time=tau, sp=sp)) + + # plot + plt.xlabel('Time') plt.ylabel('SP') plt.title('Survival Probability') - plt.plot(range(0,time),MSD_analysis.timeseries) + plt.plot(taus, sp_timeseries) plt.show() @@ -376,16 +377,13 @@ SurvivalProbability ~~~~~~~~~~~~~~~~~~~ -Survival Probability (SP) data is returned in a list, which each element -represents a SP value in its respective window timestep. Data is stored in -:attr:`SurvivalProbability.timeseries`:: - - results = [ - # SP values order by window timestep - , , ... - ] +Survival Probability (SP) computes two lists: a list of taus (:attr:`SurvivalProbability.tau_timeseries`) and a list of their corresponding mean survival +probabilities (:attr:`SurvivalProbability.sp_timeseries`). Additionally, a list :attr:`SurvivalProbability.sp_timeseries_data` is provided which contains +a list of SPs for each tau, which can be used to compute their distribution, etc. + results = [ tau1, tau2, ..., tau_n ], [ sp_tau1, sp_tau2, ..., sp_tau_n] +Additionally, for each Classes -------- @@ -412,13 +410,16 @@ """ from __future__ import print_function, division, absolute_import + +import warnings + from six.moves import range, zip_longest import numpy as np import multiprocessing import MDAnalysis.analysis.hbonds -from MDAnalysis.lib.log import _set_verbose, ProgressMeter +from MDAnalysis.lib.log import ProgressMeter class HydrogenBondLifetimes(object): @@ -595,11 +596,10 @@ def _getGraphics(self, HBP, t0, tf, maxdt): return a def _HBA(self, ts, conn, universe, selAtom1, selAtom2, - verbose=None, quiet=None): + verbose=False): """ Main function for calculate C_i and C_c in parallel. """ - verbose = _set_verbose(verbose, quiet, default=False) finalGetResidue1 = selAtom1 finalGetResidue2 = selAtom2 frame = ts.frame @@ -1185,7 +1185,8 @@ class SurvivalProbability(object): P(\tau) = \frac1T \sum_{t=1}^T \frac{N(t,t+\tau)}{N(t)} where :math:`T` is the maximum time of simulation, :math:`\tau` is the - timestep and :math:`N` the number of particles in certain time. + timestep, :math:`N(t)` the number of particles at time t, and + :math:`N(t, t+\tau)` is the number of particles at every frame from t to `\tau`. Parameters @@ -1194,99 +1195,111 @@ class SurvivalProbability(object): Universe object selection : str Selection string; any selection is allowed. With this selection you - define the region/zone where to analyze, e.g.: "selection_a" and "zone" - (see `SP-examples`_ ) - t0 : int - frame where analysis begins - tf : int - frame where analysis ends - dtmax : int - Maximum dt size, `dtmax` < `tf` or it will crash. + define the region/zone where to analyze, e.g.: "resname SOL and around 5 (resname LIPID)" + and "resname ION and around 10 (resid 20)" (see `SP-examples`_ ) + verbose : Boolean + If True, prints progress and comments to the console. .. versionadded:: 0.11.0 """ - def __init__(self, universe, selection, t0, tf, dtmax): + def __init__(self, universe, selection, t0=None, tf=None, dtmax=None, verbose=False): self.universe = universe self.selection = selection - self.t0 = t0 - self.tf = tf - self.dtmax = dtmax - self.timeseries = [] + self.verbose = verbose + # backward compatibility + self.start = self.stop = self.tau_max = None + if t0 is not None: + self.start = t0 + warnings.warn("t0 is deprecated, use run(start=t0) instead", category=DeprecationWarning) - def run(self): - """Analyze trajectory and produce timeseries""" + if tf is not None: + self.stop = tf + warnings.warn("tf is deprecated, use run(stop=tf) instead", category=DeprecationWarning) - # select all frames to an array - selected = self._selection_serial(self.universe, self.selection) + if dtmax is not None: + self.tau_max = dtmax + warnings.warn("dtmax is deprecated, use run(tau_max=dtmax) instead", category=DeprecationWarning) - if len(selected) < self.dtmax: - print ("ERROR: Cannot select fewer frames than dtmax") - return + def print(self, verbose, *args): + if self.verbose: + print(args) + elif verbose: + print(args) - for window_size in list(range(1, self.dtmax + 1)): - output = self._getMeanOnePoint(selected, window_size) - self.timeseries.append(output) + def run(self, tau_max=20, start=0, stop=None, step=1, verbose=False): + """ + Computes and returns the survival probability timeseries + + Parameters + ---------- + start : int + Zero-based index of the first frame to be analysed + stop : int + Zero-based index of the last frame to be analysed (inclusive) + step : int + Jump every `step`'th frame + tau_max : int + Survival probability is calculated for the range :math:`1 <= \tau <= tau_max` + verbose : Boolean + Overwrite the constructor's verbosity + + Returns + ------- + tau_timeseries : list + tau from 1 to tau_max. Saved in the field tau_timeseries. + sp_timeseries : list + survival probability for each value of `tau`. Saved in the field sp_timeseries. + """ + # backward compatibility (and priority) + start = self.start if self.start is not None else start + stop = self.stop if self.stop is not None else stop + tau_max = self.tau_max if self.tau_max is not None else tau_max - def _selection_serial(self, universe, selection_str): - selected = [] - pm = ProgressMeter(self.tf-self.t0, interval=10, - verbose=True, offset=-self.t0) - for ts in universe.trajectory[self.t0:self.tf]: - selected.append(universe.select_atoms(selection_str)) - pm.echo(ts.frame) - return selected + # sanity checks + if stop is not None and stop >= len(self.universe.trajectory): + raise ValueError("\"stop\" must be smaller than the number of frames in the trajectory.") + if stop is None: + stop = len(self.universe.trajectory) + else: + stop = stop + 1 - def _getMeanOnePoint(self, selected, window_size): - """ - This function gets one point of the plot P(t) vs t. It uses the - _getOneDeltaPoint() function to calculate the average. - """ - n = 0 - sumDeltaP = 0.0 - for frame_no in range(len(selected) - window_size): - delta = self._getOneDeltaPoint(selected, frame_no, window_size) - sumDeltaP += delta - n += 1 + if tau_max > (stop - start): + raise ValueError("Too few frames selected for given tau_max.") - return sumDeltaP/n + # load all frames to an array of sets + selected_ids = [] + for ts in self.universe.trajectory[start:stop]: + self.print(verbose, "Loading frame:", ts) + selected_ids.append(set(self.universe.select_atoms(self.selection).ids)) + tau_timeseries = np.arange(1, tau_max + 1) + sp_timeseries_data = [[] for _ in range(tau_max)] - def _getOneDeltaPoint(self, selected, t, tau): - """ - Gives one point to calculate the mean and - gets one point of the plot C_vect vs t. - - Ex: t=1 and tau=1 calculates - how many selected water molecules survive from the frame 1 to 2 - - Ex: t=5 and tau=3 calculates - how many selected water molecules survive from the frame 5 to 8 - """ + for t in range(0, len(selected_ids), step): + Nt = len(selected_ids[t]) - Nt = len(selected[t]) - if Nt == 0: - return 0 + if Nt == 0: + self.print(verbose, + "At frame {} the selection did not find any molecule. Moving on to the next frame".format(t)) + continue - # fraction of water molecules that survived - Ntau = self._NumPart_tau(selected, t, tau) - return Ntau/Nt + for tau in tau_timeseries: + if t + tau >= len(selected_ids): + break + # ids that survive from t to t + tau and at every frame in between + Ntau = len(set.intersection(*selected_ids[t:t + tau + 1])) + sp_timeseries_data[tau - 1].append(Ntau / float(Nt)) - def _NumPart_tau(self, selected, t, tau): - """ - Compares the molecules in t selection and t+tau selection and - select only the particles that remain from t to t+tau and - at each point in between. - It returns the number of remaining particles. - """ - survivors = set(selected[t]) - i = 0 - while (t + i) < t + tau and (t + i) < len(selected): - next = set(selected[t + i]) - survivors = survivors.intersection(next) - i += 1 - return len(survivors) \ No newline at end of file + # user can investigate the distribution and sample size + self.sp_timeseries_data = sp_timeseries_data + + self.tau_timeseries = tau_timeseries + self.sp_timeseries = [np.mean(sp) for sp in sp_timeseries_data] + return self diff --git a/package/MDAnalysis/auxiliary/XVG.py b/package/MDAnalysis/auxiliary/XVG.py index 1bf5c369f1f..7db55ef1528 100644 --- a/package/MDAnalysis/auxiliary/XVG.py +++ b/package/MDAnalysis/auxiliary/XVG.py @@ -366,4 +366,3 @@ def read_all_times(self): for step in self: times.append(self.time) return np.array(times) - diff --git a/package/MDAnalysis/auxiliary/core.py b/package/MDAnalysis/auxiliary/core.py index 15e0f4398f7..643f88c62fc 100644 --- a/package/MDAnalysis/auxiliary/core.py +++ b/package/MDAnalysis/auxiliary/core.py @@ -105,4 +105,3 @@ def auxreader(auxdata, format=None, **kwargs): """ reader = get_auxreader_for(auxdata, format=format) return reader(auxdata, **kwargs) - diff --git a/package/MDAnalysis/coordinates/GMS.py b/package/MDAnalysis/coordinates/GMS.py index f689914d6b7..c52076cdb3d 100644 --- a/package/MDAnalysis/coordinates/GMS.py +++ b/package/MDAnalysis/coordinates/GMS.py @@ -264,5 +264,3 @@ def close(self): return self.outfile.close() self.outfile = None - - diff --git a/package/MDAnalysis/coordinates/GRO.py b/package/MDAnalysis/coordinates/GRO.py index 9b23014f705..d3e85ff5b91 100644 --- a/package/MDAnalysis/coordinates/GRO.py +++ b/package/MDAnalysis/coordinates/GRO.py @@ -468,8 +468,5 @@ def write(self, obj): tri_dims = obj.triclinic_dimensions # full output - box = self.convert_pos_to_native( - tri_dims.flatten(), inplace=False) - output_gro.write(self.fmt['box_triclinic'].format( - box=box) - ) + box = self.convert_pos_to_native(tri_dims.flatten(), inplace=False) + output_gro.write(self.fmt['box_triclinic'].format(box=box)) diff --git a/package/MDAnalysis/coordinates/GSD.py b/package/MDAnalysis/coordinates/GSD.py index 9db0bb3b77d..860790d763f 100644 --- a/package/MDAnalysis/coordinates/GSD.py +++ b/package/MDAnalysis/coordinates/GSD.py @@ -47,9 +47,11 @@ from __future__ import absolute_import, division import numpy as np -from . import base -import gsd.hoomd +import os +if os.name != 'nt': + import gsd.hoomd +from . import base class GSDReader(base.ReaderBase): """Reader for the GSD format. @@ -70,6 +72,9 @@ def __init__(self, filename, **kwargs): .. versionadded:: 0.17.0 """ + if os.name == 'nt': + raise NotImplementedError("GSD format not supported on Windows") + super(GSDReader, self).__init__(filename, **kwargs) self.filename = filename self.open_trajectory() diff --git a/package/MDAnalysis/coordinates/LAMMPS.py b/package/MDAnalysis/coordinates/LAMMPS.py index e5d14fcbd29..ce35656c437 100644 --- a/package/MDAnalysis/coordinates/LAMMPS.py +++ b/package/MDAnalysis/coordinates/LAMMPS.py @@ -24,8 +24,8 @@ """LAMMPS DCD trajectory and DATA I/O --- :mod:`MDAnalysis.coordinates.LAMMPS` =============================================================================== -Classes to read and write LAMMPS_ DCD binary trajectories and LAMMPS DATA -files. Trajectories can be read regardless of system-endianness +Classes to read and write LAMMPS_ DCD binary trajectories, LAMMPS DATA files +and LAMMPS dump files. Trajectories can be read regardless of system-endianness as this is auto-detected. LAMMPS can `write DCD`_ trajectories but unlike a `CHARMM trajectory`_ @@ -51,6 +51,12 @@ By default either the `atomic` or `full` atom styles are expected, however this can be customised, see :ref:`atom_style_kwarg`. +Dump files +---------- + +The DumpReader expects ascii dump files written with the default +`LAMMPS dump format`_ of 'atom' + Example: Loading a LAMMPS simulation ------------------------------------ @@ -95,6 +101,7 @@ .. _units command: http://lammps.sandia.gov/doc/units.html .. _`Issue 64`: https://github.com/MDAnalysis/mdanalysis/issues/64 .. _`Issue 84`: https://github.com/MDAnalysis/mdanalysis/issues/84 +.. _`LAMMPS dump format`: http://lammps.sandia.gov/doc/dump.html Classes ------- @@ -115,12 +122,14 @@ """ from __future__ import absolute_import -from six.moves import zip, range +from six.moves import zip, range, map +import os import numpy as np from ..core import flags from ..core.groups import requires -from ..lib import util, mdamath +from ..lib import util, mdamath, distances +from ..lib.util import cached from . import DCD from .. import units from ..topology.LAMMPSParser import DATAParser @@ -443,3 +452,124 @@ def write(self, selection, frame=None): if has_velocities: self._write_velocities(atoms) + + +class DumpReader(base.ReaderBase): + """Reads the default `LAMMPS dump format`_ + + Expects trajectories produced by the default 'atom' style dump. + + Will automatically convert positions from their scaled/fractional + representation to their real values. + + .. versionadded:: 0.19.0 + """ + format = 'LAMMPSDUMP' + + def __init__(self, filename, **kwargs): + super(DumpReader, self).__init__(filename, **kwargs) + + root, ext = os.path.splitext(self.filename) + self._cache = {} + + self._reopen() + + self._read_next_timestep() + + def _reopen(self): + self.close() + self._file = util.anyopen(self.filename) + self.ts = self._Timestep(self.n_atoms, **self._ts_kwargs) + self.ts.frame = -1 + + @property + @cached('n_atoms') + def n_atoms(self): + with util.anyopen(self.filename) as f: + f.readline() + f.readline() + f.readline() + n_atoms = int(f.readline()) + return n_atoms + + @property + @cached('n_frames') + def n_frames(self): + # 2(timestep) + 2(natoms info) + 4(box info) + 1(atom header) + n_atoms + lines_per_frame = self.n_atoms + 9 + offsets = [] + counter = 0 + with util.anyopen(self.filename) as f: + line = True + while line: + if not counter % lines_per_frame: + offsets.append(f.tell()) + line = f.readline() + counter += 1 + self._offsets = offsets[:-1] # last is EOF + return len(self._offsets) + + def close(self): + if hasattr(self, '_file'): + self._file.close() + + def _read_frame(self, frame): + self._file.seek(self._offsets[frame]) + self.ts.frame = frame - 1 # gets +1'd in next + + return self._read_next_timestep() + + def _read_next_timestep(self): + f = self._file + ts = self.ts + ts.frame += 1 + if ts.frame >= len(self): + raise EOFError + + f.readline() # ITEM TIMESTEP + step_num = int(f.readline()) + ts.data['step'] = step_num + + f.readline() # ITEM NUMBER OF ATOMS + n_atoms = int(f.readline()) + if n_atoms != self.n_atoms: + raise ValueError("Number of atoms in trajectory changed " + "this is not suported in MDAnalysis") + + triclinic = len(f.readline().split()) == 9 # ITEM BOX BOUNDS + if triclinic: + xlo, xhi, xy = map(float, f.readline().split()) + ylo, yhi, xz = map(float, f.readline().split()) + zlo, zhi, yz = map(float, f.readline().split()) + + box = np.zeros((3, 3), dtype=np.float64) + box[0] = xhi - xlo, 0.0, 0.0 + box[1] = xy, yhi - ylo, 0.0 + box[2] = xz, yz, zhi - zlo + + xlen, ylen, zlen, alpha, beta, gamma = mdamath.triclinic_box(*box) + else: + xlo, xhi = map(float, f.readline().split()) + ylo, yhi = map(float, f.readline().split()) + zlo, zhi = map(float, f.readline().split()) + xlen = xhi - xlo + ylen = yhi - ylo + zlen = zhi - zlo + alpha = beta = gamma = 90. + ts.dimensions = xlen, ylen, zlen, alpha, beta, gamma + + indices = np.zeros(self.n_atoms, dtype=int) + + f.readline() # ITEM ATOMS etc + for i in range(self.n_atoms): + idx, _, xs, ys, zs = f.readline().split() + + indices[i] = idx + ts.positions[i] = xs, ys, zs + + order = np.argsort(indices) + ts.positions = ts.positions[order] + # by default coordinates are given in scaled format, undo that + ts.positions = distances.transform_StoR(ts.positions, ts.dimensions) + + return ts diff --git a/package/MDAnalysis/coordinates/MMTF.py b/package/MDAnalysis/coordinates/MMTF.py index 7f98252f5d8..8b1533fb56e 100644 --- a/package/MDAnalysis/coordinates/MMTF.py +++ b/package/MDAnalysis/coordinates/MMTF.py @@ -44,6 +44,7 @@ from . import base from ..core.universe import Universe +from ..due import due, Doi def _parse_mmtf(fn): @@ -57,6 +58,11 @@ class MMTFReader(base.SingleFrameReaderBase): """Coordinate reader for the Macromolecular Transmission Format format (MMTF_).""" format = 'MMTF' + @due.dcite( + Doi('10.1371/journal.pcbi.1005575'), + description="MMTF Reader", + path='MDAnalysis.coordinates.MMTF', + ) def _read_first_frame(self): # TOOD: Check units? if isinstance(self.filename, mmtf.MMTFDecoder): diff --git a/package/MDAnalysis/coordinates/PDB.py b/package/MDAnalysis/coordinates/PDB.py index b5d207118ab..83f9b504f00 100644 --- a/package/MDAnalysis/coordinates/PDB.py +++ b/package/MDAnalysis/coordinates/PDB.py @@ -136,7 +136,7 @@ .. _`PDB 3.2 standard`: - http://www.wwpdb.org/documentation/format32/v3.2.html + http://www.wwpdb.org/documentation/file-format-content/format32/v3.2.html """ from __future__ import absolute_import @@ -180,11 +180,11 @@ class PDBReader(base.ReaderBase): Reads multi-`MODEL`_ PDB files as trajectories. .. _PDB-formatted: - http://www.wwpdb.org/documentation/file-format-content/format33/v3.3.html + http://www.wwpdb.org/documentation/file-format-content/format32/v3.2.html .. _PDB coordinate section: - http://www.wwpdb.org/documentation/format32/sect9.html + http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html .. _MODEL: - http://www.wwpdb.org/documentation/format32/sect9.html#MODEL + http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#MODEL ============= ============ =========== ============================================= COLUMNS DATA TYPE FIELD DEFINITION @@ -275,16 +275,27 @@ def __init__(self, filename, **kwargs): pdbfile = self._pdbfile = util.anyopen(filename) line = "magical" + # we handle windows file striding uniquely + # because file.tell() is not reliable on Windows + # for a text file and binary mode is not compatible + # with i.e., our use of anyopen for zip files + windows_overbyte = 0 while line: # need to use readline so tell gives end of line # (rather than end of current chunk) line = pdbfile.readline() + # the tell() text opaque number striding is not portable + # to windows so compensate accordingly + if os.name == 'nt': + # for a text file mode these aren't necessarily + # bytes; var name for simplicity only + windows_overbyte += 1 if line.startswith('MODEL'): - models.append(pdbfile.tell()) + models.append(pdbfile.tell() - windows_overbyte) elif line.startswith('CRYST1'): # remove size of line to get **start** of CRYST line - crysts.append(pdbfile.tell() - len(line)) + crysts.append(pdbfile.tell() - len(line) - windows_overbyte) elif line.startswith('HEADER'): # classification = line[10:50] # date = line[50:59] @@ -417,14 +428,26 @@ class PDBWriter(base.WriterBase): multiple models (using the MODEL_ and ENDMDL_ records). .. _`PDB 3.2 standard`: - http://www.wwpdb.org/documentation/format32/v3.2.html - .. _MODEL: http://www.wwpdb.org/documentation/format32/sect9.html#MODEL - .. _ENDMDL: http://www.wwpdb.org/documentation/format32/sect9.html#ENDMDL - .. _CONECT: http://www.wwpdb.org/documentation/format32/sect10.html#CONECT + http://www.wwpdb.org/documentation/file-format-content/format32/v3.2.html + .. _MODEL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#MODEL + .. _ENDMDL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#ENDMDL + .. _CONECT: http://www.wwpdb.org/documentation/file-format-content/format32/sect10.html#CONECT Note ---- + Writing bonds currently only works when writing a whole :class:`Universe` + and if bond information is available in the topology. (For selections + smaller than the whole :class:`Universe`, the atom numbering in the CONECT_ + records would not match the numbering of the atoms in the new PDB file and + therefore a :exc:`NotImplementedError` is raised.) + + The maximum frame number that can be stored in a PDB file is 9999 and it + will wrap around (see :meth:`MODEL` for further details). + + + See Also + -------- This class is identical to :class:`MultiPDBWriter` with the one exception that it defaults to writing single-frame PDB files as if `multiframe` = ``False`` was selected. @@ -455,7 +478,7 @@ class PDBWriter(base.WriterBase): 'COMPND': "COMPND {0}\n", 'HEADER': "HEADER {0}\n", 'TITLE': "TITLE {0}\n", - 'MODEL': "MODEL {0:5d}\n", + 'MODEL': "MODEL {0:>4d}\n", 'NUMMDL': "NUMMDL {0:5d}\n", 'ENDMDL': "ENDMDL\n", 'END': "END\n", @@ -510,7 +533,8 @@ def __init__(self, filename, bonds="conect", n_atoms=None, start=0, step=1, filename: str name of output file start: int (optional) - starting timestep + starting timestep (the first frame will have MODEL number `start` + 1 + because the PDB standard prescribes MODEL numbers starting at 1) step: int (optional) skip between subsequent timesteps remarks: str (optional) @@ -531,19 +555,10 @@ def __init__(self, filename, bonds="conect", n_atoms=None, start=0, step=1, multi frame PDB file in which frames are written as MODEL_ ... ENDMDL_ records. If ``None``, then the class default is chosen. [``None``] - Note - ---- - Writing bonds currently only works when writing a whole - :class:`Universe` and if bond information is available in the topology. - (For selections smaller than the whole :class:`Universe`, the atom - numbering in the CONECT_ records would not match the numbering of the - atoms in the new PDB file and therefore a :exc:`NotImplementedError` is - raised.) - - .. _CONECT: http://www.wwpdb.org/documentation/format32/sect10.html#CONECT - .. _MODEL: http://www.wwpdb.org/documentation/format32/sect9.html#MODEL - .. _ENDMDL: http://www.wwpdb.org/documentation/format32/sect9.html#ENDMDL + .. _CONECT: http://www.wwpdb.org/documentation/file-format-content/format32/sect10.html#CONECT + .. _MODEL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#MODEL + .. _ENDMDL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#ENDMDL """ # n_atoms = None : dummy keyword argument @@ -560,11 +575,10 @@ def __init__(self, filename, bonds="conect", n_atoms=None, start=0, step=1, self._multiframe = self.multiframe if multiframe is None else multiframe self.bonds = bonds - self.frames_written = 0 if start < 0: raise ValueError("'Start' must be a positive value") - self.start = start + self.start = self.frames_written = start self.step = step self.remarks = remarks @@ -585,7 +599,7 @@ def close(self): def _write_pdb_title(self): if self._multiframe: - self.TITLE("MDANALYSIS FRAMES FROM {0:d}, SKIP {1:d}: {2!s}" + self.TITLE("MDANALYSIS FRAMES FROM {0:d}, STEP {1:d}: {2!s}" "".format(self.start, self.step, self.remarks)) else: self.TITLE("MDANALYSIS FRAME {0:d}: {1!s}" @@ -751,7 +765,7 @@ def write_all_timesteps(self, obj): or a :class:`~MDAnalysis.core.universe.Universe`. The method writes the frames from the one specified as *start* until - the end, using a step of *skip* (*start* and *skip* are set in the + the end, using a step of *step* (*start* and *step* are set in the constructor). Thus, if *u* is a Universe then :: u.trajectory[-2] @@ -760,7 +774,7 @@ def write_all_timesteps(self, obj): will write a PDB trajectory containing the last 2 frames and :: - pdb = PDBWriter("out.pdb", u.atoms.n_atoms, start=12, skip=2) + pdb = PDBWriter("out.pdb", u.atoms.n_atoms, start=12, step=2) pdb.write_all_timesteps(u) will be writing frames 12, 14, 16, ... @@ -856,9 +870,9 @@ def _write_timestep(self, ts, multiframe=False): :class:`PDBWriter` is in single frame mode and no MODEL_ records are written. - .. _MODEL: http://www.wwpdb.org/documentation/format32/sect9.html#MODEL - .. _ENDMDL: http://www.wwpdb.org/documentation/format32/sect9.html#ENDMDL - .. _NUMMDL: http://www.wwpdb.org/documentation/format32/sect2.html#NUMMDL + .. _MODEL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#MODEL + .. _ENDMDL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#ENDMDL + .. _NUMMDL: http://www.wwpdb.org/documentation/file-format-content/format32/sect2.html#NUMMDL .. versionchanged:: 0.7.6 The *multiframe* keyword was added, which completely determines if @@ -915,7 +929,7 @@ def get_attr(attrname, default): vals['segID'] = segids[i][:4] vals['element'] = guess_atom_element(atomnames[i].strip())[:2] - # .. _ATOM: http://www.wwpdb.org/documentation/format32/sect9.html + # .. _ATOM: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#ATOM self.pdbfile.write(self.fmt['ATOM'].format(**vals)) if multiframe: self.ENDMDL() @@ -924,7 +938,7 @@ def get_attr(attrname, default): def HEADER(self, trajectory): """Write HEADER_ record. - .. _HEADER: http://www.wwpdb.org/documentation/format32/sect2.html#HEADER + .. _HEADER: http://www.wwpdb.org/documentation/file-format-content/format32/sect2.html#HEADER """ if not hasattr(trajectory, 'header'): @@ -935,7 +949,7 @@ def HEADER(self, trajectory): def TITLE(self, *title): """Write TITLE_ record. - .. _TITLE: http://www.wwpdb.org/documentation/format32/sect2.html + .. _TITLE: http://www.wwpdb.org/documentation/file-format-content/format32/sect2.html """ line = " ".join(title) # TODO: should do continuation automatically @@ -949,8 +963,8 @@ def REMARK(self, *remarks): See also `REMARK (update)`_. - .. _REMARK: http://www.wwpdb.org/documentation/format32/remarks1.html - .. _REMARK (update): http://www.wwpdb.org/documentation/format32/remarks2.html + .. _REMARK: http://www.wwpdb.org/documentation/file-format-content/format32/remarks1.html + .. _REMARK (update): http://www.wwpdb.org/documentation/file-format-content/format32/remarks2.html """ for remark in remarks: @@ -966,7 +980,7 @@ def COMPND(self, trajectory): def CRYST1(self, dimensions, spacegroup='P 1', zvalue=1): """Write CRYST1_ record. - .. _CRYST1: http://www.wwpdb.org/documentation/format32/sect8.html + .. _CRYST1: http://www.wwpdb.org/documentation/file-format-content/format32/sect8.html#CRYST1 """ self.pdbfile.write(self.fmt['CRYST1'].format( @@ -978,10 +992,21 @@ def CRYST1(self, dimensions, spacegroup='P 1', zvalue=1): def MODEL(self, modelnumber): """Write the MODEL_ record. - .. _MODEL: http://www.wwpdb.org/documentation/format32/sect9.html#MODEL + .. note:: + + The maximum MODEL number is limited to 9999 in the PDB + standard (i.e., 4 digits). If frame numbers are larger than + 9999, they will wrap around, i.e., 9998, 9999, 0, 1, 2, ... + + + .. _MODEL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#MODEL + + + .. versionchanged:: 0.19.0 + Maximum model number is enforced. """ - self.pdbfile.write(self.fmt['MODEL'].format(modelnumber)) + self.pdbfile.write(self.fmt['MODEL'].format(int(str(modelnumber)[-4:]))) def END(self): """Write END_ record. @@ -991,7 +1016,7 @@ def END(self): method right before closing the file it is recommended to *not* call :meth:`~PDBWriter.END` explicitly. - .. _END: http://www.wwpdb.org/documentation/format32/sect11.html#END + .. _END: http://www.wwpdb.org/documentation/file-format-content/format32/sect11.html#END """ if not self.has_END: @@ -1002,7 +1027,7 @@ def END(self): def ENDMDL(self): """Write the ENDMDL_ record. - .. _ENDMDL: http://www.wwpdb.org/documentation/format32/sect9.html#ENDMDL + .. _ENDMDL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#ENDMDL """ self.pdbfile.write(self.fmt['ENDMDL']) @@ -1010,7 +1035,7 @@ def ENDMDL(self): def CONECT(self, conect): """Write CONECT_ record. - .. _CONECT: http://www.wwpdb.org/documentation/format32/sect10.html#CONECT + .. _CONECT: http://www.wwpdb.org/documentation/file-format-content/format32/sect10.html#CONECT """ conect = ["{0:5d}".format(entry + 1) for entry in conect] @@ -1050,9 +1075,9 @@ class MultiPDBWriter(PDBWriter): and ENDMDL_ records). - .. _MODEL: http://www.wwpdb.org/documentation/format32/sect9.html#MODEL - .. _ENDMDL: http://www.wwpdb.org/documentation/format32/sect9.html#ENDMDL - .. _CONECT: http://www.wwpdb.org/documentation/format32/sect10.html#CONECT + .. _MODEL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#MODEL + .. _ENDMDL: http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html#ENDMDL + .. _CONECT: http://www.wwpdb.org/documentation/file-format-content/format32/sect10.html#CONECT See Also diff --git a/package/MDAnalysis/coordinates/PDBQT.py b/package/MDAnalysis/coordinates/PDBQT.py index 73a817d0f3a..f9e488542a2 100644 --- a/package/MDAnalysis/coordinates/PDBQT.py +++ b/package/MDAnalysis/coordinates/PDBQT.py @@ -59,7 +59,7 @@ class PDBQTReader(base.SingleFrameReaderBase): .. _PDB format documentation: - http://www.wwpdb.org/documentation/format32/sect9.html + http://www.wwpdb.org/documentation/file-format-content/format32/v3.2.html .. _AutoDOCK extensions: http://autodock.scripps.edu/faqs-help/faq/what-is-the-format-of-a-pdbqt-file @@ -192,7 +192,7 @@ def Writer(self, filename, **kwargs): class PDBQTWriter(base.WriterBase): """PDBQT writer that implements a subset of the PDB_ 3.2 standard and the PDBQT_ spec. - .. _PDB: http://www.wwpdb.org/documentation/file-format + .. _PDB: http://www.wwpdb.org/documentation/file-format-content/format32/v3.2.html .. _PDBQT: http://autodock.scripps.edu/faqs-help/faq/what-is-the-format-of-a-pdbqt-file """ @@ -302,18 +302,18 @@ def write(self, selection, frame=None): self.pdb_coor_limits["max"])) # Write title record - # http://www.wwpdb.org/documentation/format32/sect2.html + # http://www.wwpdb.org/documentation/file-format-content/format32/sect2.html line = "FRAME " + str(frame) + " FROM " + str(u.trajectory.filename) self.pdb.write(self.fmt['TITLE'].format(line)) # Write CRYST1 record - # http://www.wwpdb.org/documentation/format32/sect8.html + # http://www.wwpdb.org/documentation/file-format-content/format32/sect8.html box = self.convert_dimensions_to_unitcell(u.trajectory.ts) self.pdb.write(self.fmt['CRYST1'].format(box=box[:3], ang=box[3:], spacegroup='P 1', zvalue=1)) # Write atom records - # http://www.wwpdb.org/documentation/format32/sect9.html + # http://www.wwpdb.org/documentation/file-format-content/format32/sect9.html for serial, (pos, name, resname, chainid, resid, icode, occupancy, tempfactor, charge, element) in enumerate( zip(coor, attrs['names'], attrs['resnames'], attrs['chainids'], diff --git a/package/MDAnalysis/coordinates/TXYZ.py b/package/MDAnalysis/coordinates/TXYZ.py index 260d11d6ead..aa604b96ad0 100644 --- a/package/MDAnalysis/coordinates/TXYZ.py +++ b/package/MDAnalysis/coordinates/TXYZ.py @@ -74,12 +74,19 @@ def __init__(self, filename, **kwargs): root, ext = os.path.splitext(self.filename) self.xyzfile = util.anyopen(self.filename) self._cache = dict() - + # Check if file has box information saved + with util.openany(self.filename) as inp: + inp.readline() + line = inp.readline() + # If second line has float at second position, we have box info + try: + float(line.split()[1]) + except ValueError: + self.periodic = False + else: + self.periodic = True self.ts = self._Timestep(self.n_atoms, **self._ts_kwargs) - # Haven't quite figured out where to start with all the self._reopen() - # etc. - # (Also cannot just use seek() or reset() because that would break - # with urllib2.urlopen() streams) + self._read_next_timestep() @property @@ -103,6 +110,8 @@ def _read_xyz_n_frames(self): # the number of lines in the XYZ file will be 1 greater than the # number of atoms linesPerFrame = self.n_atoms + 1 + if self.periodic: + linesPerFrame += 1 counter = 0 offsets = [] @@ -134,6 +143,8 @@ def _read_next_timestep(self, ts=None): try: # we assume that there is only one header line per frame f.readline() + if self.periodic: + ts.dimensions = f.readline().split() # convert all entries at the end once for optimal speed tmp_buf = [] for i in range(self.n_atoms): diff --git a/package/MDAnalysis/coordinates/__init__.py b/package/MDAnalysis/coordinates/__init__.py index dfe69c3fdcf..8b58f434bd3 100644 --- a/package/MDAnalysis/coordinates/__init__.py +++ b/package/MDAnalysis/coordinates/__init__.py @@ -172,6 +172,8 @@ class can choose an appropriate reader automatically. +---------------+-----------+-------+------------------------------------------------------+ | LAMMPS [#a]_ | data | r | Single frame of coordinates read from .data files | +---------------+-----------+-------+------------------------------------------------------+ + | LAMMPS [#a]_ | lammpsdump| r | Ascii trajectory in atom style | + +---------------+-----------+-------+------------------------------------------------------+ | Gromacs | xtc | r/w | Compressed (lossy) xtc trajectory format. Module | | | | | :mod:`MDAnalysis.coordinates.XTC` | +---------------+-----------+-------+------------------------------------------------------+ @@ -500,7 +502,7 @@ class can choose an appropriate reader automatically. ``__getitem__(arg)`` advance to time step `arg` = `frame` and return :class:`Timestep`; or if `arg` is a - slice, then return an iterator over that part of the trajectory. + slice, then return an iterable over that part of the trajectory. The first functionality allows one to randomly access frames in the trajectory:: @@ -522,6 +524,9 @@ class can choose an appropriate reader automatically. The last example starts reading the trajectory at frame 1000 and reads every 100th frame until the end. + A sequence of indices or a mask of booleans can also be provided to index + a trajectory. + The performance of the ``__getitem__()`` method depends on the underlying trajectory reader and if it can implement random access to frames. In many cases this is not easily (or reliably) implementable and thus one is @@ -535,6 +540,10 @@ class can choose an appropriate reader automatically. :class:`MDAnalysis.coordinates.base.ProtoReader.__iter__` (which is always implemented) and other slices raise :exc:`TypeError`. + When indexed with a slice, a sequence of indices, or a mask of booleans, + the return value is an instance of :class:`FrameIteratorSliced` or + :class:`FrameIteratorIndices`. + ``parse_n_atoms(filename, **kwargs)`` Provide the number of atoms in the trajectory file, allowing the Reader to be used to provide an extremely minimal Topology. @@ -739,4 +748,3 @@ class can choose an appropriate reader automatically. from . import MMTF from . import GSD from . import null -from . import dummy diff --git a/package/MDAnalysis/coordinates/base.py b/package/MDAnalysis/coordinates/base.py index 1e20769c63d..8d9fa216bfd 100644 --- a/package/MDAnalysis/coordinates/base.py +++ b/package/MDAnalysis/coordinates/base.py @@ -279,6 +279,7 @@ def __init__(self, n_atoms, **kwargs): # set up aux namespace for adding auxiliary data self.aux = Namespace() + @classmethod def from_timestep(cls, other, **kwargs): """Create a copy of another Timestep, in the format of this Timestep @@ -588,7 +589,7 @@ def positions(self): .. versionchanged:: 0.11.0 - Now can raise :exc`NoDataError` when no position data present + Now can raise :exc:`NoDataError` when no position data present """ if self.has_positions: return self._pos @@ -858,6 +859,205 @@ def time(self): del self.data['time'] +class FrameIteratorBase(object): + """ + Base iterable over the frames of a trajectory. + + A frame iterable has a length that can be accessed with the :func:`len` + function, and can be indexed similarly to a full trajectory. When indexed, + indices are resolved relative to the iterable and not relative to the + trajectory. + + Parameters + ---------- + trajectory: ProtoReader + The trajectory over which to iterate. + + .. versionadded:: 0.19.0 + + """ + def __init__(self, trajectory): + self._trajectory = trajectory + + def __len__(self): + raise NotImplementedError() + + @staticmethod + def _avoid_bool_list(frames): + if isinstance(frames, list) and frames and isinstance(frames[0], bool): + return np.array(frames, dtype=bool) + return frames + + @property + def trajectory(self): + return self._trajectory + + +class FrameIteratorSliced(FrameIteratorBase): + """ + Iterable over the frames of a trajectory on the basis of a slice. + + Parameters + ---------- + trajectory: ProtoReader + The trajectory over which to iterate. + frames: slice + A slice to select the frames of interest. + + See Also + -------- + FrameIteratorBase + + .. versionadded:: 0.19.0 + + """ + def __init__(self, trajectory, frames): + # It would be easier to store directly a range object, as it would + # store its parameters in a single place, calculate its length, and + # take care of most the indexing. Though, doing so is not compatible + # with python 2 where xrange (or range with six) is only an iterator. + super(FrameIteratorSliced, self).__init__(trajectory) + self._start, self._stop, self._step = trajectory.check_slice_indices( + frames.start, frames.stop, frames.step, + ) + + def __len__(self): + start, stop, step = self.start, self.stop, self.step + if (step > 0 and start < stop): + # We go from a lesser number to a larger one. + return int(1 + (stop - 1 - start) // step) + elif (step < 0 and start > stop): + # We count backward from a larger number to a lesser one. + return int(1 + (start - 1 - stop) // (-step)) + else: + # The range is empty. + return 0 + + def __iter__(self): + for i in range(self.start, self.stop, self.step): + yield self.trajectory[i] + self.trajectory.rewind() + + def __getitem__(self, frame): + if isinstance(frame, numbers.Integral): + length = len(self) + if not -length < frame < length: + raise IndexError('Index {} is out of range of the range of length {}.' + .format(frame, length)) + if frame < 0: + frame = len(self) + frame + frame = self.start + frame * self.step + return self.trajectory._read_frame_with_aux(frame) + elif isinstance(frame, slice): + start = self.start + (frame.start or 0) * self.step + if frame.stop is None: + stop = self.stop + else: + stop = self.start + (frame.stop or 0) * self.step + step = (frame.step or 1) * self.step + + if step > 0: + start = max(0, start) + else: + stop = max(0, stop) + + new_slice = slice(start, stop, step) + return FrameIteratorSliced(self.trajectory, new_slice) + else: + # Indexing with a lists of bools does not behave the same in all + # version of numpy. + frame = self._avoid_bool_list(frame) + frames = np.array(list(range(self.start, self.stop, self.step)))[frame] + return FrameIteratorIndices(self.trajectory, frames) + + @property + def start(self): + return self._start + + @property + def stop(self): + return self._stop + + @property + def step(self): + return self._step + + +class FrameIteratorAll(FrameIteratorBase): + """ + Iterable over all the frames of a trajectory. + + Parameters + ---------- + trajectory: ProtoReader + The trajectory over which to iterate. + + See Also + -------- + FrameIteratorBase + + .. versionadded:: 0.19.0 + + """ + def __init__(self, trajectory): + super(FrameIteratorAll, self).__init__(trajectory) + + def __len__(self): + return self.trajectory.n_frames + + def __iter__(self): + return iter(self.trajectory) + + def __getitem__(self, frame): + return self.trajectory[frame] + + +class FrameIteratorIndices(FrameIteratorBase): + """ + Iterable over the frames of a trajectory listed in a sequence of indices. + + Parameters + ---------- + trajectory: ProtoReader + The trajectory over which to iterate. + frames: sequence + A sequence of indices. + + See Also + -------- + FrameIteratorBase + """ + def __init__(self, trajectory, frames): + super(FrameIteratorIndices, self).__init__(trajectory) + self._frames = [] + for frame in frames: + if not isinstance(frame, numbers.Integral): + raise TypeError("Frames indices must be integers.") + frame = trajectory._apply_limits(frame) + self._frames.append(frame) + self._frames = tuple(self._frames) + + def __len__(self): + return len(self.frames) + + def __iter__(self): + for frame in self.frames: + yield self.trajectory._read_frame_with_aux(frame) + + def __getitem__(self, frame): + if isinstance(frame, numbers.Integral): + frame = self.frames[frame] + return self.trajectory._read_frame_with_aux(frame) + else: + frame = self._avoid_bool_list(frame) + frames = np.array(self.frames)[frame] + return FrameIteratorIndices(self.trajectory, frames) + + @property + def frames(self): + return self._frames + + class IOBase(object): """Base class bundling common functionality for trajectory I/O. @@ -1170,6 +1370,7 @@ def __init__(self): # initialise list to store added auxiliary readers in # subclasses should now call super self._auxs = {} + self._transformations=[] def __len__(self): return self.n_frames @@ -1201,6 +1402,9 @@ def next(self): else: for auxname in self.aux_list: ts = self._auxs[auxname].update_ts(ts) + + ts = self._apply_transformations(ts) + return ts def __next__(self): @@ -1246,6 +1450,11 @@ def time(self): """ return self.ts.time + @property + def trajectory(self): + # Makes a reader effectively commpatible with a FrameIteratorBase + return self + def Writer(self, filename, **kwargs): """A trajectory writer with the same properties as this trajectory.""" raise NotImplementedError( @@ -1294,6 +1503,14 @@ def _reopen(self): """ pass + def _apply_limits(self, frame): + if frame < 0: + frame += len(self) + if frame < 0 or frame >= len(self): + raise IndexError("Index {} exceeds length of trajectory ({})." + "".format(frame, len(self))) + return frame + def __getitem__(self, frame): """Return the Timestep corresponding to *frame*. @@ -1307,39 +1524,23 @@ def __getitem__(self, frame): ---- *frame* is a 0-based frame index. """ - - def apply_limits(frame): - if frame < 0: - frame += len(self) - if frame < 0 or frame >= len(self): - raise IndexError("Index {} exceeds length of trajectory ({})." - "".format(frame, len(self))) - return frame - if isinstance(frame, numbers.Integral): - frame = apply_limits(frame) + frame = self._apply_limits(frame) return self._read_frame_with_aux(frame) elif isinstance(frame, (list, np.ndarray)): - if isinstance(frame[0], (bool, np.bool_)): + if len(frame) != 0 and isinstance(frame[0], (bool, np.bool_)): # Avoid having list of bools frame = np.asarray(frame, dtype=np.bool) # Convert bool array to int array frame = np.arange(len(self))[frame] - - def listiter(frames): - for f in frames: - if not isinstance(f, numbers.Integral): - raise TypeError("Frames indices must be integers") - yield self._read_frame_with_aux(apply_limits(f)) - - return listiter(frame) + return FrameIteratorIndices(self, frame) elif isinstance(frame, slice): start, stop, step = self.check_slice_indices( frame.start, frame.stop, frame.step) if start == 0 and stop == len(self) and step == 1: - return self.__iter__() + return FrameIteratorAll(self) else: - return self._sliced_iter(start, stop, step) + return FrameIteratorSliced(self, frame) else: raise TypeError("Trajectories must be an indexed using an integer," " slice or list of indices") @@ -1356,10 +1557,13 @@ def _read_frame(self, frame): # return ts def _read_frame_with_aux(self, frame): - """Move to *frame*, updating ts with trajectory and auxiliary data.""" - ts = self._read_frame(frame) + """Move to *frame*, updating ts with trajectory, transformations and auxiliary data.""" + ts = self._read_frame(frame) # pylint: disable=assignment-from-no-return for aux in self.aux_list: ts = self._auxs[aux].update_ts(ts) + + ts = self._apply_transformations(ts) + return ts def _sliced_iter(self, start, stop, step): @@ -1456,7 +1660,7 @@ def check_slice_indices(self, start, stop, step): if start < 0: start = 0 - if step < 0 and start > nframes: + if step < 0 and start >= nframes: start = nframes - 1 if stop is None: @@ -1742,6 +1946,66 @@ def get_aux_descriptions(self, auxnames=None): descriptions = [self._auxs[aux].get_description() for aux in auxnames] return descriptions + @property + def transformations(self): + """ Returns the list of transformations""" + return self._transformations + + @transformations.setter + def transformations(self, transformations): + if not self._transformations: + self._transformations = transformations + else: + raise ValueError("Transformations are already set") + + def add_transformations(self, *transformations): + """ Add all transformations to be applied to the trajectory. + + This function take as list of transformations as an argument. These + transformations are functions that will be called by the Reader and given + a :class:`Timestep` object as argument, which will be transformed and returned + to the Reader. + The transformations can be part of the :mod:`~MDAnalysis.transformations` + module, or created by the user, and are stored as a list `transformations`. + This list can only be modified once, and further calls of this function will + raise an exception. + + .. code-block:: python + + u = MDAnalysis.Universe(topology, coordinates) + workflow = [some_transform, another_transform, this_transform] + u.trajectory.add_transformations(*workflow) + + Parameters + ---------- + transform_list : list + list of all the transformations that will be applied to the coordinates + + See Also + -------- + :mod:`MDAnalysis.transformations` + """ + + try: + self.transformations = transformations + except ValueError: + raise ValueError("Can't add transformations again. Please create new Universe object") + else: + self.ts = self._apply_transformations(self.ts) + + + # call reader here to apply the newly added transformation on the + # current loaded frame? + + def _apply_transformations(self, ts): + """Applies all the transformations given by the user """ + + for transform in self.transformations: + ts = transform(ts) + + return ts + + class ReaderBase(ProtoReader): """Base class for trajectory readers that extends :class:`ProtoReader` with a @@ -1802,6 +2066,8 @@ def copy(self): """ new = self.__class__(self.filename, n_atoms=self.n_atoms) + if self.transformations: + new.add_transformations(*self.transformations) # seek the new reader to the same frame we started with new[self.ts.frame] # then copy over the current Timestep in case it has @@ -1976,6 +2242,10 @@ def copy(self): new.ts = self.ts.copy() for auxname, auxread in self._auxs.items(): new.add_auxiliary(auxname, auxread.copy()) + # since the transformations have already been applied to the frame + # simply copy the property + new.transformations = self.transformations + return new def _read_first_frame(self): # pragma: no cover @@ -1983,7 +2253,10 @@ def _read_first_frame(self): # pragma: no cover pass def rewind(self): - pass + self._read_first_frame() + for auxname, auxread in self._auxs.items(): + self.ts = auxread.update_ts(self.ts) + super(SingleFrameReaderBase, self)._apply_transformations(self.ts) def _reopen(self): pass @@ -2006,3 +2279,46 @@ def close(self): # self.filename. Explicitly setting it to the null action in case # the IOBase.close method is ever changed from that. pass + + def add_transformations(self, *transformations): + """ Add all transformations to be applied to the trajectory. + + This function take as list of transformations as an argument. These + transformations are functions that will be called by the Reader and given + a :class:`Timestep` object as argument, which will be transformed and returned + to the Reader. + The transformations can be part of the :mod:`~MDAnalysis.transformations` + module, or created by the user, and are stored as a list `transformations`. + This list can only be modified once, and further calls of this function will + raise an exception. + + .. code-block:: python + + u = MDAnalysis.Universe(topology, coordinates) + workflow = [some_transform, another_transform, this_transform] + u.trajectory.add_transformations(*workflow) + + Parameters + ---------- + transform_list : list + list of all the transformations that will be applied to the coordinates + + See Also + -------- + :mod:`MDAnalysis.transformations` + """ + #Overrides :meth:`~MDAnalysis.coordinates.base.ProtoReader.add_transformations` + #to avoid unintended behaviour where the coordinates of each frame are transformed + #multiple times when iterating over the trajectory. + #In this method, the trajectory is modified all at once and once only. + + super(SingleFrameReaderBase, self).add_transformations(*transformations) + for transform in self.transformations: + self.ts = transform(self.ts) + + def _apply_transformations(self, ts): + """ Applies the transformations to the timestep.""" + # Overrides :meth:`~MDAnalysis.coordinates.base.ProtoReader.add_transformations` + # to avoid applying the same transformations multiple times on each frame + + return ts diff --git a/package/MDAnalysis/coordinates/chain.py b/package/MDAnalysis/coordinates/chain.py index 9bbefa7ce36..176a79f29d2 100644 --- a/package/MDAnalysis/coordinates/chain.py +++ b/package/MDAnalysis/coordinates/chain.py @@ -56,6 +56,89 @@ from . import core +def multi_level_argsort(l): + """Return indices to sort a multi value tuple. Sorting is done on the first + value of the tuple. + + + Parameters + ---------- + l : list + + Returns + ------- + indices + + Example + ------- + >>> multi_level_argsort(((0, 2), (4, 9), (0, 4), (7, 9))) + [0, 2, 1, 3] + + """ + return [el[0] for el in sorted(enumerate(l), key=lambda x: x[1][0])] + + +def filter_times(times, dt): + """Given a list of start and end times this function filters out any duplicate + time steps preferring the last tuple. + + Parameters + ---------- + times : list + sorted list of times + dt : float + timestep between two frames + + Returns + ------- + list: + indices of times to be used with overlaps removed + + Example + ------- + >>> filter_times(((0, 3), (0, 3))) + [1, ] + >>> filter_times(((0, 3), (0, 4))) + [1, ] + >>> filter_times(((0, 3), (3, 4))) + [0, 1] + >>> filter_times(((0, 3), (2, 5), (4, 9))) + [1, 2, 3] + + """ + # Special cases + if len(times) == 1: + return [0, ] + elif len(times) == 2: + if times[0][0] < times[1][0]: + return [0, 1] + elif np.allclose(times[0][0], times[1][0]): + return [1, ] + else: + return [0, ] + if np.unique(times).size == 2: + return [len(times) - 1, ] + + # more then 2 unique time entries + + used_idx = [0, ] + + for i, (first, middle, last) in enumerate(zip(times[:-2], times[1:-1], times[2:]), start=1): + if np.allclose(first[0], middle[0]): + used_idx[-1] = i + elif not np.allclose(middle[1] - middle[0], dt): + if (middle[0] <= first[1]) and (last[0] <= middle[1]): + used_idx.append(i) + elif (middle[0] <= first[1]): + used_idx.append(i) + + # take care of first special case + if times[-2][1] <= times[-1][1]: + used_idx.append(len(times) - 1) + + return used_idx + + class ChainReader(base.ProtoReader): """Reader that concatenates multiple trajectories on the fly. @@ -63,6 +146,34 @@ class ChainReader(base.ProtoReader): represent multiple trajectories as one virtual trajectory. Users typically do not need to use the :class:`ChainReader` explicitly. + Chainreader can also handle a continuous trajectory split over several + files. To use this pass the ``continuous == True`` keyword argument. + Setting ``continuous=True`` will make the reader choose frames from the set + of trajectories in such a way that the trajectory appears to be as + continuous in time as possible, i.e. that time is strictly monotonically + increasing. This means that there will be no duplicate time frames and no + jumps backwards in time. However, there can be gaps in time (e.g., multiple + time steps can appear to be missing). Ultimately, it is the user's + responsibility to ensure that the input trajectories can be virtually + stitched together in a meaningful manner. As an example take the following + trajectory that is split into three parts. The column represents the time + and the trajectory segments overlap. With the continuous chainreader only + the frames marked with a + will be read. + + :: + + part01: ++++-- + part02: ++++++- + part03: ++++++++ + + .. warning:: + + The order in which trajectories are given to the chainreader can change + what frames are used with the continuous option. + + The default chainreader will read all frames. The continuous option is + currently only supported for XTC and TRR files. + Notes ----- The trajectory API attributes exist but most of them only reflect the first @@ -76,77 +187,80 @@ class ChainReader(base.ProtoReader): .. versionchanged:: 0.13.0 :attr:`time` now reports the time summed over each trajectory's frames and individual :attr:`dt`. + .. versionchanged:: 0.19.0 + added ``continuous`` trajectory option """ format = 'CHAIN' - def __init__(self, filenames, **kwargs): + def __init__(self, filenames, skip=1, dt=None, continuous=False, **kwargs): """Set up the chain reader. Parameters ---------- filenames : str or list or sequence - file name or list of file names; the reader will open all file names - and provide frames in the order of trajectories from the list. Each - trajectory must contain the same number of atoms in the same order - (i.e. they all must belong to the same topology). The trajectory - format is deduced from the extension of each file name. - - Extension: `filenames` are either a single file name or list of file - names in either plain file names format or ``(filename, format)`` - tuple combination. This allows explicit setting of the format for - each individual trajectory file. + file name or list of file names; the reader will open all file names + and provide frames in the order of trajectories from the list. Each + trajectory must contain the same number of atoms in the same order + (i.e. they all must belong to the same topology). The trajectory + format is deduced from the extension of each file name. + + Extension: `filenames` are either a single file name or list of file + names in either plain file names format or ``(filename, format)`` + tuple combination. This allows explicit setting of the format for + each individual trajectory file. skip : int (optional) - skip step (also passed on to the individual trajectory readers); - must be same for all trajectories + skip step (also passed on to the individual trajectory readers); + must be same for all trajectories dt : float (optional) - Passed to individual trajectory readers to enforce a common time - difference between frames, in MDAnalysis time units. If not set, each - reader's `dt` will be used (either inferred from the trajectory - files, or set to the reader's default) when reporting frame times; - note that this might lead an inconsistent time difference between - frames. + Passed to individual trajectory readers to enforce a common time + difference between frames, in MDAnalysis time units. If not set, each + reader's `dt` will be used (either inferred from the trajectory + files, or set to the reader's default) when reporting frame times; + note that this might lead an inconsistent time difference between + frames. + continuous : bool (optional) + treat all trajectories as one single long trajectory. Adds several + checks; all trajectories have the same dt, they contain at least 2 + frames, and they are all of the same file-type. Not implemented for + all trajectory formats! This can be used to analyze GROMACS + simulations without concatenating them prior to analysis. **kwargs : dict (optional) - all other keyword arguments are passed on to each trajectory reader - unchanged - - - .. versionchanged:: 0.8 - The ``delta`` keyword was added. - .. versionchanged:: 0.13 - The ``delta`` keyword was deprecated in favor of using ``dt``. + all other keyword arguments are passed on to each trajectory reader + unchanged """ super(ChainReader, self).__init__() - self.filenames = asiterable(filenames) + filenames = asiterable(filenames) + # Override here because single frame readers handle this argument as a + # kwarg to a timestep which behaves differently if dt is present or not. + if dt is not None: + kwargs['dt'] = dt self.readers = [core.reader(filename, **kwargs) - for filename in self.filenames] + for filename in filenames] + self.filenames = np.array([fn[0] if isinstance(fn, tuple) else fn for fn in filenames]) # pointer to "active" trajectory index into self.readers self.__active_reader_index = 0 - self.skip = kwargs.get('skip', 1) + self.skip = skip self.n_atoms = self._get_same('n_atoms') - #self.fixed = self._get_same('fixed') # Translation between virtual frames and frames in individual - # trajectories. - # Assumes that individual trajectories i contain frames that can - # be addressed with an index 0 <= f < n_frames[i] + # trajectories. Assumes that individual trajectories i contain frames + # that can be addressed with an index 0 <= f < n_frames[i] - # Build a map of frames: ordered list of starting virtual - # frames; the index i into this list corresponds to the index - # into self.readers + # Build a map of frames: ordered list of starting virtual frames; the + # index i into this list corresponds to the index into self.readers # # For virtual frame 0 <= k < sum(n_frames) find corresponding - # trajectory i and local frame f (i.e. readers[i][f] will - # correspond to ChainReader[k]). - + # trajectory i and local frame f (i.e. readers[i][f] will correspond to + # ChainReader[k]). # build map 'start_frames', which is used by _get_local_frame() n_frames = self._get('n_frames') # [0]: frames are 0-indexed internally # (see Timestep.check_slice_indices()) - self.__start_frames = np.cumsum([0] + n_frames) + self._start_frames = np.cumsum([0] + n_frames) self.n_frames = np.sum(n_frames) self.dts = np.array(self._get('dt')) @@ -155,6 +269,82 @@ def __init__(self, filenames, **kwargs): #: source for trajectories frame (fakes trajectory) self.__chained_trajectories_iter = None + # calculate new start_frames to have a time continuous trajectory. + if continuous: + filetypes = np.unique([r.format for r in self.readers]) + if not len(filetypes) == 1: + raise ValueError("ChainReader: continuous=true only supported" + " when all files are using the same format. " + "found {}".format(filetypes)) + if np.any(np.array(n_frames) == 1): + raise RuntimeError("ChainReader: Need at least two frames in " + "every trajectory with continuous=True") + if filetypes[0] not in ['XTC', 'TRR']: + raise NotImplementedError("ChainReader: continuous=True only " + "supported for xtc and trr format") + + # TODO: allow floating point precision in dt check + dt = self._get_same('dt') + n_frames = np.asarray(self._get('n_frames')) + self.dts = np.ones(self.dts.shape) * dt + + # the sorting needs to happen on two levels. The first major level + # is by start times and the second is by end times. + # The second level of sorting is needed for cases like: + # [0 1 2 3 4 5 6 7 8 9] [0 1 2 4] + # to + # [0 1 2 4] [0 1 2 3 4 5 6 7 8 9] + # after that sort the chain reader will work + times = [] + for r in self.readers: + r[0] + start = r.ts.time + r[-1] + end = r.ts.time + times.append((start, end)) + # sort step + sort_idx = multi_level_argsort(times) + self.readers = [self.readers[i] for i in sort_idx] + self.filenames = self.filenames[sort_idx] + self.total_times = self.dts * n_frames[sort_idx] + + # filter step: remove indices if we have complete overlap + if len(self.readers) > 1: + used_idx = filter_times(np.array(times)[sort_idx], dt) + + self.readers = [self.readers[i] for i in used_idx] + self.filenames = self.filenames[used_idx] + self.total_times = self.dts[used_idx] * n_frames[used_idx] + + # rebuild lookup table + sf = [0, ] + n_frames = 0 + for r1, r2 in zip(self.readers[:-1], self.readers[1:]): + r2[0], r1[0] + r1_start_time = r1.time + start_time = r2.time + r1[-1] + if r1.time < start_time: + warnings.warn("Missing frame in continuous chain", UserWarning) + + # check for interleaving + r1[1] + if r1_start_time < start_time < r1.time: + raise RuntimeError("ChainReader: Interleaving not supported with continuous=True.") + + # find end where trajectory was restarted from + for ts in r1[::-1]: + if ts.time < start_time: + break + sf.append(sf[-1] + ts.frame + 1) + n_frames += ts.frame + 1 + + n_frames += self.readers[-1].n_frames + + self._start_frames = sf + self.n_frames = n_frames + self._sf = sf + # make sure that iteration always yields frame 0 # rewind() also sets self.ts self.ts = None @@ -174,8 +364,11 @@ def _get_local_frame(self, k): Returns ------- - (i, f) : tuple - **local frame** tuple + i : int + trajectory + f : int + frame in trajectory i + Raises ------ @@ -191,11 +384,11 @@ def _get_local_frame(self, k): if k < 0: raise IndexError("Virtual (chained) frames must be >= 0") # trajectory index i - i = bisect.bisect_right(self.__start_frames, k) - 1 + i = bisect.bisect_right(self._start_frames, k) - 1 if i < 0: raise IndexError("Cannot find trajectory for virtual frame {0:d}".format(k)) # local frame index f in trajectory i (frame indices are 0-based) - f = k - self.__start_frames[i] + f = k - self._start_frames[i] return i, f # methods that can change with the current reader @@ -299,8 +492,8 @@ def _get_same(self, attr): """ values = np.array(self._get(attr)) value = values[0] - if not np.all(values == value): - bad_traj = np.array([self._get_filename(fn) for fn in self.filenames])[values != value] + if not np.allclose(values, value): + bad_traj = np.array(self.filenames)[values != value] raise ValueError("The following trajectories do not have the correct {0} " " ({1}):\n{2}".format(attr, value, bad_traj)) return value @@ -347,14 +540,12 @@ def _read_frame(self, frame): def _chained_iterator(self): """Iterator that presents itself as a chained trajectory.""" self._rewind() # must rewind all readers - readers = itertools.chain(*self.readers) - for frame, ts in enumerate(readers): - ts.frame = frame # fake continuous frames, 0-based - self.ts = ts - # make sure that the active reader is in sync - i, f = self._get_local_frame(frame) # uses 0-based frames! - self.__activate_reader(i) - yield ts + for i in range(self.n_frames): + j, f = self._get_local_frame(i) + self.__activate_reader(j) + self.ts = self.active_reader[f] + self.ts.frame = i + yield self.ts def _read_next_timestep(self, ts=None): self.ts = next(self.__chained_trajectories_iter) @@ -383,18 +574,53 @@ def __iter__(self): for ts in self.__chained_trajectories_iter: yield ts - @staticmethod - def _get_filename(filename): - """retrieve the actual filename of the list element""" - return filename[0] if isinstance(filename, tuple) else filename - def __repr__(self): return ("<{clsname} {fname} with {nframes} frames of {natoms} atoms>" "".format( clsname=self.__class__.__name__, - fname=[os.path.basename(self._get_filename(fn)) - for fn in self.filenames], + fname=[os.path.basename(fn) for fn in self.filenames], nframes=self.n_frames, natoms=self.n_atoms)) + def add_transformations(self, *transformations): + """ Add all transformations to be applied to the trajectory. + + This function take as list of transformations as an argument. These + transformations are functions that will be called by the Reader and given + a :class:`Timestep` object as argument, which will be transformed and returned + to the Reader. + The transformations can be part of the :mod:`~MDAnalysis.transformations` + module, or created by the user, and are stored as a list `transformations`. + This list can only be modified once, and further calls of this function will + raise an exception. + + .. code-block:: python + + u = MDAnalysis.Universe(topology, coordinates) + workflow = [some_transform, another_transform, this_transform] + u.trajectory.add_transformations(*workflow) + + Parameters + ---------- + transform_list : list + list of all the transformations that will be applied to the coordinates + + See Also + -------- + :mod:`MDAnalysis.transformations` + """ + #Overrides :meth:`~MDAnalysis.coordinates.base.ProtoReader.add_transformations` + #to avoid unintended behaviour where the coordinates of each frame are transformed + #multiple times when iterating over the trajectory. + #In this method, the trajectory is modified all at once and once only. + + super(ChainReader, self).add_transformations(*transformations) + for r in self.readers: + r.add_transformations(*transformations) + + def _apply_transformations(self, ts): + """ Applies the transformations to the timestep.""" + # Overrides :meth:`~MDAnalysis.coordinates.base.ProtoReader.add_transformations` + # to avoid applying the same transformations multiple times on each frame + return ts diff --git a/package/MDAnalysis/coordinates/dummy.py b/package/MDAnalysis/coordinates/dummy.py deleted file mode 100644 index c4550273c4c..00000000000 --- a/package/MDAnalysis/coordinates/dummy.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*- -# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 -# -# MDAnalysis --- https://www.mdanalysis.org -# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors -# (see the file AUTHORS for the full list of names) -# -# Released under the GNU Public Licence, v2 or any higher version -# -# Please cite your use of MDAnalysis in published work: -# -# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, -# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. -# MDAnalysis: A Python package for the rapid analysis of molecular dynamics -# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th -# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. -# -# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. -# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. -# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 -# - -""" -Dummy coordinate reader -======================= - - -Classes -------- - -.. autoclass:: DummyReader - :members: - - -""" -from __future__ import absolute_import - - -import numpy as np - -from .base import SingleFrameReaderBase - - -class DummyReader(SingleFrameReaderBase): - """Basic Reader which does not read from any file - - .. versionadded:: 0.17.0 - """ - format = 'dummy' - - def __init__(self, n_atoms=None, velocities=False, forces=False): - self.n_atoms = n_atoms - self.filename = 'DummyReader' - self.n_frames = 1 - self._read_first_frame(velocities, forces) - - def _read_first_frame(self, velocities=False, forces=False): - ts = self.ts = self._Timestep(self.n_atoms, positions=True, - velocities=velocities, forces=forces) - return ts diff --git a/package/MDAnalysis/coordinates/memory.py b/package/MDAnalysis/coordinates/memory.py index 50042bd93ac..ef11bde65d7 100644 --- a/package/MDAnalysis/coordinates/memory.py +++ b/package/MDAnalysis/coordinates/memory.py @@ -33,8 +33,8 @@ .. versionadded:: 0.16.0 The module contains a trajectory reader that operates on an array in -memory, rather than reading from file. This makes it possible to use -operate on raw coordinate using existing MDAnalysis tools. In +memory, rather than reading from file. This makes it possible to +operate on raw coordinates using existing MDAnalysis tools. In addition, it allows the user to make changes to the coordinates in a trajectory (e.g. through :attr:`MDAnalysis.core.groups.AtomGroup.positions`) without having @@ -193,25 +193,50 @@ class Timestep(base.Timestep): - """ - Timestep for the :class:`MemoryReader` + """Timestep for the :class:`MemoryReader` - Overrides the positions property in - :class:`MDAnalysis.coordinates.base.Timestep` to use avoid - duplication of the array. + Compared to the base :class:`base.Timestep`, this version + (:class:`memory.Timestep`) has an additional + :meth:`_replace_positions_array` method, which replaces the array of + positions while the :attr:`positions` property replaces the content of the + array. """ + def _replace_positions_array(self, new): + """Replace the array of positions + + Replaces the array of positions by another array. - @property - def positions(self): - return base.Timestep.positions.fget(self) - @positions.setter - def positions(self, new): + Note + ---- + The behavior of :meth:`_replace_positions_array` is different from the + behavior of the :attr:`position` property that replaces the **content** + of the array. The :meth:`_replace_positions_array` method should only be + used to set the positions to a different frame in + :meth:`MemoryReader._read_next_timestep`; there, the memory reader sets + the positions to a view of the correct frame. Modifying the positions + for a given frame should be done with the :attr:`positions` attribute + that does not break the link between the array of positions in the time + step and the :attr:`MemoryReader.coordinate_array`. + + + .. versionadded:: 0.19.0 + """ self.has_positions = True - # Use reference to original rather than a copy self._pos = new + def _replace_velocities_array(self, new): + self.has_velocities = True + self._velocities = new + + def _replace_forces_array(self, new): + self.has_forces = True + self._forces = new + + def _replace_dimensions(self, new): + self._unitcell = new + class MemoryReader(base.ProtoReader): """ @@ -229,12 +254,15 @@ class MemoryReader(base.ProtoReader): _Timestep = Timestep def __init__(self, coordinate_array, order='fac', - dimensions=None, dt=1, filename=None, **kwargs): + dimensions=None, dt=1, filename=None, + velocities=None, forces=None, + **kwargs): """ Parameters ---------- coordinate_array : numpy.ndarray - The underlying array of coordinates + The underlying array of coordinates. The MemoryReader now + necessarily requires a np.ndarray order : {"afc", "acf", "caf", "fac", "fca", "cfa"} (optional) the order/shape of the return data array, corresponding to (a)tom, (f)rame, (c)oordinates all six combinations @@ -244,32 +272,94 @@ def __init__(self, coordinate_array, order='fac', dimensions: [A, B, C, alpha, beta, gamma] (optional) unitcell dimensions (*A*, *B*, *C*, *alpha*, *beta*, *gamma*) lengths *A*, *B*, *C* are in the MDAnalysis length unit (Å), and - angles are in degrees. + angles are in degrees. An array of dimensions can be given, + which must then be shape (nframes, 6) dt: float (optional) The time difference between frames (ps). If :attr:`time` is set, then `dt` will be ignored. filename: string (optional) The name of the file from which this instance is created. Set to ``None`` when created from an array + velocities : numpy.ndarray (optional) + Atom velocities. Must match shape of coordinate_array. Will share order + with coordinates. + forces : numpy.ndarray (optional) + Atom forces. Must match shape of coordinate_array Will share order + with coordinates + + Raises + ------ + TypeError if the coordinate array passed is not a np.ndarray Note ---- At the moment, only a fixed `dimension` is supported, i.e., the same unit cell for all frames in `coordinate_array`. See issue `#1041`_. + .. _`#1041`: https://github.com/MDAnalysis/mdanalysis/issues/1041 + .. versionchanged:: 0.19.0 + The input to the MemoryReader now must be a np.ndarray + Added optional velocities and forces """ super(MemoryReader, self).__init__() self.filename = filename self.stored_order = order - self.set_array(np.asarray(coordinate_array), order) + + # See Issue #1685. The block below checks if the coordinate array + # passed is of shape (N, 3) and if it is, the coordiante array is + # reshaped to (1, N, 3) + try: + if coordinate_array.ndim == 2 and coordinate_array.shape[1] == 3: + coordinate_array = coordinate_array[np.newaxis, :, :] + except AttributeError as e: + raise TypeError("The input has to be a numpy.ndarray that " + "corresponds to the layout specified by the " + "'order' keyword.") + + self.set_array(coordinate_array, order) self.n_frames = \ self.coordinate_array.shape[self.stored_order.find('f')] self.n_atoms = \ self.coordinate_array.shape[self.stored_order.find('a')] + if velocities is not None: + try: + velocities = np.asarray(velocities, dtype=np.float32) + except ValueError: + raise TypeError("'velocities' must be array-like got {}" + "".format(type(velocities))) + # if single frame, make into array of 1 frame + if velocities.ndim == 2: + velocities = velocities[np.newaxis, :, :] + if not velocities.shape == self.coordinate_array.shape: + raise ValueError('Velocities has wrong shape {} ' + 'to match coordinates {}' + ''.format(velocities.shape, + self.coordinate_array.shape)) + self.velocity_array = velocities.astype(np.float32, copy=False) + else: + self.velocity_array = None + + if forces is not None: + try: + forces = np.asarray(forces, dtype=np.float32) + except ValueError: + raise TypeError("'forces' must be array like got {}" + "".format(type(forces))) + if forces.ndim == 2: + forces = forces[np.newaxis, :, :] + if not forces.shape == self.coordinate_array.shape: + raise ValueError('Forces has wrong shape {} ' + 'to match coordinates {}' + ''.format(forces.shape, + self.coordinate_array.shape)) + self.force_array = forces.astype(np.float32, copy=False) + else: + self.force_array = None + provided_n_atoms = kwargs.pop("n_atoms", None) if (provided_n_atoms is not None and provided_n_atoms != self.n_atoms): @@ -280,8 +370,23 @@ def __init__(self, coordinate_array, order='fac', self.ts = self._Timestep(self.n_atoms, **kwargs) self.ts.dt = dt - if dimensions is not None: - self.ts.dimensions = dimensions + if dimensions is None: + dimensions = np.zeros((self.n_frames, 6), dtype=np.float64) + else: + try: + dimensions = np.asarray(dimensions, dtype=np.float64) + except ValueError: + raise TypeError("'dimensions' must be array-like got {}" + "".format(type(dimensions))) + if dimensions.shape == (6,): + # single box, tile this to trajectory length + # allows modifying the box of some frames + dimensions = np.tile(dimensions, (self.n_frames, 1)) + elif dimensions.shape != (self.n_frames, 6): + raise ValueError("Provided dimensions array has shape {}. " + "This must be a array of shape (6,) or " + "(n_frames, 6)".format(dimensions.shape)) + self.dimensions_array = dimensions self.ts.frame = -1 self.ts.time = -1 self._read_next_timestep() @@ -311,19 +416,30 @@ def parse_n_atoms(filename, order='fac', **kwargs): def copy(self): """Return a copy of this Memory Reader""" + vels = (self.velocity_array.copy() + if self.velocity_array is not None else None) + fors = (self.force_array.copy() + if self.force_array is not None else None) + dims = self.dimensions_array.copy() + new = self.__class__( self.coordinate_array.copy(), order=self.stored_order, - dimensions=self.ts.dimensions, + dimensions=dims, + velocities=vels, + forces=fors, dt=self.ts.dt, filename=self.filename, ) new[self.ts.frame] - new.ts = self.ts.copy() + for auxname, auxread in self._auxs.items(): new.add_auxiliary(auxname, auxread.copy()) + # since transformations are already applied to the whole trajectory + # simply copy the property + new.transformations = self.transformations - return new + return new def set_array(self, coordinate_array, order='fac'): """ @@ -444,9 +560,14 @@ def _read_next_timestep(self, ts=None): basic_slice = ([slice(None)]*(f_index) + [self.ts.frame] + [slice(None)]*(2-f_index)) - ts.positions = self.coordinate_array[basic_slice] - - ts.time = self.ts.frame*self.dt + ts._replace_positions_array(self.coordinate_array[basic_slice]) + ts._replace_dimensions(self.dimensions_array[self.ts.frame]) + if self.velocity_array is not None: + ts._replace_velocities_array(self.velocity_array[basic_slice]) + if self.force_array is not None: + ts._replace_forces_array(self.force_array[basic_slice]) + + ts.time = self.ts.frame * self.dt return ts def _read_frame(self, i): @@ -463,3 +584,47 @@ def __repr__(self): nframes=self.n_frames, natoms=self.n_atoms )) + + def add_transformations(self, *transformations): + """ Add all transformations to be applied to the trajectory. + + This function take as list of transformations as an argument. These + transformations are functions that will be called by the Reader and given + a :class:`Timestep` object as argument, which will be transformed and returned + to the Reader. + The transformations can be part of the :mod:`~MDAnalysis.transformations` + module, or created by the user, and are stored as a list `transformations`. + This list can only be modified once, and further calls of this function will + raise an exception. + + .. code-block:: python + + u = MDAnalysis.Universe(topology, coordinates) + workflow = [some_transform, another_transform, this_transform] + u.trajectory.add_transformations(*workflow) + + Parameters + ---------- + transform_list : list + list of all the transformations that will be applied to the coordinates + + See Also + -------- + :mod:`MDAnalysis.transformations` + """ + #Overrides :meth:`~MDAnalysis.coordinates.base.ProtoReader.add_transformations` + #to avoid unintended behaviour where the coordinates of each frame are transformed + #multiple times when iterating over the trajectory. + #In this method, the trajectory is modified all at once and once only. + + super(MemoryReader, self).add_transformations(*transformations) + for i, ts in enumerate(self): + for transform in self.transformations: + ts = transform(ts) + + def _apply_transformations(self, ts): + """ Applies the transformations to the timestep.""" + # Overrides :meth:`~MDAnalysis.coordinates.base.ProtoReader.add_transformations` + # to avoid applying the same transformations multiple times on each frame + + return ts diff --git a/package/MDAnalysis/core/__init__.py b/package/MDAnalysis/core/__init__.py index f0801c337d6..57081aaf743 100644 --- a/package/MDAnalysis/core/__init__.py +++ b/package/MDAnalysis/core/__init__.py @@ -92,6 +92,19 @@ from __future__ import absolute_import import six +import warnings +_DEPMSG = { + 'use_KDTree_routines': ('This flag is obsolete, all selections now ' + 'automatically select the fastest method'), + 'use_periodic_selections': 'Use periodic=True/False to select_atoms', + 'convert_lengths': 'This behaviour has been deprecated', + 'length_unit': 'This behaviour has been deprecated', + 'time_unit': 'This behaviour has been deprecated', + 'speed_unit': 'This behaviour has been deprecated', + 'force_unit': 'This behaviour has been deprecated', + 'charge_unit': 'This behaviour has been deprecated', + 'use_pbc': 'Supply a pbc kwarg to the relevant methods', +} __all__ = ['AtomGroup', 'Selection'] @@ -243,6 +256,10 @@ def get(self): return self.value def set(self, value): + warnings.warn('MDAnalysis.core.flags is deprecated and will be removed in version 1.0. ' + '' + _DEPMSG[self.name], # custom message for each flag too + DeprecationWarning) + if value is not None: try: self.value = self.mapping[value] @@ -280,9 +297,6 @@ def __doc__(self): * False - periodicity is ignored The MDAnalysis preset of this flag is %(default)r. - - Note that KD-tree based distance selections always ignore this flag. (For - details see the docs for the 'use_KDTree_routines' flag.) """ ), _Flag( diff --git a/package/MDAnalysis/core/groups.py b/package/MDAnalysis/core/groups.py index 34fbcdc5084..18afdf0a62a 100644 --- a/package/MDAnalysis/core/groups.py +++ b/package/MDAnalysis/core/groups.py @@ -25,18 +25,18 @@ Core objects: Containers --- :mod:`MDAnalysis.core.groups` ========================================================== -The :class:`~MDAnalysis.core.universe.Universe` instance contains all -the particles in the system (which MDAnalysis calls -:class:`Atom`). Groups of atoms are handled as :class:`AtomGroup` -instances. The :class:`AtomGroup` is probably the most important -object in MDAnalysis because virtually everything can be accessed -through it. `AtomGroup` instances can be easily created (e.g., from a -:meth:`AtomGroup.select_atoms` selection or just by slicing). +The :class:`~MDAnalysis.core.universe.Universe` instance contains all the +particles in the system (which MDAnalysis calls :class:`Atom`). Groups of +:class:`atoms` are handled as :class:`AtomGroup` instances. The +:class:`AtomGroup` is probably the most important object in MDAnalysis because +virtually everything can be accessed through it. :class:`AtomGroup` instances +can be easily created (e.g., from an :meth:`AtomGroup.select_atoms` selection or +simply by slicing). -For convenience, chemically meaningful groups of atoms such as a -:class:`Residue` or a :class:`Segment` (typically a whole molecule or -all of the solvent) also exist as containers, as well as groups of -these units ((:class:`ResidueGroup`, :class:`SegmentGroup`). +For convenience, chemically meaningful groups of :class:`Atoms` such as a +:class:`Residue` or a :class:`Segment` (typically a whole molecule or all of the +solvent) also exist as containers, as well as groups of these units +(:class:`ResidueGroup`, :class:`SegmentGroup`). Classes @@ -73,9 +73,8 @@ Levels ------ -Each of the above classes has a level attribute. This can be used to -verify that two objects are of the same level, or to access a particular -class:: +Each of the above classes has a *level* attribute. This can be used to verify +that two objects are of the same level, or to access a particular class:: u = mda.Universe() @@ -87,7 +86,6 @@ ag.level.singular # Returns Atom class at.level.plural # Returns AtomGroup class - """ from __future__ import absolute_import from six.moves import zip @@ -103,9 +101,9 @@ from numpy.lib.utils import deprecate -import MDAnalysis from .. import _ANCHOR_UNIVERSES from ..lib import util +from ..lib.util import cached, warn_if_not_unique, unique_int_1d from ..lib import distances from ..lib import transformations from ..selections import get_writer as get_selection_writer_for @@ -136,14 +134,14 @@ def _unpickle_uag(basepickle, selections, selstrs): def make_classes(): - """Make a fresh copy of all Classes + """Make a fresh copy of all classes Returns ------- Two dictionaries. One with a set of :class:`_TopologyAttrContainer` classes - to serve as bases for universe-specific MDA container classes. Another with - the final merged versions of those classes. The classes themselves are used - as hashing keys. + to serve as bases for :class:`~MDAnalysis.core.universe.Universe`\ -specific + MDA container classes. Another with the final merged versions of those + classes. The classes themselves are used as hashing keys. """ bases = {} @@ -174,14 +172,15 @@ class _TopologyAttrContainer(object): :class:`_TopologyAttrContainer` is a convenience class to encapsulate the functions that deal with: - * the import and namespace transplant of :class:`TopologyAttr` objects; + * the import and namespace transplant of + :class:`~MDAnalysis.core.topologyattrs.TopologyAttr` objects; * the copying (subclassing) of itself to create distinct bases for the different container classes (:class:`AtomGroup`, :class:`ResidueGroup`, :class:`SegmentGroup`, :class:`Atom`, :class:`Residue`, :class:`Segment`, and subclasses thereof); * the mixing (subclassing and co-inheritance) with the container classes. The mixed subclasses become the final container classes specific to each - :class:`Universe`. + :class:`~MDAnalysis.core.universe.Universe`. """ @classmethod def _subclass(cls, is_group): @@ -191,10 +190,12 @@ def _subclass(cls, is_group): ---------- is_group : bool The :attr:`_is_group` of the returned class will be set to - *is_group*. This is used to distinguish between Groups (AtomGroup - etc.) and Components (Atom etc.) in internal methods when - considering actions such as addition between objects, adding - TopologyAttributes to them. + `is_group`. This is used to distinguish between Groups + (:class:`AtomGroup` etc.) and Components (:class:`Atom` etc.) in + internal methods when considering actions such as addition of + objects or adding + :class:`TopologyAttributes` + to them. Returns ------- @@ -225,7 +226,7 @@ def _mix(cls, other): The new class will have an attribute `_derived_class` added, pointing to itself. This pointer instructs which class to use when - slicing/adding instances of the new class. At initialization time the + slicing/adding instances of the new class. At initialization time, the new class may choose to point `_derived_class` to another class (as is done in the initialization of :class:`UpdatingAtomGroup`). @@ -246,11 +247,11 @@ def _mix(cls, other): @classmethod def _add_prop(cls, attr): - """Add attr into the namespace for this class + """Add `attr` into the namespace for this class Parameters ---------- - attr : A TopologyAttr object + attr : A :class:`TopologyAttr` object """ def getter(self): return attr.__getitem__(self) @@ -285,8 +286,10 @@ class _MutableBase(object): Base class that merges appropriate :class:`_TopologyAttrContainer` classes. Implements :meth:`__new__`. In it the instantiating class is fetched from - :attr:`Universe._classes`. If there is a cache miss, a merged class is made - with a base from :attr:`Universe._class_bases` and cached. + :attr:`~MDAnalysis.core.universe.Universe._classes`. If there is a cache + miss, a merged class is made + with a base from :attr:`~MDAnalysis.core.universe.Universe._class_bases` + and cached. The classes themselves are used as the cache dictionary keys for simplcity in cache retrieval. @@ -304,11 +307,12 @@ def __new__(cls, *args, **kwargs): # older AtomGroup init method.. u = args[0][0].universe except (TypeError, IndexError, AttributeError): + from .universe import Universe # Let's be generic and get the first argument that's either a # Universe, a Group, or a Component, and go from there. # This is where the UpdatingAtomGroup args get matched. for arg in args+tuple(kwargs.values()): - if isinstance(arg, (MDAnalysis.Universe, GroupBase, + if isinstance(arg, (Universe, GroupBase, ComponentBase)): u = arg.universe break @@ -365,7 +369,8 @@ def wrapped(self, other): class GroupBase(_MutableBase): - """Base class from which a Universe's Group class is built. + """Base class from which a :class:`<~MDAnalysis.core.universe.Universe`\ 's + Group class is built. Instances of :class:`GroupBase` provide the following operations that conserve element repetitions and order: @@ -540,7 +545,8 @@ def __eq__(self, other): Two groups are equal if they contain the same indices in the same order. Groups that are not at the same level or that belong - to different universe cannot be compared. + to different :class:`Universes` + cannot be compared. """ o_ix = other.ix return np.array_equal(self.ix, o_ix) @@ -563,6 +569,9 @@ def __xor__(self, other): @property def universe(self): + """The underlying :class:`~MDAnalysis.core.universe.Universe` the group + belongs to. + """ return self._u @property @@ -583,12 +592,12 @@ def ix(self): def ix_array(self): """Unique indices of the components in the Group. - For a Group, ix_array is the same as ix. This method gives a - consistent API between components and groups. + For a Group, :attr:`ix_array` is the same as :attr:`ix`. This method + gives a consistent API between components and groups. See Also -------- - ix + :attr:`ix` """ return self._ix @@ -601,60 +610,200 @@ def dimensions(self): def dimensions(self, dimensions): self.universe.trajectory.ts.dimensions = dimensions - def center(self, weights, pbc=None): - """Calculate center of group given some weights + @property + @cached('isunique') + def isunique(self): + """Boolean indicating whether all components of the group are unique, + i.e., the group contains no duplicates. + + Examples + -------- + + >>> ag = u.atoms[[2, 1, 2, 2, 1, 0]] + >>> ag + + >>> ag.isunique + False + >>> ag2 = ag.unique + >>> ag2 + + >>> ag2.isunique + True + + + .. versionadded:: 0.19.0 + """ + if len(self) <= 1: + return True + # Fast check for uniqueness + # 1. get sorted array of component indices: + s_ix = np.sort(self._ix) + # 2. If the group's components are unique, no pair of adjacent values in + # the sorted indices array are equal. We therefore compute a boolean + # mask indicating equality of adjacent sorted indices: + mask = s_ix[1:] == s_ix[:-1] + # 3. The group is unique if all elements in the mask are False. We could + # return ``not np.any(mask)`` here but using the following is faster: + return not np.count_nonzero(mask) + + @warn_if_not_unique + def center(self, weights, pbc=None, compound='group'): + """Weighted center of (compounds of) the group + + Computes the weighted center of :class:`Atoms` in the group. + Weighted centers per :class:`Residue` or per :class:`Segment` can be + obtained by setting the `compound` parameter accordingly. Parameters ---------- - weights : array_like - weights to be used - pbc : boolean, optional - ``True``: Move all atoms within the primary unit cell - before calculation [``False``] + weights : array_like or None + Weights to be used. Setting `weights=None` is equivalent to passing + identical weights for all atoms of the group. + pbc : bool or None, optional + If ``True`` and `compound` is ``'group'``, move all atoms to the + primary unit cell before calculation. If ``True`` and `compound` is + ``'segments'`` or ``'residues'``, the center of each compound will + be calculated without moving any :class:`Atoms` to keep the + compounds intact. Instead, the resulting position vectors will be + moved to the primary unit cell after calculation. + compound : {'group', 'segments', 'residues'}, optional + If ``'group'``, the weighted center of all atoms in the group will + be returned as a single position vector. Else, the weighted centers + of each :class:`Segment` or :class:`Residue` will be returned as an + array of position vectors, i.e. a 2d array. Note that, in any case, + *only* the positions of :class:`Atoms` *belonging to the + group* will be taken into account. Returns ------- - center : ndarray - weighted center of group + center : numpy.ndarray + Position vector(s) of the weighted center(s) of the group. + If `compound` was set to ``'group'``, the output will be a single + position vector. + If `compound` was set to ``'segments'`` or ``'residues'``, the + output will be a 2d array of shape ``(n, 3)`` where ``n`` is the + number of compounds. Examples -------- - To find the charge weighted center of a given Atomgroup:: + To find the center of charge of a given :class:`AtomGroup`:: >>> sel = u.select_atoms('prop mass > 4.0') >>> sel.center(sel.charges) + To find the centers of mass per residue of all CA :class:`Atoms`:: + + >>> sel = u.select_atoms('name CA') + >>> sel.center(sel.masses, compound='residues') Notes ----- If the :class:`MDAnalysis.core.flags` flag *use_pbc* is set to ``True`` then the `pbc` keyword is used by default. + + .. versionchanged:: 0.19.0 Added `compound` parameter """ - atoms = self.atoms + if pbc is None: pbc = flags['use_pbc'] - if pbc: - xyz = atoms.pack_into_box(inplace=False) + + atoms = self.atoms + + # enforce calculations in double precision: + dtype = np.float64 + + if compound.lower() == 'group': + if pbc: + coords = atoms.pack_into_box(inplace=False) + else: + coords = atoms.positions + # promote coords or weights to dtype if required: + if weights is None: + coords = coords.astype(dtype, copy=False) + else: + weights = weights.astype(dtype, copy=False) + return np.average(coords, weights=weights, axis=0) + elif compound.lower() == 'residues': + compound_indices = atoms.resindices + n_compounds = atoms.n_residues + elif compound.lower() == 'segments': + compound_indices = atoms.segindices + n_compounds = atoms.n_segments else: - xyz = atoms.positions + raise ValueError("Unrecognized compound definition: {}\nPlease use" + " one of 'group', 'residues', or 'segments'." + "".format(compound)) + + # Sort positions and weights by compound index and promote to dtype if + # required: + sort_indices = np.argsort(compound_indices) + compound_indices = compound_indices[sort_indices] + coords = atoms.positions[sort_indices] + if weights is None: + coords = coords.astype(dtype, copy=False) + else: + weights = weights.astype(dtype, copy=False) + weights = weights[sort_indices] + # Allocate output array: + centers = np.zeros((n_compounds, 3), dtype=dtype) + # Get sizes of compounds: + unique_compound_indices, compound_sizes = np.unique(compound_indices, + return_counts=True) + unique_compound_sizes = unique_int_1d(compound_sizes) + # Compute centers per compound for each compound size: + for compound_size in unique_compound_sizes: + compound_mask = compound_sizes == compound_size + _compound_indices = unique_compound_indices[compound_mask] + atoms_mask = np.in1d(compound_indices, _compound_indices) + _coords = coords[atoms_mask].reshape((-1, compound_size, 3)) + if weights is None: + _centers = _coords.mean(axis=1) + else: + _weights = weights[atoms_mask].reshape((-1, compound_size)) + _centers = (_coords * _weights[:, :, None]).sum(axis=1) + _centers /= _weights.sum(axis=1)[:, None] + centers[compound_mask] = _centers + if pbc: + centers = distances.apply_PBC(centers, atoms.dimensions) + return centers - return np.average(xyz, weights=weights, axis=0) + @warn_if_not_unique + def center_of_geometry(self, pbc=None, compound='group'): + """Center of geometry (also known as centroid) of the group. - def center_of_geometry(self, pbc=None): - """Center of geometry (also known as centroid) of the selection. + Computes the center of geometry (a.k.a. centroid) of + :class:`Atoms` in the group. Centers of geometry per + :class:`Residue` or per :class:`Segment` can be obtained by setting the + `compound` parameter accordingly. Parameters ---------- - pbc : boolean, optional - ``True``: Move all atoms within the primary unit cell - before calculation [``False``] + pbc : bool or None, optional + If ``True`` and `compound` is ``'group'``, move all atoms to the + primary unit cell before calculation. If ``True`` and `compound` is + ``'segments'`` or ``'residues'``, the center of each compound will + be calculated without moving any :class:`Atoms` to keep the + compounds intact. Instead, the resulting position vectors will be + moved to the primary unit cell after calculation. + compound : {'group', 'segments', 'residues'}, optional + If ``'group'``, the center of geometry of all :class:`Atoms` + in the group will be returned as a single position vector. Else, the + centers of geometry of each :class:`Segment` or :class:`Residue` + will be returned as an array of position vectors, i.e. a 2d array. + Note that, in any case, *only* the positions of :class:`Atoms` + *belonging to the group* will be taken into account. Returns ------- - center : ndarray - geometric center of group + center : numpy.ndarray + Position vector(s) of the geometric center(s) of the group. + If `compound` was set to ``'group'``, the output will be a single + position vector. + If `compound` was set to ``'segments'`` or ``'residues'``, the + output will be a 2d array of shape ``(n, 3)`` where ``n`` is the + number of compounds. Notes ----- @@ -663,8 +812,9 @@ def center_of_geometry(self, pbc=None): .. versionchanged:: 0.8 Added `pbc` keyword + .. versionchanged:: 0.19.0 Added `compound` parameter """ - return self.center(None, pbc=pbc) + return self.center(None, pbc=pbc, compound=compound) centroid = center_of_geometry @@ -679,14 +829,14 @@ def bbox(self, **kwargs): Parameters ---------- pbc : bool, optional - If ``True``, move all atoms within the primary unit cell before - calculation. [``False``] + If ``True``, move all :class:`Atoms` to the primary unit cell + before calculation. [``False``] Returns ------- - corners : array + corners : numpy.ndarray 2x3 array giving corners of bounding box as - [[xmin, ymin, zmin], [xmax, ymax, zmax]]. + ``[[xmin, ymin, zmin], [xmax, ymax, zmax]]``. Note ---- @@ -698,7 +848,7 @@ def bbox(self, **kwargs): .. versionchanged:: 0.8 Added *pbc* keyword """ atomgroup = self.atoms - pbc = kwargs.pop('pbc', MDAnalysis.core.flags['use_pbc']) + pbc = kwargs.pop('pbc', flags['use_pbc']) if pbc: x = atomgroup.pack_into_box(inplace=False) @@ -710,20 +860,21 @@ def bbox(self, **kwargs): def bsphere(self, **kwargs): """Return the bounding sphere of the selection. - The sphere is calculated relative to the centre of geometry. + The sphere is calculated relative to the + :meth:`center of geometry`. Parameters ---------- pbc : bool, optional - If ``True``, move all atoms within the primary unit cell before + If ``True``, move all atoms to the primary unit cell before calculation. [``False``] Returns ------- R : float - Radius of bounding sphere. - center : array - Coordinates of sphere center as ``[xcen,ycen,zcen]``. + Radius of the bounding sphere. + center : numpy.ndarray + Coordinates of the sphere center as ``[xcen, ycen, zcen]``. Note ---- @@ -734,8 +885,8 @@ def bsphere(self, **kwargs): .. versionadded:: 0.7.3 .. versionchanged:: 0.8 Added *pbc* keyword """ - atomgroup = self.atoms - pbc = kwargs.pop('pbc', MDAnalysis.core.flags['use_pbc']) + atomgroup = self.atoms.unique + pbc = kwargs.pop('pbc', flags['use_pbc']) if pbc: x = atomgroup.pack_into_box(inplace=False) @@ -751,11 +902,13 @@ def bsphere(self, **kwargs): def transform(self, M): r"""Apply homogenous transformation matrix `M` to the coordinates. + :class:`Atom` coordinates are rotated and translated in-place. + Parameters ---------- - M : array - 4x4 matrix, with the rotation in ``R = M[:3,:3]`` and the - translation in ``t = M[:3,3]``. + M : array_like + 4x4 matrix with the rotation in ``R = M[:3, :3]`` and the + translation in ``t = M[:3, 3]``. Returns ------- @@ -767,14 +920,15 @@ def transform(self, M): Notes ----- - The rotation :math:`\mathsf{R}` is applied before the translation - :math:`\mathbf{t}`: + The rotation :math:`\mathsf{R}` is about the origin and is applied + before the translation :math:`\mathbf{t}`: .. math:: \mathbf{x}' = \mathsf{R}\mathbf{x} + \mathbf{t} """ + M = np.asarray(M) R = M[:3, :3] t = M[:3, 3] return self.rotate(R, [0, 0, 0]).translate(t) @@ -782,7 +936,7 @@ def transform(self, M): def translate(self, t): r"""Apply translation vector `t` to the selection's coordinates. - Atom coordinates are translated in-place. + :class:`Atom` coordinates are translated in-place. Parameters ---------- @@ -823,22 +977,24 @@ def rotate(self, R, point=(0, 0, 0)): \mathbf{x}' = \mathsf{R}\mathbf{x} + :class:`Atom` coordinates are rotated in-place. + Parameters ---------- R : array_like - 3x3 rotation matrix to use for applying rotation. + 3x3 rotation matrix point : array_like, optional Center of rotation Returns ------- - self : AtomGroup + self Notes ----- - By default rotates around center of origin ``point=(0, 0, 0)``. To - rotate around center of geometry of the atomgroup use ``ag.rotate(R, - point=ag.centroid)``. + By default, rotates about the origin ``point=(0, 0, 0)``. To rotate + a group ``g`` around its center of geometry, use + ``g.rotate(R, point=g.center_of_geometry())``. See Also -------- @@ -850,13 +1006,15 @@ def rotate(self, R, point=(0, 0, 0)): point = np.asarray(point) # changes the coordinates (in place) - if not np.allclose(point, np.zeros(3)): - self.translate(-point) - x = self.atoms.unique.universe.trajectory.ts.positions - idx = self.atoms.unique.indices + atomgroup = self.atoms.unique + require_translation = bool(np.count_nonzero(point)) + if require_translation: + atomgroup.translate(-point) + x = atomgroup.universe.trajectory.ts.positions + idx = atomgroup.indices x[idx] = np.dot(x[idx], R.T) - if not np.allclose(point, np.zeros(3)): - self.translate(point) + if require_translation: + atomgroup.translate(point) return self @@ -875,7 +1033,7 @@ def rotateby(self, angle, axis, point=None): Returns ------- - self : AtomGroup + self Notes ----- @@ -891,17 +1049,21 @@ def rotateby(self, angle, axis, point=None): See Also -------- - MDAnalysis.lib.transformations.rotation_matrix : calculate :math:`\mathsf{R}` + MDAnalysis.lib.transformations.rotation_matrix : + calculate :math:`\mathsf{R}` """ alpha = np.radians(angle) axis = np.asarray(axis) - point = np.asarray(point) if point is not None else self.centroid() + if point is None: + point = self.center_of_geometry() + point = np.asarray(point) M = transformations.rotation_matrix(alpha, axis, point=point) return self.transform(M) def pack_into_box(self, box=None, inplace=True): - r"""Shift all atoms in this group to be within the primary unit cell. + r"""Shift all :class:`Atoms` in this group to the primary unit + cell. Parameters ---------- @@ -916,7 +1078,7 @@ def pack_into_box(self, box=None, inplace=True): Returns ------- - coords : array + coords : numpy.ndarray Shifted atom coordinates. Notes @@ -932,42 +1094,55 @@ def pack_into_box(self, box=None, inplace=True): The default is to take unit cell information from the underlying :class:`~MDAnalysis.coordinates.base.Timestep` instance. The optional argument `box` can be used to provide alternative unit cell information - (in the MDAnalysis standard format ``[Lx, Ly, Lz, alpha, beta, - gamma]``). + (in the MDAnalysis standard format + ``[Lx, Ly, Lz, alpha, beta, gamma]``). Works with either orthogonal or triclinic box types. + .. note:: + :meth:`AtomGroup.pack_into_box` is currently faster than + :meth:`ResidueGroup.pack_into_box` or + :meth:`SegmentGroup.pack_into_box`. + .. versionadded:: 0.8 - """ - atomgroup = self.atoms.unique - if box is None: # Try and auto detect box dimensions - box = atomgroup.dimensions # Can accept any box + # Try and auto detect box dimensions: + if box is None: + box = self.dimensions - if box.shape == (3, 3): - # for a vector representation, diagonal cannot be zero - if (box.diagonal() == 0.0).any(): + # For a vector representation, the diagonal must not be zero, for a + # [x, y, z, alpha, beta, gamma] representation, no element must be zero: + if (box.shape == (3, 3) and (box.diagonal() == 0.0).any()) \ + or (box == 0).any(): raise ValueError("One or more box dimensions is zero." - " You can specify a boxsize with 'box ='") + " You can specify a box with 'box ='") + # no matter what kind of group we have, we need to work on its atoms: + ag = self.atoms + # If self is unique, so are its atoms. Thus, if the group is unique, we + # can use its atoms as is. + if self.isunique: + packed_coords = distances.apply_PBC(ag.positions, box) + if inplace: + ag.universe.trajectory.ts.positions[ag.ix] = packed_coords + return ag.universe.trajectory.ts.positions[ag.ix] + return packed_coords else: - if (box == 0).any(): # Check that a box dimension isn't zero - raise ValueError("One or more box dimensions is zero." - " You can specify a boxsize with 'box='") - - coords = atomgroup.universe.coord.positions[atomgroup.indices] - if not inplace: - return distances.apply_PBC(coords, box) - - atomgroup.universe.coord.positions[atomgroup.indices] = distances.apply_PBC(coords, box) - - return atomgroup.universe.coord.positions[atomgroup.indices] + unique_ag = ag.unique + unique_ix = unique_ag.ix + restore_mask = ag._unique_restore_mask + coords = ag.universe.trajectory.ts.positions[unique_ix] + packed_coords = distances.apply_PBC(coords, box) + if inplace: + ag.universe.trajectory.ts.positions[unique_ix] = packed_coords + return ag.universe.trajectory.ts.positions[unique_ix[restore_mask]] + return packed_coords[restore_mask] def wrap(self, compound="atoms", center="com", box=None): - """Shift the contents of this Group back into the unit cell. + """Shift the contents of this group back into the unit cell. This is a more powerful version of :meth:`pack_into_box`, allowing - groups of atoms to be kept together through the process. + groups of :class:`Atoms` to be kept together through the process. Parameters ---------- @@ -975,7 +1150,7 @@ def wrap(self, compound="atoms", center="com", box=None): The group which will be kept together through the shifting process. center : {'com', 'cog'} How to define the center of a given group of atoms. - box : array + box : array_like Box dimensions, can be either orthogonal or triclinic information. Cell dimensions must be in an identical to format to those returned by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`, @@ -987,19 +1162,21 @@ def wrap(self, compound="atoms", center="com", box=None): When specifying a `compound`, the translation is calculated based on each compound. The same translation is applied to all atoms within this compound, meaning it will not be broken by the shift. - This might however mean that all atoms from the compound are not + This might however mean that not all atoms from the compound are inside the unit cell, but rather the center of the compound is. `center` allows the definition of the center of each group to be - specified. This can be either 'com' for center of mass, or 'cog' for - center of geometry. + specified. This can be either ``'com'`` for center of mass, or ``'cog'`` + for center of geometry. `box` allows a unit cell to be given for the transformation. If not - specified, an the dimensions information from the current Timestep will - be used. + specified, the :attr:`~MDAnalysis.coordinates.base.Timestep.dimensions` + information from the current + :class:`~MDAnalysis.coordinates.base.Timestep` will be used. .. note:: - wrap with all default keywords is identical to :meth:`pack_into_box` + :meth:`wrap` with all default keywords is identical to + :meth:`pack_into_box` .. versionadded:: 0.9.2 @@ -1017,7 +1194,7 @@ def wrap(self, compound="atoms", center="com", box=None): elif compound.lower() == 'fragments': objects = atomgroup.fragments else: - raise ValueError("Unrecognised compound definition: {0}" + raise ValueError("Unrecognized compound definition: {0}" "Please use one of 'group' 'residues' 'segments'" "or 'fragments'".format(compound)) @@ -1027,7 +1204,7 @@ def wrap(self, compound="atoms", center="com", box=None): elif center.lower() in ('cog', 'centroid', 'centerofgeometry'): centers = np.vstack([o.atoms.center_of_geometry() for o in objects]) else: - raise ValueError("Unrecognised center definition: {0}" + raise ValueError("Unrecognized center definition: {0}" "Please use one of 'com' or 'cog'".format(center)) centers = centers.astype(np.float32) @@ -1043,30 +1220,46 @@ def wrap(self, compound="atoms", center="com", box=None): if not all(s == 0.0): o.atoms.translate(s) + def copy(self): + """Get another group identical to this one. + + + .. versionadded:: 0.19.0 + """ + group = self[:] + # Try to fill the copied group's uniqueness caches: + try: + group._cache['isunique'] = self._cache['isunique'] + if group._cache['isunique']: + group._cache['unique'] = group + except KeyError: + pass + return group + def groupby(self, topattrs): """Group together items in this group according to values of *topattr* Parameters ---------- topattrs: str or list - One or more topology attribute to group components by. + One or more topology attributes to group components by. Single arguments are passed as a string. Multiple arguments are passed as a list. Returns ------- dict - Unique values of the multiple combinations of topology attributes + Unique values of the multiple combinations of topology attributes as keys, Groups as values. Example - ------- - To group atoms with the same mass together: - + ------- + To group atoms with the same mass together: + >>> ag.groupby('masses') {12.010999999999999: , 14.007: , - 15.999000000000001: } + 15.999000000000001: } To group atoms with the same residue name and mass together: @@ -1077,24 +1270,25 @@ def groupby(self, topattrs): ('ALA', 15.999): }, ('ARG', 1.008): , ...} - + >>> ag.groupby(['resnames', 'masses'])('ALA', 15.999) - + + .. versionadded:: 0.16.0 .. versionchanged:: 0.18.0 The function accepts multiple attributes """ - + res = dict() - + if isinstance(topattrs, (string_types, bytes)): attr=topattrs if isinstance(topattrs, bytes): attr = topattrs.decode('utf-8') ta = getattr(self, attr) - + return {i: self[ta == i] for i in set(ta)} - + else: attr = topattrs[0] ta = getattr(self, attr) @@ -1103,9 +1297,8 @@ def groupby(self, topattrs): res[i] = self[ta == i] else: res[i] = self[ta == i].groupby(topattrs[1:]) - - return util.flatten_dict(res) + return util.flatten_dict(res) @_only_same_level def concatenate(self, other): @@ -1137,6 +1330,7 @@ def concatenate(self, other): >>> ag3[-3:].names array(['N', 'N', 'N'], dtype=object) + .. versionadded:: 0.16.0 """ o_ix = other.ix_array @@ -1176,6 +1370,7 @@ def union(self, other): -------- concatenate, intersection + .. versionadded:: 0.16 """ o_ix = other.ix_array @@ -1214,6 +1409,7 @@ def intersection(self, other): -------- union + .. versionadded:: 0.16 """ o_ix = other.ix_array @@ -1254,6 +1450,7 @@ def subtract(self, other): -------- concatenate, difference + .. versionadded:: 0.16 """ o_ix = other.ix_array @@ -1283,6 +1480,7 @@ def difference(self, other): -------- subtract, symmetric_difference + .. versionadded:: 0.16 """ o_ix = other.ix_array @@ -1319,6 +1517,7 @@ def symmetric_difference(self, other): -------- difference + .. versionadded:: 0.16 """ o_ix = other.ix_array @@ -1334,8 +1533,9 @@ def isdisjoint(self, other): Returns ------- - Bool - True if the two Groups do not have common elements + bool + ``True`` if the two Groups do not have common elements + .. versionadded:: 0.16 """ @@ -1354,8 +1554,9 @@ def issubset(self, other): Returns ------- - Bool - True if this Group is a subset of the other one + bool + ``True`` if this Group is a subset of the other one + .. versionadded:: 0.16 """ @@ -1373,8 +1574,9 @@ def is_strict_subset(self, other): Returns ------- - Bool - True if this Group is a strict subset of the other one + bool + ``True`` if this Group is a strict subset of the other one + .. versionadded:: 0.16 """ @@ -1391,8 +1593,9 @@ def issuperset(self, other): Returns ------- - Bool - True if this Group is a subset of the other one + bool + ``True`` if this Group is a subset of the other one + .. versionadded:: 0.16 """ @@ -1410,8 +1613,9 @@ def is_strict_superset(self, other): Returns ------- - Bool - True if this Group is a strict superset of the other one + bool + ``True`` if this Group is a strict superset of the other one + .. versionadded:: 0.16 """ @@ -1421,30 +1625,31 @@ def is_strict_superset(self, other): class AtomGroup(GroupBase): """An ordered array of atoms. - Can be initiated from an iterable of Atoms:: + Can be initiated from an iterable of :class:`Atoms`:: ag = AtomGroup([Atom1, Atom2, Atom3]) - Or from providing a list of indices and the Universe which is should belong - to:: + Or from providing a list of indices and the + :class:`~MDAnalysis.core.universe.Universe` it should belong to:: ag = AtomGroup([72, 14, 25], u) - Alternatively an :class:`AtomGroup` is generated by indexing/slicing another - AtomGroup, such as the Group of all atoms in the :class:`Universe` at + Alternatively, an :class:`AtomGroup` is generated by indexing/slicing + another :class:`AtomGroup`, such as the group of all :class:`Atoms` in + the :class:`~MDAnalysis.core.universe.Universe` at :attr:`MDAnalysis.core.universe.Universe.atoms`. - An AtomGroup can be indexed and sliced like a list:: + An :class:`AtomGroup` can be indexed and sliced like a list:: ag[0], ag[-1] will return the first and the last :class:`Atom` in the group whereas the - slice :: + slice:: ag[0:6:2] - returns an AtomGroup of every second element, corresponding to indices 0, - 2, and 4. + returns an :class:`AtomGroup` of every second element, corresponding to + indices 0, 2, and 4. It also supports "advanced slicing" when the argument is a :class:`numpy.ndarray` or a :class:`list`:: @@ -1452,42 +1657,44 @@ class AtomGroup(GroupBase): aslice = [0, 3, -1, 10, 3] ag[aslice] - will return a new AtomGroup of atoms with those indices in the old - AtomGroup. + will return a new :class:`AtomGroup` of :class:`Atoms` with those + indices in the old :class:`AtomGroup`. - Finally, AtomGroups can be created from a selection. See - :meth:`select_atoms`. + Finally, :class:`AtomGroups` can be created from a selection. + See :meth:`select_atoms`. .. note:: - AtomGroups originating from a selection are sorted and - duplicate elements are removed. This is not true for AtomGroups - produced by slicing. Thus slicing can be used when the order of - atoms is crucial (for instance, in order to define angles or - dihedrals). + :class:`AtomGroups` originating from a selection are sorted + and duplicate elements are removed. This is not true for + :class:`AtomGroups` produced by slicing. Thus, slicing can be + used when the order of atoms is crucial (for instance, in order to + define angles or dihedrals). - AtomGroups can be compared and combined using group operators. For - instance, AtomGroups can be concatenated using `+` or :meth:`concatenate`:: + :class:`AtomGroups` can be compared and combined using group + operators. For instance, :class:`AtomGroups` can be concatenated + using `+` or :meth:`concatenate`:: ag_concat = ag1 + ag2 # or ag_concat = ag1.concatenate(ag2) - When groups are concatenated, the order of the atoms is conserved. If atoms - appear several times in one of the groups, the duplicates are kept in the - resulting group. On the contrary to :meth:`concatenate`, :meth:`union` - treats the AtomGroups as sets, duplicates are removed from the resulting - group, and atoms are ordered. The `|` operator is synomymous to + When groups are concatenated, the order of the :class:`Atoms` is + conserved. If :class:`Atoms` appear several times in one of the + groups, the duplicates are kept in the resulting group. On the contrary to + :meth:`concatenate`, :meth:`union` treats the :class:`AtomGroups` + as sets so that duplicates are removed from the resulting group, and + :class:`Atoms` are ordered. The `|` operator is synomymous to :meth:`union`:: ag_union = ag1 | ag2 # or ag_union = ag1.union(ag2) The opposite operation to :meth:`concatenate` is :meth:`subtract`. This - method creates a new group with all the atoms of the group that are not in - a given other group; the order of the atoms is kept, so as duplicates. - :meth:`difference` is the set version of :meth:`subtract`. The resulting - group is sorted and deduplicated. + method creates a new group with all the :class:`Atoms` of the group + that are not in a given other group; the order of the :class:`Atoms` + is kept, and so are duplicates. :meth:`difference` is the set version of + :meth:`subtract`. The resulting group is sorted and deduplicated. All set methods are listed in the table below. These methods treat the - groups as sorted and deduplicated sets of atoms. + groups as sorted and deduplicated sets of :class:`Atoms`. +-------------------------------+------------+----------------------------+ | Operation | Equivalent | Result | @@ -1524,8 +1731,7 @@ class AtomGroup(GroupBase): | | | ``t`` but not both | +-------------------------------+------------+----------------------------+ - The following methods keep the order of the atoms, and keep duplicated - atoms. + The following methods keep the order of the atoms as well as duplicates. +-------------------------------+------------+----------------------------+ | Operation | Equivalent | Result | @@ -1546,33 +1752,33 @@ class AtomGroup(GroupBase): | | | in ``t`` | +-------------------------------+------------+----------------------------+ - The `in` operator allows to test if an :class:`Atom` is in the AtomGroup. + The `in` operator allows to test if an :class:`Atom` is in the + :class:`AtomGroup`. - AtomGroup instances are always bound to a + :class:`AtomGroup` instances are always bound to a :class:`MDAnalysis.core.universe.Universe`. They cannot exist in isolation. - .. rubric:: Deprecated functionality *Instant selectors* will be removed in the 1.0 release. See issue `#1377 `_ for more details. - Atoms can also be accessed in a Pythonic fashion by using the atom name as - an attribute. For instance, :: + :class:`Atoms` can also be accessed in a Pythonic fashion by using the + :class:`Atom` name as an attribute. For instance, :: ag.CA - will provide a :class:`AtomGroup` of all CA atoms in the + will provide an :class:`AtomGroup` of all CA :class:`Atoms` in the group. These *instant selector* attributes are auto-generated for each atom name encountered in the group. Notes ----- - The name-attribute instant selector access to atoms is mainly - meant for quick interactive work. Thus it either returns a - single :class:`Atom` if there is only one matching atom, *or* a - new :class:`AtomGroup` for multiple matches. This makes it - difficult to use the feature consistently in scripts. + The name-attribute instant selector access to :class:`Atoms` is mainly + meant for quick interactive work. Thus it either returns a single + :class:`Atom` if there is only one matching :class:`Atom`, *or* a + new :class:`AtomGroup` for multiple matches. This makes it difficult to use + the feature consistently in scripts. See Also @@ -1581,9 +1787,9 @@ class AtomGroup(GroupBase): .. deprecated:: 0.16.2 - *Instant selectors* of AtomGroup will be removed in the 1.0 release. - See :ref:`Instant selectors ` for details and alternatives. - + *Instant selectors* of :class:`AtomGroup` will be removed in the 1.0 + release. See :ref:`Instant selectors ` for details + and alternatives. """ def __getitem__(self, item): # DEPRECATED in 0.16.2 @@ -1621,21 +1827,38 @@ def __reduce__(self): @property def atoms(self): - """Get another AtomGroup identical to this one.""" - return self.universe.atoms[self.ix] + """The :class:`AtomGroup` itself. + + See Also + -------- + copy : return a true copy of the :class:`AtomGroup` + + + .. versionchanged:: 0.19.0 + In previous versions, this returned a copy, but now + the :class:`AtomGroup` itself is returned. This should + not affect any code but only speed up calculations. + + """ + return self @property def n_atoms(self): - """Number of atoms in AtomGroup. + """Number of atoms in the :class:`AtomGroup`. - Equivalent to ``len(self)``.""" + Equivalent to ``len(self)``. + """ return len(self) @property def residues(self): - """Get sorted :class:`ResidueGroup` of the (unique) residues - represented in the AtomGroup.""" - return self.universe.residues[np.unique(self.resindices)] + """A sorted :class:`ResidueGroup` of the unique + :class:`Residues` present in the :class:`AtomGroup`. + """ + rg = self.universe.residues[unique_int_1d(self.resindices)] + rg._cache['isunique'] = True + rg._cache['unique'] = rg + return rg @residues.setter def residues(self, new): @@ -1666,7 +1889,8 @@ def residues(self, new): @property def n_residues(self): - """Number of unique residues represented in the AtomGroup. + """Number of unique :class:`Residues` present in the + :class:`AtomGroup`. Equivalent to ``len(self.residues)``. @@ -1675,9 +1899,13 @@ def n_residues(self): @property def segments(self): - """Get sorted :class:`SegmentGroup` of the (unique) segments - represented in the AtomGroup.""" - return self.universe.segments[np.unique(self.segindices)] + """A sorted :class:`SegmentGroup` of the unique segments present in the + :class:`AtomGroup`. + """ + sg = self.universe.segments[unique_int_1d(self.segindices)] + sg._cache['isunique'] = True + sg._cache['unique'] = sg + return sg @segments.setter def segments(self, new): @@ -1686,16 +1914,43 @@ def segments(self, new): @property def n_segments(self): - """Number of unique segments represented in the AtomGroup. + """Number of unique segments present in the :class:`AtomGroup`. Equivalent to ``len(self.segments)``. - """ return len(self.segments) @property + @cached('unique_restore_mask') + def _unique_restore_mask(self): + # The _unique_restore_mask property's cache is populated whenever the + # AtomGroup.unique property of a *non-unique* AtomGroup is accessed. + # If _unique_restore_mask is not cached, it is *definitely* used in the + # wrong place, so we raise an exception here. In principle, the + # exception should be an AttributeError, but the error message would + # then be replaced by the __getattr__() error message. To prevent the + # message from being overridden, we raise a RuntimeError instead. + if self.isunique: + msg = ("{0}._unique_restore_mask is not available if the {0} is " + "unique. ".format(self.__class__.__name__)) + else: + msg = ("{0}._unique_restore_mask is only available after " + "accessing {0}.unique. ".format(self.__class__.__name__)) + msg += ("If you see this error message in an unmodified release " + "version of MDAnalysis, this is almost certainly a bug!") + raise RuntimeError(msg) + + @_unique_restore_mask.setter + def _unique_restore_mask(self, mask): + self._cache['unique_restore_mask'] = mask + + @property + @cached('unique') def unique(self): - """Return an AtomGroup containing sorted and unique atoms only. + """An :class:`AtomGroup` containing sorted and unique + :class:`Atoms` only. + + If the :class:`AtomGroup` is unique, this is the group itself. Examples -------- @@ -1710,27 +1965,56 @@ def unique(self): >>> ag2.ix array([0, 1, 2]) + >>> ag2.unique is ag2 + True + .. versionadded:: 0.16.0 - """ - return self.universe.atoms[np.unique(self.ix)] + .. versionchanged:: 0.19.0 If the :class:`AtomGroup` is already unique, + :attr:`AtomGroup.unique` now returns the group itself instead of a + copy. + """ + if self.isunique: + return self + unique_ix, restore_mask = np.unique(self.ix, return_inverse=True) + _unique = self.universe.atoms[unique_ix] + self._unique_restore_mask = restore_mask + # Since we know that _unique is a unique AtomGroup, we set its + # uniqueness caches from here: + _unique._cache['isunique'] = True + _unique._cache['unique'] = _unique + return _unique @property def positions(self): - """Coordinates of the atoms in the AtomGroup. + """Coordinates of the :class:`Atoms` in the :class:`AtomGroup`. + + A :class:`numpy.ndarray` with + :attr:`~numpy.ndarray.shape`\ ``=(``\ :attr:`~AtomGroup.n_atoms`\ ``, 3)`` + and :attr:`~numpy.ndarray.dtype`\ ``=numpy.float32``. The positions can be changed by assigning an array of the appropriate - shape, i.e. either Nx3 to assign individual coordinates or 3, to assign - the *same* coordinate to all atoms (e.g. ``ag.positions = - array([0,0,0])`` will move all particles to the origin). - - .. note:: Changing the position is not reflected in any files; - reading any frame from the trajectory will replace - the change with that from the file *except* if the - trajectory is held in memory, e.g., when the - :class:`~MDAnalysis.core.universe.Universe.transfer_to_memory` + shape, i.e., either ``(``\ :attr:`~AtomGroup.n_atoms`\ ``, 3)`` to + assign individual coordinates, or ``(3,)`` to assign the *same* + coordinate to all :class:`Atoms` (e.g., + ``ag.positions = array([0,0,0])`` will move all :class:`Atoms` + to the origin). + + .. note:: Changing positions is not reflected in any files; reading any + frame from the + :attr:`~MDAnalysis.core.universe.Universe.trajectory` will + replace the change with that from the file *except* if the + :attr:`~MDAnalysis.core.universe.Universe.trajectory` is held + in memory, e.g., when the + :meth:`~MDAnalysis.core.universe.Universe.transfer_to_memory` method was used. + Raises + ------ + ~MDAnalysis.exceptions.NoDataError + If the underlying :class:`~MDAnalysis.coordinates.base.Timestep` + does not contain + :attr:`~MDAnalysis.coordinates.base.Timestep.positions`. """ return self.universe.trajectory.ts.positions[self.ix] @@ -1741,17 +2025,24 @@ def positions(self, values): @property def velocities(self): - """Velocities of the atoms in the AtomGroup. + """Velocities of the :class:`Atoms` in the :class:`AtomGroup`. - The velocities can be changed by assigning an array of the appropriate - shape, i.e. either Nx3 to assign individual velocities or 3 to assign - the *same* velocity to all atoms (e.g. ``ag.velocity = array([0,0,0])`` - will give all particles zero velocity). + A :class:`numpy.ndarray` with + :attr:`~numpy.ndarray.shape`\ ``=(``\ :attr:`~AtomGroup.n_atoms`\ ``, 3)`` + and :attr:`~numpy.ndarray.dtype`\ ``=numpy.float32``. - Raises a :exc:`NoDataError` if the underlying - :class:`~MDAnalysis.coordinates.base.Timestep` does not contain - :attr:`~MDAnalysis.coordinates.base.Timestep.velocities`. + The velocities can be changed by assigning an array of the appropriate + shape, i.e. either ``(``\ :attr:`~AtomGroup.n_atoms`\ ``, 3)`` to assign + individual velocities or ``(3,)`` to assign the *same* velocity to all + :class:`Atoms` (e.g. ``ag.velocities = array([0,0,0])`` will give + all :class:`Atoms` zero :attr:`~Atom.velocity`). + Raises + ------ + ~MDAnalysis.exceptions.NoDataError + If the underlying :class:`~MDAnalysis.coordinates.base.Timestep` + does not contain + :attr:`~MDAnalysis.coordinates.base.Timestep.velocities`. """ ts = self.universe.trajectory.ts try: @@ -1769,13 +2060,23 @@ def velocities(self, values): @property def forces(self): - """Forces on each atom in the AtomGroup. + """Forces on each :class:`Atom` in the :class:`AtomGroup`. - The velocities can be changed by assigning an array of the appropriate - shape, i.e. either Nx3 to assign individual velocities or 3 to assign - the *same* velocity to all atoms (e.g. ``ag.velocity = array([0,0,0])`` - will give all particles zero velocity). + A :class:`numpy.ndarray` with + :attr:`~numpy.ndarray.shape`\ ``=(``\ :attr:`~AtomGroup.n_atoms`\ ``, 3)`` + and :attr:`~numpy.ndarray.dtype`\ ``=numpy.float32``. + The forces can be changed by assigning an array of the appropriate + shape, i.e. either ``(``\ :attr:`~AtomGroup.n_atoms`\ ``, 3)`` to assign + individual forces or ``(3,)`` to assign the *same* force to all + :class:`Atoms` (e.g. ``ag.forces = array([0,0,0])`` will give all + :class:`Atoms` a zero :attr:`~Atom.force`). + + Raises + ------ + ~MDAnalysis.exceptions.NoDataError + If the :class:`~MDAnalysis.coordinates.base.Timestep` does not + contain :attr:`~MDAnalysis.coordinates.base.Timestep.forces`. """ ts = self.universe.trajectory.ts try: @@ -1800,8 +2101,8 @@ def ts(self): If :attr:`~AtomGroup.ts` is modified then these modifications will be present until the frame number changes (which - typically happens when the underlying trajectory frame - changes). + typically happens when the underlying + :attr:`~MDAnalysis.core.universe.Universe.trajectory` frame changes). It is not possible to assign a new :class:`~MDAnalysis.coordinates.base.Timestep` to the @@ -1814,12 +2115,17 @@ def ts(self): # As with universe.select_atoms, needing to fish out specific kwargs # (namely, 'updating') doesn't allow a very clean signature. def select_atoms(self, sel, *othersel, **selgroups): - """Select atoms using a selection string. + """Select :class:`Atoms` using a selection string. + + Returns an :class:`AtomGroup` with :class:`Atoms` sorted according + to their index in the topology (this is to ensure that there are no + duplicates, which can happen with complicated selections). - Returns an :class:`AtomGroup` with atoms sorted according to - their index in the topology (this is to ensure that there - are not any duplicates, which can happen with complicated - selections). + Raises + ------ + TypeError + If the arbitrary groups passed are not of type + :class:`MDAnalysis.core.groups.AtomGroup` Examples -------- @@ -1859,12 +2165,11 @@ def select_atoms(self, sel, *othersel, **selgroups): ----- If exact ordering of atoms is required (for instance, for - :meth:`~AtomGroup.angle` or :meth:`~AtomGroup.dihedral` - calculations) then one supplies selections *separately* in the - required order. Also, when multiple :class:`AtomGroup` - instances are concatenated with the ``+`` operator then the - order of :class:`Atom` instances is preserved and duplicates - are not removed. + :meth:`~AtomGroup.angle` or :meth:`~AtomGroup.dihedral` calculations) + then one supplies selections *separately* in the required order. Also, + when multiple :class:`AtomGroup` instances are concatenated with the + ``+`` operator, then the order of :class:`Atom` instances is preserved + and duplicates are *not* removed. See Also @@ -1993,8 +2298,9 @@ def select_atoms(self, sel, *othersel, **selgroups): selects all atoms within a range of (1-based) inclusive indices, e.g. ``bynum 1`` selects the first atom in the universe; ``bynum 5:10`` selects atoms 5 through 10 inclusive. All atoms - in the :class:`MDAnalysis.Universe` are consecutively numbered, - and the index runs from 1 up to the total number of atoms. + in the :class:`~MDAnalysis.core.universe.Universe` are + consecutively numbered, and the index runs from 1 up to the + total number of atoms. **Preexisting selections** @@ -2008,7 +2314,7 @@ def select_atoms(self, sel, *othersel, **selgroups): included in the parsing just by comparison of atom indices. This means that it is up to the user to make sure the `group-name` group was defined in an appropriate - :class:`Universe`. + :class:`~MDAnalysis.core.universe.Universe`. global *selection* by default, when issuing @@ -2023,7 +2329,8 @@ def select_atoms(self, sel, *othersel, **selgroups): ``global`` absent, the result would be an empty selection since the ``protein`` subselection would itself be empty. When issuing :meth:`~MDAnalysis.core.groups.AtomGroup.select_atoms` from a - :class:`~MDAnalysis.core.universe.Universe`, ``global`` is ignored. + :class:`~MDAnalysis.core.universe.Universe`, ``global`` is + ignored. **Dynamic selections** If :meth:`~MDAnalysis.core.groups.AtomGroup.select_atoms` is @@ -2044,26 +2351,33 @@ def select_atoms(self, sel, *othersel, **selgroups): longer update across frames. - .. versionchanged:: 0.7.4 - Added *resnum* selection. - .. versionchanged:: 0.8.1 - Added *group* and *fullgroup* selections. - .. deprecated:: 0.11 - The use of ``fullgroup`` has been deprecated in favor of the equivalent - ``global group``. - .. versionchanged:: 0.13.0 - Added *bonded* selection - .. versionchanged:: 0.16.0 - Resid selection now takes icodes into account where present. - .. versionadded:: 0.16.0 - Updating selections now possible by setting the ``updating`` argument. - .. versionadded:: 0.17.0 - Added *moltype* and *molnum* selections. - + .. versionchanged:: 0.7.4 Added *resnum* selection. + .. versionchanged:: 0.8.1 Added *group* and *fullgroup* selections. + .. deprecated:: 0.11 The use of *fullgroup* has been deprecated in favor + of the equivalent *global group* selections. + .. versionchanged:: 0.13.0 Added *bonded* selection. + .. versionchanged:: 0.16.0 Resid selection now takes icodes into account + where present. + .. versionchanged:: 0.16.0 Updating selections now possible by setting + the `updating` argument. + .. versionchanged:: 0.17.0 Added *moltype* and *molnum* selections. + .. versionchanged:: 0.19.0 + Added strict type checking for passed groups. + Added periodic kwarg (default True) """ + # once flags removed, replace with default=True + periodic = selgroups.pop('periodic', flags['use_periodic_selections']) + updating = selgroups.pop('updating', False) sel_strs = (sel,) + othersel - selections = tuple((selection.Parser.parse(s, selgroups) + + for group, thing in selgroups.items(): + if not isinstance(thing, AtomGroup): + raise TypeError("Passed groups must be AtomGroups. " + "You provided {} for group '{}'".format( + thing.__class__.__name__, group)) + + selections = tuple((selection.Parser.parse(s, selgroups, periodic=periodic) for s in sel_strs)) if updating: atomgrp = UpdatingAtomGroup(self, selections, sel_strs) @@ -2074,7 +2388,8 @@ def select_atoms(self, sel, *othersel, **selgroups): return atomgrp def split(self, level): - """Split AtomGroup into a list of atomgroups by `level`. + """Split :class:`AtomGroup` into a :class:`list` of + :class:`AtomGroups` by `level`. Parameters ---------- @@ -2082,8 +2397,7 @@ def split(self, level): .. versionadded:: 0.9.0 - .. versionchanged:: 0.17.0 - Added the 'molecule' level. + .. versionchanged:: 0.17.0 Added the 'molecule' level. """ accessors = {'segment': 'segindices', 'residue': 'resindices', @@ -2105,15 +2419,16 @@ def split(self, level): accessors.keys())) return [self[levelindices == index] for index in - np.unique(levelindices)] + unique_int_1d(levelindices)] def guess_bonds(self, vdwradii=None): - """Guess bonds that exist within this AtomGroup and add to Universe + """Guess bonds that exist within this :class:`AtomGroup` and add them to + the underlying :attr:`~AtomGroup.universe`. Parameters ---------- vdwradii : dict, optional - Dict relating atom type: vdw radii + Dict relating atom types: vdw radii See Also @@ -2122,7 +2437,6 @@ def guess_bonds(self, vdwradii=None): .. versionadded:: 0.10.0 - """ from ..topology.core import guess_bonds, guess_angles, guess_dihedrals from .topologyattrs import Bonds, Angles, Dihedrals @@ -2151,15 +2465,13 @@ def get_TopAttr(u, name, cls): @property def bond(self): - """This AtomGroup represented as a Bond object - - Returns - ------- - A :class:`MDAnalysis.core.topologyobjects.Bond` object + """This :class:`AtomGroup` represented as a + :class:`MDAnalysis.core.topologyobjects.Bond` object Raises ------ - `ValueError` if the AtomGroup is not length 2 + ValueError + If the :class:`AtomGroup` is not length 2 .. versionadded:: 0.11.0 @@ -2171,15 +2483,13 @@ def bond(self): @property def angle(self): - """This AtomGroup represented as an Angle object - - Returns - ------- - A :class:`MDAnalysis.core.topologyobjects.Angle` object + """This :class:`AtomGroup` represented as an + :class:`MDAnalysis.core.topologyobjects.Angle` object Raises ------ - `ValueError` if the AtomGroup is not length 3 + ValueError + If the :class:`AtomGroup` is not length 3 .. versionadded:: 0.11.0 @@ -2191,15 +2501,13 @@ def angle(self): @property def dihedral(self): - """This AtomGroup represented as a Dihedral object - - Returns - ------- - A :class:`MDAnalysis.core.topologyobjects.Dihedral` object + """This :class:`AtomGroup` represented as a + :class:`~MDAnalysis.core.topologyobjects.Dihedral` object Raises ------ - `ValueError` if the AtomGroup is not length 4 + ValueError + If the :class:`AtomGroup` is not length 4 .. versionadded:: 0.11.0 @@ -2211,15 +2519,13 @@ def dihedral(self): @property def improper(self): - """This AtomGroup represented as an ImproperDihedral object - - Returns - ------- - A :class:`MDAnalysis.core.topologyobjects.ImproperDihedral` object + """This :class:`AtomGroup` represented as an + :class:`MDAnalysis.core.topologyobjects.ImproperDihedral` object Raises ------ - `ValueError` if the AtomGroup is not length 4 + ValueError + If the :class:`AtomGroup` is not length 4 .. versionadded:: 0.11.0 @@ -2230,21 +2536,31 @@ def improper(self): return topologyobjects.ImproperDihedral(self.ix, self.universe) def write(self, filename=None, file_format="PDB", - filenamefmt="{trjname}_{frame}", **kwargs): + filenamefmt="{trjname}_{frame}", frames=None, **kwargs): """Write `AtomGroup` to a file. The output can either be a coordinate file or a selection, depending on - the `format`. Only single-frame coordinate files are supported. If you - need to write out a trajectory, see :mod:`MDAnalysis.coordinates`. + the format. + + Examples + -------- + + >>> ag = u.atoms + >>> ag.write('selection.ndx') # Write a gromacs index file + >>> ag.write('coordinates.pdb') # Write the current frame as PDB + >>> # Write the trajectory in XTC format + >>> ag.write('trajectory.xtc', frames='all') + >>> # Write every other frame of the trajectory in PBD format + >>> ag.write('trajectory.pdb', frames=u.trajectory[::2]) Parameters ---------- filename : str, optional ``None``: create TRJNAME_FRAME.FORMAT from filenamefmt [``None``] file_format : str, optional - PDB, CRD, GRO, VMD (tcl), PyMol (pml), Gromacs (ndx) CHARMM (str) - Jmol (spt); case-insensitive and can also be supplied as the - filename extension [PDB] + The name or extension of a coordinate, trajectory, or selection + file format such as PDB, CRD, GRO, VMD (tcl), PyMol (pml), Gromacs + (ndx) CHARMM (str) or Jmol (spt); case-insensitive [PDB] filenamefmt : str, optional format string for default filename; use substitution tokens 'trjname' and 'frame' ["%(trjname)s_%(frame)d"] @@ -2253,28 +2569,72 @@ def write(self, filename=None, file_format="PDB", ``"conect"``: write only the CONECT records defined in the original file. ``"all"``: write out all bonds, both the original defined and those guessed by MDAnalysis. ``None``: do not write out bonds. - Default os ``"conect"``. - + Default is ``"conect"``. + frames: array-like or slice or FrameIteratorBase or str, optional + An ensemble of frames to write. The ensemble can be an list or + array of frame indices, a mask of booleans, an instance of + :class:`slice`, or the value returned when a trajectory is indexed. + By default, `frames` is set to ``None`` and only the current frame + is written. If `frames` is set to "all", then all the frame from + trajectory are written. - .. versionchanged:: 0.9.0 - Merged with write_selection. This method can now write both - selections out. + .. versionchanged:: 0.9.0 Merged with write_selection. This method can + now write both selections out. + .. versionchanged:: 0.19.0 + Can write multiframe trajectories with the 'frames' argument. """ + # TODO: Add a 'verbose' option alongside 'frames'. + # check that AtomGroup actually has any atoms (Issue #434) if len(self.atoms) == 0: raise IndexError("Cannot write an AtomGroup with 0 atoms") trj = self.universe.trajectory # unified trajectory API - - if trj.n_frames == 1: - kwargs.setdefault("multiframe", False) + if frames is None or frames == 'all': + trj_frames = trj[::] + elif isinstance(frames, numbers.Integral): + # We accept everything that indexes a trajectory and returns a + # subset of it. Though, numbers return a Timestep instead. + raise TypeError('The "frames" argument cannot be a number.') + else: + try: + test_trajectory = frames.trajectory + except AttributeError: + trj_frames = trj[frames] + else: + if test_trajectory is not trj: + raise ValueError( + 'The trajectory of {} provided to the frames keyword ' + 'attribute is different from the trajectory of the ' + 'AtomGroup.'.format(frames) + ) + trj_frames = frames if filename is None: trjname, ext = os.path.splitext(os.path.basename(trj.filename)) filename = filenamefmt.format(trjname=trjname, frame=trj.frame) filename = util.filename(filename, ext=file_format.lower(), keep=True) + # Some writer behave differently when they are given a "multiframe" + # argument. It is the case of the PDB writer tht writes models when + # "multiframe" is True. + # We want to honor what the user provided with the argument if + # provided explicitly. If not, then we need to figure out if we write + # multiple frames or not. + multiframe = kwargs.pop('multiframe', None) + if len(trj_frames) > 1 and multiframe == False: + raise ValueError( + 'Cannot explicitely set "multiframe" to False and request ' + 'more than 1 frame with the "frames" keyword argument.' + ) + elif multiframe is None: + if frames is None: + # By default we only write the current frame. + multiframe = False + else: + multiframe = len(trj_frames) > 1 + # From the following blocks, one must pass. # Both can't pass as the extensions don't overlap. # Try and select a Class using get_ methods (becomes `writer`) @@ -2287,89 +2647,118 @@ def write(self, filename=None, file_format="PDB", format = format or file_format format = format.strip().upper() - multiframe = kwargs.pop('multiframe', None) - writer = get_writer_for(filename, format=format, multiframe=multiframe) - #MDAnalysis.coordinates.writer(filename, **kwargs) - coords = True except (ValueError, TypeError): - coords = False + pass + else: + with writer(filename, n_atoms=self.n_atoms, **kwargs) as w: + if frames is None: + w.write(self.atoms) + else: + current_frame = trj.ts.frame + try: + for _ in trj_frames: + w.write(self.atoms) + finally: + trj[current_frame] + return try: # here `file_format` is only used as default, # anything pulled off `filename` will be used preferentially writer = get_selection_writer_for(filename, file_format) - selection = True except (TypeError, NotImplementedError): - selection = False - - if not (coords or selection): - raise ValueError("No writer found for format: {}".format(filename)) + pass else: with writer(filename, n_atoms=self.n_atoms, **kwargs) as w: w.write(self.atoms) + return + + raise ValueError("No writer found for format: {}".format(filename)) class ResidueGroup(GroupBase): """ResidueGroup base class. - This class is used by a :class:`Universe` for generating its - Topology-specific :class:`ResidueGroup` class. All the - :class:`TopologyAttr` components are obtained from - :class:`GroupBase`, so this class only includes ad-hoc methods - specific to ResidueGroups. + This class is used by a :class:`~MDAnalysis.core.universe.Universe` for + generating its Topology-specific :class:`ResidueGroup` class. All the + :class:`~MDAnalysis.core.topologyattrs.TopologyAttr` components are obtained + from :class:`GroupBase`, so this class only includes ad-hoc methods + specific to :class:`ResidueGroups`. ResidueGroups can be compared and combined using group operators. See the list of these operators on :class:`GroupBase`. .. deprecated:: 0.16.2 *Instant selectors* of Segments will be removed in the 1.0 release. - See :ref:`Instant selectors ` for details and alternatives. - + See :ref:`Instant selectors ` for details and + alternatives. """ @property def atoms(self): - """Get an :class:`AtomGroup` of atoms represented in this + """An :class:`AtomGroup` of :class:`Atoms` present in this :class:`ResidueGroup`. - The atoms are ordered locally by residue in the - :class:`ResidueGroup`. No duplicates are removed. - + The :class:`Atoms` are ordered locally by :class:`Residue` in the + :class:`ResidueGroup`. Duplicates are *not* removed. """ - return self.universe.atoms[np.concatenate(self.indices)] + ag = self.universe.atoms[np.concatenate(self.indices)] + # If the ResidueGroup is known to be unique, this also holds for the + # atoms therein, since atoms can only belong to one residue at a time. + # On the contrary, if the ResidueGroup is not unique, this does not + # imply non-unique atoms, since residues might be empty. + try: + if self._cache['isunique']: + ag._cache['isunique'] = True + ag._cache['unique'] = ag + except KeyError: + pass + return ag @property def n_atoms(self): - """Number of atoms represented in :class:`ResidueGroup`, including - duplicate residues. + """Number of :class:`Atoms` present in this :class:`ResidueGroup`, + including duplicate residues (and thus, duplicate atoms). Equivalent to ``len(self.atoms)``. - """ return len(self.atoms) @property def residues(self): - """Get another :class:`ResidueGroup` identical to this one. + """The :class:`ResidueGroup` itself. + + See Also + -------- + copy : return a true copy of the :class:`ResidueGroup` + + + .. versionchanged:: 0.19.0 + In previous versions, this returned a copy, but now + the :class:`ResidueGroup` itself is returned. This should + not affect any code but only speed up calculations. """ - return self.universe.residues[self.ix] + return self @property def n_residues(self): - """Number of residues in ResidueGroup. Equivalent to ``len(self)``. + """Number of residues in the :class:`ResidueGroup`. + Equivalent to ``len(self)``. """ return len(self) @property def segments(self): - """Get sorted SegmentGroup of the (unique) segments represented in the - ResidueGroup. - + """Get sorted :class:`SegmentGroup` of the unique segments present in + the :class:`ResidueGroup`. """ - return self.universe.segments[np.unique(self.segindices)] + sg = self.universe.segments[unique_int_1d(self.segindices)] + sg._cache['isunique'] = True + sg._cache['unique'] = sg + return sg @segments.setter def segments(self, new): @@ -2382,8 +2771,8 @@ def segments(self, new): try: s_ix = [s.segindex for s in new] except AttributeError: - raise TypeError("Can only set ResidueGroup residues to Segment " - "or ResidueGroup not {}".format( + raise TypeError("Can only set ResidueGroup segments to Segment " + "or SegmentGroup, not {}".format( ', '.join(type(r) for r in new if not isinstance(r, Segment)) )) @@ -2400,16 +2789,19 @@ def segments(self, new): @property def n_segments(self): - """Number of unique segments represented in the ResidueGroup. + """Number of unique segments present in the ResidueGroup. Equivalent to ``len(self.segments)``. - """ return len(self.segments) @property + @cached('unique') def unique(self): - """Return a ResidueGroup containing sorted and unique residues only. + """Return a :class:`ResidueGroup` containing sorted and unique + :class:`Residues` only. + + If the :class:`ResidueGroup` is unique, this is the group itself. Examples -------- @@ -2424,86 +2816,137 @@ def unique(self): >>> rg2.ix array([0, 1, 2]) + >>> rg2.unique is rg2 + True + .. versionadded:: 0.16.0 + .. versionchanged:: 0.19.0 If the :class:`ResidueGroup` is already + unique, :attr:`ResidueGroup.unique` now returns the group itself + instead of a copy. """ - return self.universe.residues[np.unique(self.ix)] + if self.isunique: + return self + _unique = self.universe.residues[unique_int_1d(self.ix)] + # Since we know that _unique is a unique ResidueGroup, we set its + # uniqueness caches from here: + _unique._cache['isunique'] = True + _unique._cache['unique'] = _unique + return _unique class SegmentGroup(GroupBase): - """SegmentGroup base class. + """:class:`SegmentGroup` base class. - This class is used by a Universe for generating its Topology-specific - SegmentGroup class. All the TopologyAttr components are obtained from - GroupBase, so this class only includes ad-hoc methods specific to - SegmentGroups. + This class is used by a :class:`~MDAnalysis.core.universe.Universe` for + generating its Topology-specific :class:`SegmentGroup` class. All the + :class:`~MDAnalysis.core.topologyattrs.TopologyAttr` components are obtained + from :class:`GroupBase`, so this class only includes ad-hoc methods specific + to :class:`SegmentGroups`. - SegmentGroups can be compared and combined using group operators. See the - list of these operators on :class:`GroupBase`. + :class:`SegmentGroups` can be compared and combined using + group operators. See the list of these operators on :class:`GroupBase`. .. deprecated:: 0.16.2 *Instant selectors* of Segments will be removed in the 1.0 release. - See :ref:`Instant selectors ` for details and alternatives. - + See :ref:`Instant selectors ` for details and + alternatives. """ @property def atoms(self): - """Get an AtomGroup of atoms represented in this SegmentGroup. - - The atoms are ordered locally by residue, which are further ordered by - segment in the SegmentGroup. No duplicates are removed. - - """ - return self.universe.atoms[np.concatenate(self.indices)] + """An :class:`AtomGroup` of :class:`Atoms` present in this + :class:`SegmentGroup`. + + The :class:`Atoms` are ordered locally by :class:`Residue`, which + are further ordered by :class:`Segment` in the :class:`SegmentGroup`. + Duplicates are *not* removed. + """ + ag = self.universe.atoms[np.concatenate(self.indices)] + # If the SegmentGroup is known to be unique, this also holds for the + # residues therein, and thus, also for the atoms in those residues. + # On the contrary, if the SegmentGroup is not unique, this does not + # imply non-unique atoms, since segments or residues might be empty. + try: + if self._cache['isunique']: + ag._cache['isunique'] = True + ag._cache['unique'] = ag + except KeyError: + pass + return ag @property def n_atoms(self): - """Number of atoms represented in SegmentGroup, including duplicate - segments. + """Number of atoms present in the :class:`SegmentGroup`, including + duplicate segments (and thus, duplicate atoms). Equivalent to ``len(self.atoms)``. - """ return len(self.atoms) @property def residues(self): - """Get a ResidueGroup of residues represented in this SegmentGroup. - - The residues are ordered locally by segment in the SegmentGroup. - No duplicates are removed. - - """ - return self.universe.residues[np.concatenate(self.resindices)] + """A :class:`ResidueGroup` of :class:`Residues` present in this + :class:`SegmentGroup`. + + The :class:`Residues` are ordered locally by + :class:`Segment` in the :class:`SegmentGroup`. Duplicates are *not* + removed. + """ + rg = self.universe.residues[np.concatenate(self.resindices)] + # If the SegmentGroup is known to be unique, this also holds for the + # residues therein. On the contrary, if the SegmentGroup is not unique, + # this does not imply non-unique residues, since segments might be + # empty. + try: + if self._cache['isunique']: + rg._cache['isunique'] = True + rg._cache['unique'] = rg + except KeyError: + pass + return rg @property def n_residues(self): - """Number of residues represented in SegmentGroup, including duplicate - segments. + """Number of residues present in this :class:`SegmentGroup`, including + duplicate segments (and thus, residues). Equivalent to ``len(self.residues)``. - """ return len(self.residues) @property def segments(self): - """Get another SegmentGroup identical to this one. + """The :class:`SegmentGroup` itself. + + See Also + -------- + copy : return a true copy of the :class:`SegmentGroup` + + + .. versionchanged:: 0.19.0 + In previous versions, this returned a copy, but now + the :class:`SegmentGroup` itself is returned. This should + not affect any code but only speed up calculations. """ - return self.universe.segments[self.ix] + return self @property def n_segments(self): - """Number of segments in SegmentGroup. Equivalent to ``len(self)``. + """Number of segments in the :class:`SegmentGroup`. + Equivalent to ``len(self)``. """ return len(self) @property + @cached('unique') def unique(self): - """Return a SegmentGroup containing sorted and unique segments only. + """Return a :class:`SegmentGroup` containing sorted and unique + :class:`Segments` only. + + If the :class:`SegmentGroup` is unique, this is the group itself. Examples -------- @@ -2518,16 +2961,29 @@ def unique(self): >>> sg2.ix array([0, 1, 2]) + >>> sg2.unique is sg2 + True - .. versionadded:: 0.16.0 + .. versionadded:: 0.16.0 + .. versionchanged:: 0.19.0 If the :class:`SegmentGroup` is already + unique, :attr:`SegmentGroup.unique` now returns the group itself + instead of a copy. """ - return self.universe.segments[np.unique(self.ix)] + if self.isunique: + return self + _unique = self.universe.segments[unique_int_1d(self.ix)] + # Since we know that _unique is a unique SegmentGroup, we set its + # uniqueness caches from here: + _unique._cache['isunique'] = True + _unique._cache['unique'] = _unique + return _unique @functools.total_ordering class ComponentBase(_MutableBase): - """Base class from which a Universe's Component class is built. + """Base class from which a :class:`~MDAnalysis.core.universe.Universe`\ 's + Component class is built. Components are the individual objects that are found in Groups. """ @@ -2566,7 +3022,6 @@ def __add__(self, other): ------- Group Group with elements of `self` and `other` concatenated - """ o_ix = other.ix_array @@ -2586,7 +3041,6 @@ def __radd__(self, other): ------- self Group with elements of `self` reproduced - """ if other == 0: return self.level.plural(self.ix_array, self.universe) @@ -2603,10 +3057,10 @@ def universe(self): def ix(self): """Unique index of this component. - If this component is an Atom, this is the index of the atom. - If it is a Residue, this is the index of the residue. - If it is a Segment, this is the index of the segment. - + If this component is an :class:`Atom`, this is the index of the + :class:`Atom`. + If it is a :class:`Residue`, this is the index of the :class:`Residue`. + If it is a :class:`Segment`, this is the index of the :class:`Segment`. """ return self._ix @@ -2624,12 +3078,13 @@ def ix_array(self): class Atom(ComponentBase): - """Atom base class. - - This class is used by a Universe for generating its Topology-specific Atom - class. All the TopologyAttr components are obtained from ComponentBase, so - this class only includes ad-hoc methods specific to Atoms. + """:class:`Atom` base class. + This class is used by a :class:`~MDAnalysis.core.universe.Universe` for + generating its Topology-specific :class:`Atom` class. All the + :class:`~MDAnalysis.core.topologyattrs.TopologyAttr` components are obtained + from :class:`ComponentBase`, so this class only includes ad-hoc methods + specific to :class:`Atoms`. """ def __getattr__(self, attr): """Try and catch known attributes and give better error message""" @@ -2662,8 +3117,8 @@ def residue(self): @residue.setter def residue(self, new): if not isinstance(new, Residue): - raise TypeError( - "Can only set Atom residue to Residue, not {}".format(type(new))) + raise TypeError("Can only set Atom residue to Residue, not {}" + "".format(type(new))) self.universe._topology.tt.move_atom(self.ix, new.resindex) @property @@ -2681,9 +3136,16 @@ def position(self): The position can be changed by assigning an array of length (3,). - .. note:: changing the position is not reflected in any files; reading any - frame from the trajectory will replace the change with that - from the file + .. note:: changing the position is not reflected in any files; reading + any frame from the trajectory will replace the change with + that from the file + + Raises + ------ + ~MDAnalysis.exceptions.NoDataError + If the underlying :class:`~MDAnalysis.coordinates.base.Timestep` + does not contain + :attr:`~MDAnalysis.coordinates.base.Timestep.positions`. """ return self.universe.trajectory.ts.positions[self.ix].copy() @@ -2695,15 +3157,18 @@ def position(self, values): def velocity(self): """Velocity of the atom. - The velocity can be changed by assigning an array of shape (3,). + The velocity can be changed by assigning an array of shape ``(3,)``. - .. note:: changing the velocity is not reflected in any files; reading any - frame from the trajectory will replace the change with that - from the file - - A :exc:`~MDAnalysis.NoDataError` is raised if the trajectory - does not contain velocities. + .. note:: changing the velocity is not reflected in any files; reading + any frame from the trajectory will replace the change with + that from the file + Raises + ------ + ~MDAnalysis.exceptions.NoDataError + If the underlying :class:`~MDAnalysis.coordinates.base.Timestep` + does not contain + :attr:`~MDAnalysis.coordinates.base.Timestep.velocities`. """ ts = self.universe.trajectory.ts try: @@ -2723,15 +3188,18 @@ def velocity(self, values): def force(self): """Force on the atom. - The force can be changed by assigning an array of shape (3,). + The force can be changed by assigning an array of shape ``(3,)``. .. note:: changing the force is not reflected in any files; reading any frame from the trajectory will replace the change with that from the file - A :exc:`~MDAnalysis.NoDataError` is raised if the trajectory - does not contain forces. - + Raises + ------ + ~MDAnalysis.exceptions.NoDataError + If the underlying :class:`~MDAnalysis.coordinates.base.Timestep` + does not contain + :attr:`~MDAnalysis.coordinates.base.Timestep.forces`. """ ts = self.universe.trajectory.ts try: @@ -2749,13 +3217,13 @@ def force(self, values): class Residue(ComponentBase): - """Residue base class. - - This class is used by a Universe for generating its Topology-specific - Residue class. All the TopologyAttr components are obtained from - ComponentBase, so this class only includes ad-hoc methods specific to - Residues. + """:class:`Residue` base class. + This class is used by a :class:`~MDAnalysis.core.universe.Universe` for + generating its Topology-specific :class:`Residue` class. All the + :class:`~MDAnalysis.core.topologyattrs.TopologyAttr` components are obtained + from :class:`ComponentBase`, so this class only includes ad-hoc methods + specific to :class:`Residues`. """ def __repr__(self): me = '` present in this + :class:`Residue`. + """ + ag = self.universe.atoms[self.universe._topology.indices[self][0]] + ag._cache['isunique'] = True + ag._cache['unique'] = ag + return ag @property def segment(self): + """The :class:`Segment` this :class:`Residue` belongs to. + """ return self.universe.segments[self.universe._topology.segindices[self]] @segment.setter def segment(self, new): if not isinstance(new, Segment): - raise TypeError( - "Can only set Residue segment to Segment, not {}".format(type(new))) + raise TypeError("Can only set Residue segment to Segment, not {}" + "".format(type(new))) self.universe._topology.tt.move_residue(self.ix, new.segindex) class Segment(ComponentBase): - """Segment base class. + """:class:`Segment` base class. - This class is used by a Universe for generating its Topology-specific - Segment class. All the TopologyAttr components are obtained from - ComponentBase, so this class only includes ad-hoc methods specific to - Segments. + This class is used by a :class:`~MDAnalysis.core.universe.Universe` for + generating its Topology-specific :class:`Segment` class. All the + :class:`~MDAnalysis.core.topologyattrs.TopologyAttr` components are obtained + from :class:`ComponentBase`, so this class only includes ad-hoc methods + specific to :class:`Segments`. .. deprecated:: 0.16.2 - *Instant selectors* of Segments will be removed in the 1.0 release. - See :ref:`Instant selectors ` for details and alternatives. - + *Instant selectors* of :class:`Segments` will be removed in the + 1.0 release. See :ref:`Instant selectors ` for + details and alternatives. """ def __repr__(self): me = '` present in this + :class:`Segment`. + """ + ag = self.universe.atoms[self.universe._topology.indices[self][0]] + ag._cache['isunique'] = True + ag._cache['unique'] = ag + return ag @property def residues(self): - return self.universe.residues[self.universe._topology.resindices[self][0]] + """A :class:`ResidueGroup` of :class:`Residues` present in this + :class:`Segment`. + """ + rg = self.universe.residues[self.universe._topology.resindices[self][0]] + rg._cache['isunique'] = True + rg._cache['unique'] = rg + return rg def __getattr__(self, attr): # DEPRECATED in 0.16.2 @@ -2817,8 +3306,8 @@ def __getattr__(self, attr): if attr.startswith('r') and attr[1:].isdigit(): resnum = int(attr[1:]) rg = self.residues[resnum - 1] # convert to 0 based - warnings.warn("Instant selectors Segment.r will be removed in 1.0. " - "Use Segment.residues[N-1] instead.", + warnings.warn("Instant selectors Segment.r will be removed in " + "1.0. Use Segment.residues[N-1] instead.", DeprecationWarning) return rg # Resname accesss @@ -2854,8 +3343,8 @@ class UpdatingAtomGroup(AtomGroup): normally; otherwise the group is updated (the stored selections are re-applied), and only then is the attribute returned. - .. versionadded:: 0.16.0 + .. versionadded:: 0.16.0 """ # WARNING: This class has __getattribute__ and __getattr__ methods (the # latter inherited from AtomGroup). Because of this bugs introduced in the @@ -2873,7 +3362,6 @@ def __init__(self, base_group, selections, strings): group on which *selections* are to be applied. selections : a tuple of :class:`~MDAnalysis.core.selection.Selection` instances selections ready to be applied to *base_group*. - """ # Because we're implementing __getattribute__, which needs _u for # its check, no self.attribute access can be made before this line @@ -2894,7 +3382,6 @@ def update_selection(self): This method is triggered automatically when accessing attributes, if the last update occurred under a different trajectory frame. - """ bg = self._base_group sels = self._selections @@ -2904,7 +3391,8 @@ def update_selection(self): sels[0].apply(bg)).ix else: ix = np.array([], dtype=np.intp) - # Run back through AtomGroup init with this information to remake ourselves + # Run back through AtomGroup init with this information to remake + # ourselves super(UpdatingAtomGroup, self).__init__(ix, self.universe) self.is_uptodate = True @@ -2920,8 +3408,8 @@ def is_uptodate(self): Returns ------- bool - `True` if the group's selection is up-to-date, `False` otherwise. - + ``True`` if the group's selection is up-to-date, ``False`` + otherwise. """ try: return self.universe.trajectory.frame == self._lastupdate @@ -2941,13 +3429,12 @@ def is_uptodate(self, value): def _ensure_updated(self): """ - Checks whether the selection needs updating and updates it, if needed. + Checks whether the selection needs updating and updates it if needed. Returns ------- bool - `True` if the group was already up-to-date, `False` otherwise. - + ``True`` if the group was already up-to-date, ``False`` otherwise. """ status = self.is_uptodate if not status: @@ -2969,7 +3456,8 @@ def __reduce__(self): # - recreate UAG as created through select_atoms (basegroup and selstrs) # even if base_group is a UAG this will work through recursion return (_unpickle_uag, - (self._base_group.__reduce__(), self._selections, self._selection_strings)) + (self._base_group.__reduce__(), self._selections, + self._selection_strings)) def __repr__(self): basestr = super(UpdatingAtomGroup, self).__repr__() @@ -2986,6 +3474,69 @@ def __repr__(self): return "{}, with selection{} {} on {}>".format(basestr[:-1], "s"[len(self._selection_strings)==1:], sels, basegrp) + @property + def atoms(self): + """Get a *static* :class:`AtomGroup` identical to the group of currently + selected :class:`Atoms` in the :class:`UpdatingAtomGroup`. + + + By returning a *static* :class:`AtomGroup` it becomes possible to + compare the contents of the group *between* trajectory frames. See the + Example below. + + + Note + ---- + The :attr:`atoms` attribute of an :class:`UpdatingAtomGroup` behaves + differently from :attr:`AtomGroup.atoms`: the latter returns the + :class:`AtomGroup` itself whereas the former returns a + :class:`AtomGroup` and not an :class:`UpdatingAtomGroup` (for this, use + :meth:`UpdatingAtomGroup.copy`). + + + Example + ------- + The static :attr:`atoms` allows comparison of groups of atoms between + frames. For example, track water molecules that move in and out of a + solvation shell of a protein:: + + u = mda.Universe(TPR, XTC) + water_shell = u.select_atoms("name OW and around 3.5 protein", updating=True) + water_shell_prev = water_shell.atoms + + for ts in u.trajectory: + exchanged = water_shell - water_shell_prev + + print(ts.time, "waters in shell =", water_shell.n_residues) + print(ts.time, "waters that exchanged = ", exchanged.n_residues) + print(ts.time, "waters that remained bound = ", + water_shell.n_residues - exchanged.n_residues) + + water_shell_prev = water_shell.atoms + + By remembering the atoms of the current time step in + `water_shell_prev`, it becomes possible to use the :meth:`subtraction + of AtomGroups` to find the water molecules that + changed. + + + See Also + -------- + copy : return a true copy of the :class:`UpdatingAtomGroup` + + """ + return self[:] + + def copy(self): + """Get another :class:`UpdatingAtomGroup` identical to this one. + + + .. versionadded:: 0.19.0 + """ + return UpdatingAtomGroup(self._base_group, self._selections, + self._selection_strings) + + # Define relationships between these classes # with Level objects _Level = namedtuple('Level', ['name', 'singular', 'plural']) @@ -3001,17 +3552,17 @@ def __repr__(self): SegmentGroup.level = SEGMENTLEVEL def requires(*attrs): - """Decorator to check if all AtomGroup arguments have certain attributes + """Decorator to check if all :class:`AtomGroup` arguments have certain + attributes Example ------- - When used to wrap a function, will check all AtomGroup arguments for the - listed requirements + When used to wrap a function, will check all :class:`AtomGroup` arguments + for the listed requirements @requires('masses', 'charges') def mass_times_charge(atomgroup): return atomgroup.masses * atomgroup.charges - """ def require_dec(func): @functools.wraps(func) diff --git a/package/MDAnalysis/core/selection.py b/package/MDAnalysis/core/selection.py index d8a7b6d7815..4c471419957 100644 --- a/package/MDAnalysis/core/selection.py +++ b/package/MDAnalysis/core/selection.py @@ -48,9 +48,9 @@ import numpy as np from numpy.lib.utils import deprecate -from Bio.KDTree import KDTree -from MDAnalysis.lib.pkdtree import PeriodicKDTree + +from MDAnalysis.lib.util import unique_int_1d from MDAnalysis.core import flags from ..lib import distances from ..exceptions import SelectionError, NoDataError @@ -219,33 +219,14 @@ class ByResSelection(UnarySelection): def apply(self, group): res = self.sel.apply(group) - unique_res = np.unique(res.resids) + unique_res = unique_int_1d(res.resids.astype(np.int64)) mask = np.in1d(group.resids, unique_res) return group[mask].unique class DistanceSelection(Selection): - """Base class for distance search based selections - - Grabs the flags for this selection - - 'use_KDTree_routines' - - 'use_periodic_selections' - - Populates the `apply` method with either - - _apply_KDTree - - _apply_distmat - """ - def __init__(self): - if flags['use_KDTree_routines'] in (True, 'fast', 'always'): - self.apply = self._apply_KDTree - else: - self.apply = self._apply_distmat - - self.periodic = flags['use_periodic_selections'] - # KDTree doesn't support periodic - if self.periodic: - self.apply = self._apply_distmat + """Base class for distance search based selections""" def validate_dimensions(self, dimensions): r"""Check if the system is periodic in all three-dimensions. @@ -270,93 +251,52 @@ class AroundSelection(DistanceSelection): precedence = 1 def __init__(self, parser, tokens): - super(AroundSelection, self).__init__() + self.periodic = parser.periodic self.cutoff = float(tokens.popleft()) self.sel = parser.parse_expression(self.precedence) - def _apply_KDTree(self, group): - """KDTree based selection is about 7x faster than distmat - for typical problems. - """ + def apply(self, group): + indices = [] sel = self.sel.apply(group) # All atoms in group that aren't in sel sys = group[~np.in1d(group.indices, sel.indices)] - box = self.validate_dimensions(group.dimensions) - if box is None: - kdtree = KDTree(dim=3, bucket_size=10) - kdtree.set_coords(sys.positions) - found_indices = [] - for atom in sel.positions: - kdtree.search(atom, self.cutoff) - found_indices.append(kdtree.get_indices()) - unique_idx = np.unique(np.concatenate(found_indices)) - - else: - kdtree = PeriodicKDTree(box, bucket_size=10) - kdtree.set_coords(sys.positions) - kdtree.search(sel.positions, self.cutoff) - unique_idx = np.asarray(kdtree.get_indices()) - - # These are the indices from SYS that were seen when - # probing with SEL - return sys[unique_idx.astype(np.int32)].unique - - def _apply_distmat(self, group): - sel = self.sel.apply(group) - sys = group[~np.in1d(group.indices, sel.indices)] + if not sys or not sel: + return sys[[]] box = self.validate_dimensions(group.dimensions) - dist = distances.distance_array( - sys.positions, sel.positions, box) - - mask = (dist <= self.cutoff).any(axis=1) - - return sys[mask].unique + pairs = distances.capped_distance(sel.positions, sys.positions, + self.cutoff, box=box, + return_distances=False) + if pairs.size > 0: + indices = np.sort(pairs[:, 1]) + return sys[np.asarray(indices, dtype=np.int64)].unique class SphericalLayerSelection(DistanceSelection): token = 'sphlayer' precedence = 1 def __init__(self, parser, tokens): - super(SphericalLayerSelection, self).__init__() + self.periodic = parser.periodic self.inRadius = float(tokens.popleft()) self.exRadius = float(tokens.popleft()) self.sel = parser.parse_expression(self.precedence) - - def _apply_KDTree(self, group): - """Selection using KDTree and PeriodicKDTree for aperiodic and - fully-periodic systems, respectively. - """ - sel = self.sel.apply(group) - box = self.validate_dimensions(group.dimensions) - ref = sel.center_of_geometry(pbc=self.periodic) - if box is None: - kdtree = KDTree(dim=3, bucket_size=10) - else: - kdtree = PeriodicKDTree(box, bucket_size=10) - kdtree.set_coords(group.positions) - kdtree.search(ref, self.exRadius) - found_ExtIndices = kdtree.get_indices() - kdtree.search(ref, self.inRadius) - found_IntIndices = kdtree.get_indices() - found_indices = list(set(found_ExtIndices) - set(found_IntIndices)) - return group[found_indices].unique - - def _apply_distmat(self, group): + + def apply(self, group): + indices = [] sel = self.sel.apply(group) box = self.validate_dimensions(group.dimensions) periodic = box is not None - ref = sel.center_of_geometry(pbc=periodic).reshape(1, 3).astype( - np.float32) - d = distances.distance_array(ref, - group.positions, - box=box)[0] - mask = d < self.exRadius - mask &= d > self.inRadius + ref = sel.center_of_geometry().reshape(1, 3).astype(np.float32) + pairs = distances.capped_distance(ref, group.positions, self.exRadius, + min_cutoff=self.inRadius, + box=box, + return_distances=False) + if pairs.size > 0: + indices = np.sort(pairs[:, 1]) - return group[mask].unique + return group[np.asarray(indices, dtype=np.int64)].unique class SphericalZoneSelection(DistanceSelection): @@ -364,43 +304,26 @@ class SphericalZoneSelection(DistanceSelection): precedence = 1 def __init__(self, parser, tokens): - super(SphericalZoneSelection, self).__init__() + self.periodic = parser.periodic self.cutoff = float(tokens.popleft()) self.sel = parser.parse_expression(self.precedence) - def _apply_KDTree(self, group): - """Selection using KDTree and PeriodicKDTree for aperiodic and - fully-periodic systems, respectively. - """ - sel = self.sel.apply(group) - box = self.validate_dimensions(group.dimensions) - ref = sel.center_of_geometry(pbc=self.periodic) - if box is None: - kdtree = KDTree(dim=3, bucket_size=10) - else: - kdtree = PeriodicKDTree(box, bucket_size=10) - kdtree.set_coords(group.positions) - kdtree.search(ref, self.cutoff) - found_indices = kdtree.get_indices() - return group[found_indices].unique - - def _apply_distmat(self, group): + def apply(self, group): + indices = [] sel = self.sel.apply(group) box = self.validate_dimensions(group.dimensions) periodic = box is not None - ref = sel.center_of_geometry(pbc=periodic).reshape(1, 3).\ - astype(np.float32) - d = distances.distance_array(ref, - group.positions, - box=box)[0] - idx = d < self.cutoff - return group[idx].unique + ref = sel.center_of_geometry().reshape(1, 3).astype(np.float32) + pairs = distances.capped_distance(ref, group.positions, self.cutoff, + box=box, + return_distances=False) + if pairs.size > 0: + indices = np.sort(pairs[:, 1]) + return group[np.asarray(indices, dtype=np.int64)].unique -class CylindricalSelection(Selection): - def __init__(self): - self.periodic = flags['use_periodic_selections'] +class CylindricalSelection(Selection): def apply(self, group): sel = self.sel.apply(group) @@ -463,7 +386,7 @@ class CylindricalZoneSelection(CylindricalSelection): precedence = 1 def __init__(self, parser, tokens): - super(CylindricalZoneSelection, self).__init__() + self.periodic = parser.periodic self.exRadius = float(tokens.popleft()) self.zmax = float(tokens.popleft()) self.zmin = float(tokens.popleft()) @@ -475,7 +398,7 @@ class CylindricalLayerSelection(CylindricalSelection): precedence = 1 def __init__(self, parser, tokens): - super(CylindricalLayerSelection, self).__init__() + self.periodic = parser.periodic self.inRadius = float(tokens.popleft()) self.exRadius = float(tokens.popleft()) self.zmax = float(tokens.popleft()) @@ -487,34 +410,23 @@ class PointSelection(DistanceSelection): token = 'point' def __init__(self, parser, tokens): - super(PointSelection, self).__init__() + self.periodic = parser.periodic x = float(tokens.popleft()) y = float(tokens.popleft()) z = float(tokens.popleft()) self.ref = np.array([x, y, z], dtype=np.float32) self.cutoff = float(tokens.popleft()) - def _apply_KDTree(self, group): - box = group.dimensions if self.periodic else None - if box is None: - kdtree = KDTree(dim=3, bucket_size=10) - else: - kdtree = PeriodicKDTree(box, bucket_size=10) - kdtree.set_coords(group.positions) - kdtree.search(self.ref, self.cutoff) - found_indices = kdtree.get_indices() - - return group[found_indices].unique - - def _apply_distmat(self, group): - ref_coor = self.ref[np.newaxis, ...] - - ref_coor = np.asarray(ref_coor, dtype=np.float32) - box = group.dimensions if self.periodic else None + def apply(self, group): + indices = [] + box = self.validate_dimensions(group.dimensions) + pairs = distances.capped_distance(self.ref[None, :], group.positions, self.cutoff, + box=box, + return_distances=False) + if pairs.size > 0: + indices = np.sort(pairs[:, 1]) - dist = distances.distance_array(group.positions, ref_coor, box) - mask = (dist <= self.cutoff).any(axis=1) - return group[mask].unique + return group[np.asarray(indices, dtype=np.int64)].unique class AtomSelection(Selection): @@ -582,7 +494,7 @@ def apply(self, group): mask = np.in1d(group.indices, self.grp.indices) return group[mask] - +# TODO: remove in 1.0 (should have been removed in 0.15.0) class FullSelgroupSelection(Selection): token = 'fullgroup' @@ -1204,7 +1116,7 @@ def expect(self, token): "Unexpected token: '{0}' Expected: '{1}'" "".format(self.tokens[0], token)) - def parse(self, selectstr, selgroups): + def parse(self, selectstr, selgroups, periodic=None): """Create a Selection object from a string. Parameters @@ -1213,6 +1125,9 @@ def parse(self, selectstr, selgroups): The string that describes the selection selgroups : AtomGroups AtomGroups to be used in `group` selections + periodic : bool, optional + for distance based selections, whether to consider + periodic boundary conditions Returns ------- @@ -1224,6 +1139,8 @@ def parse(self, selectstr, selgroups): SelectionError If anything goes wrong in creating the Selection object. """ + self.periodic = periodic + self.selectstr = selectstr self.selgroups = selgroups tokens = selectstr.replace('(', ' ( ').replace(')', ' ) ') diff --git a/package/MDAnalysis/core/topologyattrs.py b/package/MDAnalysis/core/topologyattrs.py index e85c84d536e..2c59566bec6 100644 --- a/package/MDAnalysis/core/topologyattrs.py +++ b/package/MDAnalysis/core/topologyattrs.py @@ -48,7 +48,7 @@ from numpy.lib.utils import deprecate from . import flags -from ..lib.util import cached, convert_aa_code, iterable +from ..lib.util import cached, convert_aa_code, iterable, warn_if_not_unique from ..lib import transformations, mdamath from ..exceptions import NoDataError, SelectionError from .topologyobjects import TopologyGroup @@ -198,6 +198,8 @@ class TopologyAttr(six.with_metaclass(_TopologyAttrMeta, object)): name for the attribute on a singular object (Atom/Residue/Segment) per_object : str If there is a strict mapping between Component and Attribute + dtype : int/float/object + Type to coerce this attribute to be. For string use 'object' top : Topology handle for the Topology object TopologyAttr is associated with @@ -211,9 +213,13 @@ class TopologyAttr(six.with_metaclass(_TopologyAttrMeta, object)): groupdoc = None singledoc = None + dtype = None def __init__(self, values, guessed=False): - self.values = values + if self.dtype is None: + self.values = values + else: + self.values = np.asarray(values, dtype=self.dtype) self._guessed = guessed @staticmethod @@ -244,6 +250,9 @@ def from_blank(cls, n_atoms=None, n_residues=None, n_segments=None, """ if values is None: values = cls._gen_initial_values(n_atoms, n_residues, n_segments) + elif cls.dtype is not None: + # if supplied starting values and statically typed + values = np.asarray(values, dtype=cls.dtype) return cls(values) def copy(self): @@ -450,6 +459,7 @@ class Atomids(AtomAttr): attrname = 'ids' singular = 'id' per_object = 'atom' + dtype = int @staticmethod def _gen_initial_values(na, nr, ns): @@ -463,6 +473,7 @@ class Atomnames(AtomAttr): attrname = 'names' singular = 'name' per_object = 'atom' + dtype = object transplants = defaultdict(list) @staticmethod @@ -627,6 +638,7 @@ class Atomtypes(AtomAttr): attrname = 'types' singular = 'type' per_object = 'atom' + dtype = object @staticmethod def _gen_initial_values(na, nr, ns): @@ -638,6 +650,7 @@ class Elements(AtomAttr): """Element for each atom""" attrname = 'elements' singular = 'element' + dtype = object @staticmethod def _gen_initial_values(na, nr, ns): @@ -650,6 +663,7 @@ class Radii(AtomAttr): attrname = 'radii' singular = 'radius' per_object = 'atom' + dtype = float @staticmethod def _gen_initial_values(na, nr, ns): @@ -698,6 +712,7 @@ class ChainIDs(AtomAttr): attrname = 'chainIDs' singular = 'chainID' per_object = 'atom' + dtype = object @staticmethod def _gen_initial_values(na, nr, ns): @@ -709,6 +724,7 @@ class Tempfactors(AtomAttr): attrname = 'tempfactors' singular = 'tempfactor' per_object = 'atom' + dtype = float @staticmethod def _gen_initial_values(na, nr, ns): @@ -722,6 +738,7 @@ class Masses(AtomAttr): target_classes = [AtomGroup, ResidueGroup, SegmentGroup, Atom, Residue, Segment] transplants = defaultdict(list) + dtype = np.float64 groupdoc = """Mass of each component in the Group. @@ -733,10 +750,6 @@ class Masses(AtomAttr): singledoc = """Mass of the component.""" - def __init__(self, values, guessed=False): - self.values = np.asarray(values, dtype=np.float64) - self._guessed = guessed - @staticmethod def _gen_initial_values(na, nr, ns): return np.zeros(na) @@ -767,19 +780,41 @@ def get_segments(self, sg): return masses - def center_of_mass(group, pbc=None): - """Center of mass of the Group. + @warn_if_not_unique + def center_of_mass(group, pbc=None, compound='group'): + """Center of mass of (compounds of) the group. + + Computes the center of mass of atoms in the group. + Centers of mass per residue or per segment can be obtained by setting + the `compound` parameter accordingly. Parameters ---------- pbc : bool, optional - If ``True``, move all atoms within the primary unit cell before - calculation. [``False``] + If ``True`` and `compound` is 'group', move all atoms to the primary + unit cell before calculation. + If ``True`` and `compound` is 'segments' or 'residues', the centers + of mass of each compound will be calculated without moving any + atoms to keep the compounds intact. Instead, the resulting + center-of-mass position vectors will be moved to the primary unit + cell after calculation. + compound : {'group', 'segments', 'residues'}, optional + If 'group', the center of mass of all atoms in the atomgroup will + be returned as a single position vector. Else, the centers of mass + of each segment or residue will be returned as an array of position + vectors, i.e. a 2d array. Note that, in any case, *only* the + positions of atoms *belonging to the atomgroup* will be + taken into account. Returns ------- - center : ndarray - center of group given masses as weights + center : numpy.ndarray + Position vector(s) of the center(s) of mass of the group. + If `compound` was set to 'group', the output will be a single + position vector. + If `compound` was set to 'segments' or 'residues', the output will + be a 2d array of shape ``(n, 3)`` where ``n`` is the number + compounds. Note ---- @@ -788,13 +823,15 @@ def center_of_mass(group, pbc=None): .. versionchanged:: 0.8 Added `pbc` parameter + .. versionchanged:: 0.19.0 Added `compound` parameter """ - return group.atoms.center(weights=group.atoms.masses, - pbc=pbc) + atoms = group.atoms + return atoms.center(weights=atoms.masses, pbc=pbc, compound=compound) transplants[GroupBase].append( ('center_of_mass', center_of_mass)) + @warn_if_not_unique def total_mass(group): """Total mass of the Group. @@ -804,6 +841,7 @@ def total_mass(group): transplants[GroupBase].append( ('total_mass', total_mass)) + @warn_if_not_unique def moment_of_inertia(group, **kwargs): """Tensor moment of inertia relative to center of mass as 3x3 numpy array. @@ -862,6 +900,7 @@ def moment_of_inertia(group, **kwargs): transplants[GroupBase].append( ('moment_of_inertia', moment_of_inertia)) + @warn_if_not_unique def radius_of_gyration(group, **kwargs): """Radius of gyration. @@ -898,6 +937,7 @@ def radius_of_gyration(group, **kwargs): transplants[GroupBase].append( ('radius_of_gyration', radius_of_gyration)) + @warn_if_not_unique def shape_parameter(group, **kwargs): """Shape parameter. @@ -951,6 +991,7 @@ def shape_parameter(group, **kwargs): transplants[GroupBase].append( ('shape_parameter', shape_parameter)) + @warn_if_not_unique def asphericity(group, pbc=None): """Asphericity. @@ -1011,6 +1052,7 @@ def asphericity(group, pbc=None): transplants[GroupBase].append( ('asphericity', asphericity)) + @warn_if_not_unique def principal_axes(group, pbc=None): """Calculate the principal axes from the moment of inertia. @@ -1092,6 +1134,7 @@ class Charges(AtomAttr): target_classes = [AtomGroup, ResidueGroup, SegmentGroup, Atom, Residue, Segment] transplants = defaultdict(list) + dtype = float @staticmethod def _gen_initial_values(na, nr, ns): @@ -1121,6 +1164,7 @@ def get_segments(self, sg): return charges + @warn_if_not_unique def total_charge(group): """Total charge of the Group. @@ -1137,6 +1181,7 @@ class Bfactors(AtomAttr): attrname = 'bfactors' singular = 'bfactor' per_object = 'atom' + dtype = float @staticmethod def _gen_initial_values(na, nr, ns): @@ -1148,6 +1193,7 @@ class Occupancies(AtomAttr): attrname = 'occupancies' singular = 'occupancy' per_object = 'atom' + dtype = float @staticmethod def _gen_initial_values(na, nr, ns): @@ -1160,6 +1206,7 @@ class AltLocs(AtomAttr): attrname = 'altLocs' singular = 'altLoc' per_object = 'atom' + dtype = object @staticmethod def _gen_initial_values(na, nr, ns): @@ -1205,6 +1252,7 @@ class Resids(ResidueAttr): attrname = 'resids' singular = 'resid' target_classes = [AtomGroup, ResidueGroup, SegmentGroup, Atom, Residue] + dtype = int @staticmethod def _gen_initial_values(na, nr, ns): @@ -1217,6 +1265,7 @@ class Resnames(ResidueAttr): singular = 'resname' target_classes = [AtomGroup, ResidueGroup, SegmentGroup, Atom, Residue] transplants = defaultdict(list) + dtype = object @staticmethod def _gen_initial_values(na, nr, ns): @@ -1378,6 +1427,7 @@ class Resnums(ResidueAttr): attrname = 'resnums' singular = 'resnum' target_classes = [AtomGroup, ResidueGroup, SegmentGroup, Atom, Residue] + dtype = int @staticmethod def _gen_initial_values(na, nr, ns): @@ -1388,6 +1438,7 @@ class ICodes(ResidueAttr): """Insertion code for Atoms""" attrname = 'icodes' singular = 'icode' + dtype = object @staticmethod def _gen_initial_values(na, nr, ns): @@ -1402,6 +1453,7 @@ class Moltypes(ResidueAttr): attrname = 'moltypes' singular = 'moltype' target_classes = [AtomGroup, ResidueGroup, SegmentGroup, Atom, Residue] + dtype = object class Molnums(ResidueAttr): @@ -1412,7 +1464,7 @@ class Molnums(ResidueAttr): attrname = 'molnums' singular = 'molnum' target_classes = [AtomGroup, ResidueGroup, Atom, Residue] - + dtype = int # segment attributes @@ -1454,6 +1506,7 @@ class Segids(SegmentAttr): target_classes = [AtomGroup, ResidueGroup, SegmentGroup, Atom, Residue, Segment] transplants = defaultdict(list) + dtype = object @staticmethod def _gen_initial_values(na, nr, ns): diff --git a/package/MDAnalysis/core/topologyobjects.py b/package/MDAnalysis/core/topologyobjects.py index 2b75b0099c5..213d1df2d80 100644 --- a/package/MDAnalysis/core/topologyobjects.py +++ b/package/MDAnalysis/core/topologyobjects.py @@ -118,7 +118,8 @@ def __hash__(self): return hash((self._u, tuple(self.indices))) def __repr__(self): - indices = sorted(self.indices) + indices = (self.indices if self.indices[0] < self.indices[-1] + else self.indices[::-1]) return "<{cname} between: {conts}>".format( cname=self.__class__.__name__, conts=", ".join([ @@ -190,19 +191,17 @@ def partner(self, atom): else: raise ValueError("Unrecognised Atom") - def length(self, pbc=False): + def length(self, pbc=True): """Length of the bond. .. versionchanged:: 0.11.0 Added pbc keyword + .. versionchanged:: 0.19.0 + Changed default of pbc to True """ - if pbc: - box = self.universe.dimensions - return distances.self_distance_array( - np.array([self[0].position, self[1].position]), - box=box)[0] - else: - return mdamath.norm(self[0].position - self[1].position) + box = self.universe.dimensions if pbc else None + + return distances.calc_bonds(self[0].position, self[1].position, box) value = length @@ -219,7 +218,7 @@ class Angle(TopologyObject): """ btype = 'angle' - def angle(self): + def angle(self, pbc=True): """Returns the angle in degrees of this Angle. Angle between atoms 0 and 2 with apex at 1:: @@ -237,10 +236,13 @@ def angle(self): .. versionadded:: 0.9.0 .. versionchanged:: 0.17.0 Fixed angles close to 180 giving NaN + .. versionchanged:: 0.19.0 + Added pbc keyword, default True """ - a = self[0].position - self[1].position - b = self[2].position - self[1].position - return np.rad2deg(mdamath.angle(a, b)) + box = self.universe.dimensions if pbc else None + + return np.rad2deg(distances.calc_angles( + self[0].position, self[1].position, self[2].position, box)) value = angle @@ -264,7 +266,7 @@ class Dihedral(TopologyObject): # http://cbio.bmt.tue.nl/pumma/uploads/Theory/dihedral.png btype = 'dihedral' - def dihedral(self): + def dihedral(self, pbc=True): """Calculate the dihedral angle in degrees. Dihedral angle around axis connecting atoms 1 and 2 (i.e. the angle @@ -283,12 +285,14 @@ def dihedral(self): 4 decimals (and is only tested to 3 decimals). .. versionadded:: 0.9.0 + .. versionchanged:: 0.19.0 + Added pbc keyword, default True """ + box = self.universe.dimensions if pbc else None A, B, C, D = self.atoms - ab = A.position - B.position - bc = B.position - C.position - cd = C.position - D.position - return np.rad2deg(mdamath.dihedral(ab, bc, cd)) + + return np.rad2deg(distances.calc_dihedrals( + A.position, B.position, C.position, D.position, box)) value = dihedral @@ -462,6 +466,9 @@ def __contains__(self, other): return other in self.dict or other[::-1] in self.dict +_BTYPE_TO_SHAPE = {'bond': 2, 'angle': 3, 'dihedral': 4, 'improper': 4} + + class TopologyGroup(object): """A container for a groups of bonds. @@ -511,9 +518,10 @@ class TopologyGroup(object): .. versionchanged:: 0.11.0 Added `values` method to return the size of each object in this group Deprecated selectBonds method in favour of select_bonds + .. versionchanged:: 0.19.0 + Empty TopologyGroup now returns correctly shaped empty array via + indices property and to_indices() """ - _allowed_types = {'bond', 'angle', 'dihedral', 'improper'} - def __init__(self, bondidx, universe, btype=None, type=None, guessed=None, order=None): if btype is None: @@ -523,11 +531,11 @@ def __init__(self, bondidx, universe, btype=None, type=None, guessed=None, self.btype = {2: 'bond', 3: 'angle', 4: 'dihedral'}[len(bondidx[0])] - elif btype in self._allowed_types: + elif btype in _BTYPE_TO_SHAPE: self.btype = btype else: - raise ValueError("Unsupported btype, use one of {}" - "".format(self._allowed_types)) + raise ValueError("Unsupported btype, use one of '{}'" + "".format(', '.join(_BTYPE_TO_SHAPE))) nbonds = len(bondidx) # remove duplicate bonds @@ -542,12 +550,6 @@ def __init__(self, bondidx, universe, btype=None, type=None, guessed=None, if order is None: order = np.repeat(None, nbonds).reshape(nbonds, 1) - # TODO: why has this been defined? - split_index = {'bond': 2, - 'angle': 3, - 'dihedral': 4, - 'improper': 4}[self.btype] - if nbonds > 0: uniq, uniq_idx = util.unique_rows(bondidx, return_index=True) @@ -651,7 +653,12 @@ def indices(self): -------- to_indices : function that just returns `indices` """ - return self._bix + if not self: + # empty TG + shape = _BTYPE_TO_SHAPE[self.btype] + return np.zeros((0, shape), dtype=np.int32) + else: + return self._bix def to_indices(self): """Return a data structure with atom indices describing the bonds. @@ -803,10 +810,7 @@ def atom3(self): try: return self._ags[2] except IndexError: - nvert = {'bond': 2, - 'angle': 3, - 'dihedral': 4, - 'improper': 4}[self.btype] + nvert = _BTYPE_TO_SHAPE[self.btype] raise IndexError("TopologyGroup of {}s only has {} vertical AtomGroups" "".format(self.btype, nvert)) @@ -816,10 +820,7 @@ def atom4(self): try: return self._ags[3] except IndexError: - nvert = {'bond': 2, - 'angle': 3, - 'dihedral': 4, - 'improper': 4}[self.btype] + nvert = _BTYPE_TO_SHAPE[self.btype] raise IndexError("TopologyGroup of {}s only has {} vertical AtomGroups" "".format(self.btype, nvert)) diff --git a/package/MDAnalysis/core/universe.py b/package/MDAnalysis/core/universe.py index 85c417edd3b..522f2e1c971 100644 --- a/package/MDAnalysis/core/universe.py +++ b/package/MDAnalysis/core/universe.py @@ -101,7 +101,10 @@ # A clean solution is therefore simply to disable os.fork() prior to importing # the uuid module and to re-enable it afterwards. import os -if sys.version_info >= (3, 7): + +# Windows doesn't have os.fork so can ignore +# the issue for that platform +if sys.version_info >= (3, 7) or os.name == 'nt': import uuid else: _os_dot_fork, os.fork = os.fork, None @@ -112,8 +115,9 @@ from .. import _ANCHOR_UNIVERSES, _TOPOLOGY_ATTRS, _PARSERS from ..exceptions import NoDataError from ..lib import util -from ..lib.log import ProgressMeter, _set_verbose +from ..lib.log import ProgressMeter from ..lib.util import cached, NamedStream, isstream +from ..lib.mdamath import find_fragments from . import groups from ._get_readers import get_reader_for, get_parser_for from .groups import (ComponentBase, GroupBase, @@ -210,11 +214,20 @@ class Universe(object): Universe to only unpickle if a compatible Universe with matching *anchor_name* is found. Even if *anchor_name* is set *is_anchor* will still be honored when unpickling. + transformations: function or list, optional + Provide a list of transformations that you wish to apply to the + trajectory upon reading. Transformations can be found in + :mod:`MDAnalysis.transformations`, or can be user-created. in_memory After reading in the trajectory, transfer it to an in-memory representations, which allow for manipulation of coordinates. in_memory_step Only read every nth frame into in-memory representation. + continuous : bool, optional + The `continuous` option is used by the + :mod:`ChainReader`, which contains the + functionality to treat independent trajectory files as a single virtual + trajectory. Attributes ---------- @@ -318,7 +331,13 @@ def __init__(self, *args, **kwargs): if not coordinatefile: coordinatefile = None + self.load_new(coordinatefile, **kwargs) + # parse transformations + trans_arg = kwargs.pop('transformations', None) + if trans_arg: + transforms =[trans_arg] if callable(trans_arg) else trans_arg + self.trajectory.add_transformations(*transforms) # Check for guess_bonds if kwargs.pop('guess_bonds', False): @@ -330,6 +349,7 @@ def __init__(self, *args, **kwargs): self._anchor_name = kwargs.get('anchor_name', None) # Universes are anchors by default self.is_anchor = kwargs.get('is_anchor', True) + def copy(self): """Return an independent copy of this Universe""" @@ -397,6 +417,10 @@ def empty(cls, n_atoms, n_residues=None, n_segments=None, Useful for building a Universe without requiring existing files, for example for system building. + If `trajectory` is set to True, a + :class:`MDAnalysis.coordinates.memory.MemoryReader` will be + attached to the Universe. + Parameters ---------- n_atoms : int @@ -405,17 +429,19 @@ def empty(cls, n_atoms, n_residues=None, n_segments=None, number of Residues in the Universe, defaults to 1 n_segments : int, optional number of Segments in the Universe, defaults to 1 - atom_resindex : numpy.array, optional - mapping of atoms to residues - residue_segindex : numpy.array, optional + atom_resindex : array like, optional + mapping of atoms to residues, e.g. with 6 atoms, + `atom_resindex=[0, 0, 1, 1, 2, 2]` would put 2 atoms + into each of 3 residues. + residue_segindex : array like, optional mapping of residues to segments trajectory : bool, optional - if True, attaches a dummy reader to the Universe, therefore + if True, attaches a :class:`MDAnalysis.coordinates.memory.MemoryReader` allowing coordinates to be set and written. Default is False velocities : bool, optional - include velocities in the dummy Reader + include velocities in the :class:`MDAnalysis.coordinates.memory.MemoryReader` forces : bool, optional - include forces in the dummy Reader + include forces in the :class:`MDAnalysis.coordinates.memory.MemoryReader` Returns ------- @@ -433,6 +459,8 @@ def empty(cls, n_atoms, n_residues=None, n_segments=None, >>> u.add_TopologyAttr('masses') .. versionadded:: 0.17.0 + .. versionchanged:: 0.19.0 + The attached Reader when trajectory=True is now a MemoryReader """ if n_residues is None: n_residues = 1 @@ -457,9 +485,15 @@ def empty(cls, n_atoms, n_residues=None, n_segments=None, u = cls(top) if trajectory: - u.trajectory = get_reader_for('', format='dummy')( - n_atoms=n_atoms, - velocities=velocities, forces=forces) + coords = np.zeros((1, n_atoms, 3), dtype=np.float32) + dims = np.zeros(6, dtype=np.float64) + vels = np.zeros_like(coords) if velocities else None + forces = np.zeros_like(coords) if forces else None + + # grab and attach a MemoryReader + u.trajectory = get_reader_for(coords)( + coords, order='fac', n_atoms=n_atoms, + dimensions=dims, velocities=vels, forces=forces) return u @@ -582,7 +616,7 @@ def load_new(self, filename, format=None, in_memory=False, **kwargs): return self def transfer_to_memory(self, start=None, stop=None, step=None, - verbose=None, quiet=None): + verbose=False): """Transfer the trajectory to in memory representation. Replaces the current trajectory reader object with one of type @@ -606,29 +640,34 @@ def transfer_to_memory(self, start=None, stop=None, step=None, """ from ..coordinates.memory import MemoryReader - verbose = _set_verbose(verbose, quiet, default=False) - if not isinstance(self.trajectory, MemoryReader): - # Try to extract coordinates using Timeseries object - # This is significantly faster, but only implemented for certain - # trajectory file formats - try: - coordinates = self.trajectory.timeseries( - self.atoms, start=start, stop=stop, step=step, order='fac') - # if the Timeseries extraction fails, - # fall back to a slower approach - except AttributeError: - n_frames = len(range( - *self.trajectory.check_slice_indices(start, stop, step) - )) - pm_format = '{step}/{numsteps} frames copied to memory (frame {frame})' - pm = ProgressMeter(n_frames, interval=1, - verbose=verbose, format=pm_format) - coordinates = [] # TODO: use pre-allocated array - for i, ts in enumerate(self.trajectory[start:stop:step]): - coordinates.append(np.copy(ts.positions)) - pm.echo(i, frame=ts.frame) - coordinates = np.array(coordinates) + n_frames = len(range( + *self.trajectory.check_slice_indices(start, stop, step) + )) + n_atoms = len(self.atoms) + pm_format = '{step}/{numsteps} frames copied to memory (frame {frame})' + pm = ProgressMeter(n_frames, interval=1, + verbose=verbose, format=pm_format) + coordinates = np.zeros((n_frames, n_atoms, 3), dtype=np.float32) + ts = self.trajectory.ts + has_vels = ts.has_velocities + has_fors = ts.has_forces + has_dims = ts.dimensions is not None + + velocities = np.zeros_like(coordinates) if has_vels else None + forces = np.zeros_like(coordinates) if has_fors else None + dimensions = (np.zeros((n_frames, 6), dtype=np.float64) + if has_dims else None) + + for i, ts in enumerate(self.trajectory[start:stop:step]): + np.copyto(coordinates[i], ts.positions) + if has_vels: + np.copyto(velocities[i], ts.velocities) + if has_fors: + np.copyto(forces[i], ts.forces) + if has_dims: + np.copyto(dimensions[i], ts.dimensions) + pm.echo(i, frame=ts.frame) # Overwrite trajectory in universe with an MemoryReader # object, to provide fast access and allow coordinates @@ -637,9 +676,12 @@ def transfer_to_memory(self, start=None, stop=None, step=None, step = 1 self.trajectory = MemoryReader( coordinates, - dimensions=self.trajectory.ts.dimensions, + dimensions=dimensions, dt=self.trajectory.ts.dt * step, - filename=self.trajectory.filename) + filename=self.trajectory.filename, + velocities=velocities, + forces=forces, + ) # python 2 doesn't allow an efficient splitting of kwargs in function # argument signatures. @@ -959,58 +1001,14 @@ def _fragdict(self): .. versionchanged:: 0.16.0 Fragment atoms are sorted by their index, and framgents are sorted by their first atom index so their order is predictable. + .. versionchanged:: 0.19.0 + Uses faster C++ implementation """ - bonds = self.atoms.bonds - - class _fragset(object): - __slots__ = ['ats'] - """Normal sets aren't hashable, this is""" - - def __init__(self, ats): - self.ats = set(ats) - - def __iter__(self): - return iter(self.ats) - - def add(self, other): - self.ats.add(other) - - def update(self, other): - self.ats.update(other.ats) - - # each atom starts with its own list - f = dict.fromkeys(self.atoms, None) - - for a1, a2 in bonds: - if not (f[a1] or f[a2]): - # New set made here - new = _fragset([a1, a2]) - f[a1] = f[a2] = new - elif f[a1] and not f[a2]: - # If a2 isn't in a fragment, add it to a1's - f[a1].add(a2) - f[a2] = f[a1] - elif not f[a1] and f[a2]: - # If a1 isn't in a fragment, add it to a2's - f[a2].add(a1) - f[a1] = f[a2] - elif f[a1] is f[a2]: - # If they're in the same fragment, do nothing - continue - else: - # If they are both in different fragments, combine fragments - f[a1].update(f[a2]) - f.update(dict((a, f[a1]) for a in f[a2])) - - # Lone atoms get their own fragment - f.update(dict((a, _fragset((a,))) - for a, val in f.items() if not val)) - - # All the unique values in f are the fragments - frags = tuple( - [AtomGroup(np.sort(np.array([at.index for at in ag])), self) - for ag in set(f.values())], - ) + atoms = self.atoms.ix + bonds = self.atoms.bonds.to_indices() + + frag_indices = find_fragments(atoms, bonds) + frags = tuple([AtomGroup(np.sort(ix), self) for ix in frag_indices]) fragdict = {} for f in frags: diff --git a/package/MDAnalysis/due.py b/package/MDAnalysis/due.py index 23346908280..9f5692f36cd 100644 --- a/package/MDAnalysis/due.py +++ b/package/MDAnalysis/due.py @@ -26,6 +26,7 @@ """ +from __future__ import absolute_import __version__ = '0.0.5' @@ -67,7 +68,11 @@ def _donothing_func(*args, **kwargs): as (os_dot_fork, os_dot_popen): import duecredit else: - with patch('os.fork') as os_dot_fork, patch('os.popen') as os_dot_popen: + if not os.name == 'nt': + with patch('os.fork') as os_dot_fork, patch('os.popen') as os_dot_popen: + import duecredit + else: + # Windows doesn't have os.fork import duecredit from duecredit import due, BibTeX, Doi, Url @@ -82,10 +87,10 @@ def _donothing_func(*args, **kwargs): warnings.warn(errmsg) logging.getLogger("duecredit").error( "Failed to import duecredit due to {}".format(str(err))) - else: - # for debugging - import warnings - warnings.warn(str(err)) + # else: + # Do not issue any warnings if duecredit is not installed; + # this is the user's choice (Issue #1872) + # Initiate due stub due = InactiveDueCreditCollector() BibTeX = Doi = Url = _donothing_func diff --git a/package/MDAnalysis/exceptions.py b/package/MDAnalysis/exceptions.py index a84dd5a441e..8f3df820e5a 100644 --- a/package/MDAnalysis/exceptions.py +++ b/package/MDAnalysis/exceptions.py @@ -71,3 +71,17 @@ class StreamWarning(Warning): :class:`~MDAnalysis.lib.util.NamedStream`). This does not work everywhere in MDAnalysis (yet). """ + + +class DuplicateWarning(UserWarning): + """Warning indicating possible problems arising from an + :class:`~MDAnalysis.core.groups.AtomGroup` / + :class:`~MDAnalysis.core.groups.ResidueGroup` / + :class:`~MDAnalysis.core.groups.SegmentGroup` containing duplicate + :class:`Atoms` / + :class:`Residues` / + :class:`Segments`. + + + .. versionadded:: 0.19.0 + """ diff --git a/package/MDAnalysis/lib/NeighborSearch.py b/package/MDAnalysis/lib/NeighborSearch.py index b9b75ca0161..956d8a31452 100644 --- a/package/MDAnalysis/lib/NeighborSearch.py +++ b/package/MDAnalysis/lib/NeighborSearch.py @@ -30,11 +30,12 @@ from __future__ import absolute_import import numpy as np -from Bio.KDTree import KDTree -from MDAnalysis.lib.pkdtree import PeriodicKDTree +from MDAnalysis.lib.distances import capped_distance +from MDAnalysis.lib.util import unique_int_1d from MDAnalysis.core.groups import AtomGroup, Atom + class AtomNeighborSearch(object): """This class can be used to find all atoms/residues/segments within the radius of a given query position. @@ -64,11 +65,7 @@ def __init__(self, atom_group, box=None, bucket_size=10): self.atom_group = atom_group self._u = atom_group.universe self._box = box - if box is None: - self.kdtree = KDTree(dim=3, bucket_size=bucket_size) - else: - self.kdtree = PeriodicKDTree(box, bucket_size=bucket_size) - self.kdtree.set_coords(atom_group.positions) + #self.kdtree = PeriodicKDTree(box=box, leafsize=bucket_size) def search(self, atoms, radius, level='A'): """ @@ -85,16 +82,17 @@ def search(self, atoms, radius, level='A'): char (A, R, S). Return atoms(A), residues(R) or segments(S) within *radius* of *atoms*. """ + unique_idx = [] if isinstance(atoms, Atom): positions = atoms.position.reshape(1, 3) else: positions = atoms.positions + + pairs = capped_distance(positions, self.atom_group.positions, + radius, box=self._box, return_distances=False) - indices = [] - for pos in positions: - self.kdtree.search(pos, radius) - indices.append(self.kdtree.get_indices()) - unique_idx = np.unique([i for l in indices for i in l]).astype(np.int64) + if pairs.size > 0: + unique_idx = unique_int_1d(np.asarray(pairs[:, 1], dtype=np.int64)) return self._index2level(unique_idx, level) def _index2level(self, indices, level): diff --git a/package/MDAnalysis/lib/__init__.py b/package/MDAnalysis/lib/__init__.py index 51c148dde65..37ebc2f811c 100644 --- a/package/MDAnalysis/lib/__init__.py +++ b/package/MDAnalysis/lib/__init__.py @@ -29,7 +29,7 @@ from __future__ import absolute_import __all__ = ['log', 'transformations', 'util', 'mdamath', 'distances', - 'NeighborSearch', 'formats', 'pkdtree'] + 'NeighborSearch', 'formats', 'pkdtree', 'nsgrid'] from . import log from . import transformations @@ -39,3 +39,4 @@ from . import NeighborSearch from . import formats from . import pkdtree +from . import nsgrid \ No newline at end of file diff --git a/package/MDAnalysis/lib/_augment.cpp b/package/MDAnalysis/lib/_augment.cpp new file mode 100644 index 00000000000..244c4a264f3 --- /dev/null +++ b/package/MDAnalysis/lib/_augment.cpp @@ -0,0 +1,27749 @@ +/* Generated by Cython 0.28.5 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h" + ], + "extra_compile_args": [ + "-ffast-math", + "-O3", + "-funroll-loops", + "-std=c++11", + "-stdlib=libc++" + ], + "include_dirs": [ + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include" + ], + "language": "c++", + "name": "MDAnalysis.lib._augment", + "sources": [ + "MDAnalysis/lib/_augment.pyx" + ] + }, + "module_name": "MDAnalysis.lib._augment" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_28_5" +#define CYTHON_FUTURE_DIVISION 0 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__MDAnalysis__lib___augment +#define __PYX_HAVE_API__MDAnalysis__lib___augment +/* Early includes */ +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include "pythread.h" +#include +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "MDAnalysis/lib/_augment.pyx", + "__init__.pxd", + "stringsource", + "type.pxd", +}; +/* MemviewSliceStruct.proto */ +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; +#define __Pyx_MemoryView_Len(m) (m.shape[0]) + +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 + * # 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 + * #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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 + * #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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 + * # 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 + * 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; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * 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":104 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + struct __pyx_vtabstruct_array *__pyx_vtab; + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":278 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":329 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":960 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "View.MemoryView":104 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":329 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":960 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* IncludeStringH.proto */ +#include + +/* MemviewSliceInit.proto */ +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* None.proto */ +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* None.proto */ +static CYTHON_INLINE long __Pyx_div_long(long, long); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CppExceptionConversion.proto */ +#ifndef __Pyx_CppExn2PyErr +#include +#include +#include +#include +static void __Pyx_CppExn2PyErr() { + try { + if (PyErr_Occurred()) + ; // let the latest Python exn pass through and ignore the current one + else + throw; + } catch (const std::bad_alloc& exn) { + PyErr_SetString(PyExc_MemoryError, exn.what()); + } catch (const std::bad_cast& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::domain_error& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::invalid_argument& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::ios_base::failure& exn) { + PyErr_SetString(PyExc_IOError, exn.what()); + } catch (const std::out_of_range& exn) { + PyErr_SetString(PyExc_IndexError, exn.what()); + } catch (const std::overflow_error& exn) { + PyErr_SetString(PyExc_OverflowError, exn.what()); + } catch (const std::range_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::underflow_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::exception& exn) { + PyErr_SetString(PyExc_RuntimeError, exn.what()); + } + catch (...) + { + PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); + } +} +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj); + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); + +/* MemviewSliceCopyTemplate.proto */ +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyIdentifierFromString.proto */ +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +/* ModuleImport.proto */ +static PyObject *__Pyx_ImportModule(const char *name); + +/* TypeImport.proto */ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'MDAnalysis.lib._cutil' */ +static float (*__pyx_f_10MDAnalysis_3lib_6_cutil__dot)(float *, float *); /*proto*/ +static void (*__pyx_f_10MDAnalysis_3lib_6_cutil__cross)(float *, float *, float *); /*proto*/ +static float (*__pyx_f_10MDAnalysis_3lib_6_cutil__norm)(float *); /*proto*/ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'MDAnalysis.lib._augment' */ +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static int __pyx_memoryview_thread_locks_used; +static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static int __Pyx_carray_from_py_float(PyObject *, float *, Py_ssize_t); /*proto*/ +static int __Pyx_carray_from_py_float___5b_3_5d_(PyObject *, float (*)[3], Py_ssize_t); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_float(const std::vector &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_int(const std::vector &); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +#define __Pyx_MODULE_NAME "MDAnalysis.lib._augment" +extern int __pyx_module_is_main_MDAnalysis__lib___augment; +int __pyx_module_is_main_MDAnalysis__lib___augment = 0; + +/* Implementation of 'MDAnalysis.lib._augment' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_OverflowError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static const char __pyx_k_N[] = "N"; +static const char __pyx_k_O[] = "O"; +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_j[] = "j"; +static const char __pyx_k_n[] = "n"; +static const char __pyx_k_r[] = "r"; +static const char __pyx_k_dm[] = "dm"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_box[] = "box"; +static const char __pyx_k_end[] = "end"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_hi_x[] = "hi_x"; +static const char __pyx_k_hi_y[] = "hi_y"; +static const char __pyx_k_hi_z[] = "hi_z"; +static const char __pyx_k_lo_x[] = "lo_x"; +static const char __pyx_k_lo_y[] = "lo_y"; +static const char __pyx_k_lo_z[] = "lo_z"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_norm[] = "norm"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_coord[] = "coord"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_int64[] = "int64"; +static const char __pyx_k_nreal[] = "nreal"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_other[] = "other"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_output[] = "output"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_shiftX[] = "shiftX"; +static const char __pyx_k_shiftY[] = "shiftY"; +static const char __pyx_k_shiftZ[] = "shiftZ"; +static const char __pyx_k_struct[] = "struct"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_asarray[] = "asarray"; +static const char __pyx_k_float32[] = "float32"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_indices[] = "indices"; +static const char __pyx_k_mdamath[] = "mdamath"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_reshape[] = "reshape"; +static const char __pyx_k_results[] = "results"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_reciprocal[] = "reciprocal"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_coordinates[] = "coordinates"; +static const char __pyx_k_translation[] = "translation"; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_undo_augment[] = "undo_augment"; +static const char __pyx_k_OverflowError[] = "OverflowError"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; +static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_triclinic_vectors[] = "triclinic_vectors"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_augment_coordinates[] = "augment_coordinates"; +static const char __pyx_k_strided_and_indirect[] = ""; +static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_MDAnalysis_lib__augment[] = "MDAnalysis.lib._augment"; +static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_MDAnalysis_lib__augment_pyx[] = "MDAnalysis/lib/_augment.pyx"; +static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; +static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; +static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_n_s_MDAnalysis_lib__augment; +static PyObject *__pyx_kp_s_MDAnalysis_lib__augment_pyx; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_N; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_OverflowError; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_augment_coordinates; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_box; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_coord; +static PyObject *__pyx_n_s_coordinates; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dm; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_end; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_hi_x; +static PyObject *__pyx_n_s_hi_y; +static PyObject *__pyx_n_s_hi_z; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_indices; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_lo_x; +static PyObject *__pyx_n_s_lo_y; +static PyObject *__pyx_n_s_lo_z; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_mdamath; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_n; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_norm; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_nreal; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_output; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_r; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reciprocal; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_reshape; +static PyObject *__pyx_n_s_results; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_shiftX; +static PyObject *__pyx_n_s_shiftY; +static PyObject *__pyx_n_s_shiftZ; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_translation; +static PyObject *__pyx_n_s_triclinic_vectors; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_n_s_undo_augment; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_pf_10MDAnalysis_3lib_8_augment_augment_coordinates(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coordinates, __Pyx_memviewslice __pyx_v_box, float __pyx_v_r); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_8_augment_2undo_augment(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_results, __Pyx_memviewslice __pyx_v_translation, int __pyx_v_nreal); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__25; +static PyObject *__pyx_slice__26; +static PyObject *__pyx_slice__27; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__41; +/* Late includes */ + +/* "MDAnalysis/lib/_augment.pyx":39 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def augment_coordinates(float[:, ::1] coordinates, float[:] box, float r): # <<<<<<<<<<<<<< + * r"""Calculates the periodic images of particles which are within a distance + * `r` from the box walls. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_8_augment_1augment_coordinates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_8_augment_augment_coordinates[] = "Calculates the periodic images of particles which are within a distance\n `r` from the box walls.\n\n The algorithm works by generating explicit periodic images of atoms residing\n close to any of the six box walls. The steps involved in generating images\n involves the evaluation of reciprocal box vectors followed by the\n calculation of distances of atoms from the walls by means of projection onto\n the reciprocal vectors. If the distance is less than a specified cutoff\n distance, relevant periodic images are generated using box translation\n vectors :math:`\\vec{t}` with\n\n .. math:: \\vec{t}=l\\cdot\\vec{a}+m\\cdot\\vec{b}+n\\cdot \\vec{c}\\,,\n\n where :math:`l,\\,m,\\,n \\in \\{-1,\\,0,\\,1\\}` are the neighboring cell indices\n in :math:`x`-, :math:`y`-, and :math:`z`-direction relative to the central\n cell with box vectors :math:`\\vec{a},\\,\\vec{b},\\,\\vec{c}`.\n\n For instance, an atom close to the :math:`xy`-plane containing the origin\n will generate a periodic image outside the central cell and close to the\n opposite :math:`xy`-plane of the box, i.e., shifted by\n :math:`\\vec{t} = 0\\cdot\\vec{a}+0\\cdot\\vec{b}+1\\cdot\\vec{c}=\\vec{c}`.\n\n Likewise, if the particle is close to more than one box walls, images along\n the diagonals are also generated::\n\n x x\n +------------+ +------------+\n | | augment | |\n | | -------> | |\n | o | x | o |\n +------------+ +------------+\n\n Parameters\n ----------\n coordinates : numpy.ndarray\n Input coordinate array of shape ``(n, 3)`` and dtype ``numpy.float32``\n used to generate duplicate images in the vicinity of the central cell. All\n coordinates must be within the primary unit cell.\n box : numpy.ndarray\n Box dimensio""ns of shape ``(6,)`` and dtype ``numpy.float32``. The\n dimensions must be provided in the same format as returned\n by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n ``[lx, ly, lz, alpha, beta, gamma]``\n r : float\n Thickness of cutoff region for duplicate image generation.\n\n Returns\n -------\n output : numpy.ndarray\n Coordinates of duplicate (augmented) particles (dtype ``numpy.float32``).\n indices : numpy.ndarray\n Original indices of the augmented coordinates (dtype ``numpy.int64``).\n Maps the indices of augmented particles to their original particle index\n such that ``indices[augmented_index] = original_index``.\n\n Note\n ----\n Output does not return coordinates from the initial array.\n To merge the particles with their respective images, the following operation\n is necessary when generating the images:\n\n .. code-block:: python\n\n images, mapping = augment_coordinates(coordinates, box, max_cutoff)\n all_coords = numpy.concatenate([coordinates, images])\n\n\n See Also\n --------\n :meth:`undo_augment`\n\n\n .. versionadded:: 0.19.0\n "; +static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_8_augment_1augment_coordinates = {"augment_coordinates", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_8_augment_1augment_coordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_8_augment_augment_coordinates}; +static PyObject *__pyx_pw_10MDAnalysis_3lib_8_augment_1augment_coordinates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_coordinates = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_box = { 0, 0, { 0 }, { 0 }, { 0 } }; + float __pyx_v_r; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("augment_coordinates (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,&__pyx_n_s_box,&__pyx_n_s_r,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coordinates)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("augment_coordinates", 1, 3, 3, 1); __PYX_ERR(0, 39, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("augment_coordinates", 1, 3, 3, 2); __PYX_ERR(0, 39, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "augment_coordinates") < 0)) __PYX_ERR(0, 39, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_coordinates = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_coordinates.memview)) __PYX_ERR(0, 39, __pyx_L3_error) + __pyx_v_box = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_box.memview)) __PYX_ERR(0, 39, __pyx_L3_error) + __pyx_v_r = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_r == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("augment_coordinates", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 39, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib._augment.augment_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_8_augment_augment_coordinates(__pyx_self, __pyx_v_coordinates, __pyx_v_box, __pyx_v_r); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_8_augment_augment_coordinates(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coordinates, __Pyx_memviewslice __pyx_v_box, float __pyx_v_r) { + int __pyx_v_lo_x; + int __pyx_v_hi_x; + int __pyx_v_lo_y; + int __pyx_v_hi_y; + int __pyx_v_lo_z; + int __pyx_v_hi_z; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_v_N; + float __pyx_v_norm; + float __pyx_v_shiftX[3]; + float __pyx_v_shiftY[3]; + float __pyx_v_shiftZ[3]; + float __pyx_v_coord[3]; + float __pyx_v_end[3]; + float __pyx_v_other[3]; + float __pyx_v_dm[3][3]; + float __pyx_v_reciprocal[3][3]; + std::vector __pyx_v_output; + std::vector __pyx_v_indices; + std::vector ::size_type __pyx_v_n; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + float __pyx_t_6[3][3]; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + int __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("augment_coordinates", 0); + + /* "MDAnalysis/lib/_augment.pyx":126 + * cdef float reciprocal[3][3] + * + * dm = triclinic_vectors(box) # <<<<<<<<<<<<<< + * + * for i in range(3): + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_triclinic_vectors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_box, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_carray_from_py_float___5b_3_5d_(__pyx_t_1, __pyx_t_6, 3) < 0)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_dm[0]), __pyx_t_6, sizeof(__pyx_v_dm[0]) * (3)); + + /* "MDAnalysis/lib/_augment.pyx":128 + * dm = triclinic_vectors(box) + * + * for i in range(3): # <<<<<<<<<<<<<< + * shiftX[i] = dm[0][i] + * shiftY[i] = dm[1][i] + */ + for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "MDAnalysis/lib/_augment.pyx":129 + * + * for i in range(3): + * shiftX[i] = dm[0][i] # <<<<<<<<<<<<<< + * shiftY[i] = dm[1][i] + * shiftZ[i] = dm[2][i] + */ + (__pyx_v_shiftX[__pyx_v_i]) = ((__pyx_v_dm[0])[__pyx_v_i]); + + /* "MDAnalysis/lib/_augment.pyx":130 + * for i in range(3): + * shiftX[i] = dm[0][i] + * shiftY[i] = dm[1][i] # <<<<<<<<<<<<<< + * shiftZ[i] = dm[2][i] + * end[i] = dm[0][i] + dm[1][i] + dm[2][i] + */ + (__pyx_v_shiftY[__pyx_v_i]) = ((__pyx_v_dm[1])[__pyx_v_i]); + + /* "MDAnalysis/lib/_augment.pyx":131 + * shiftX[i] = dm[0][i] + * shiftY[i] = dm[1][i] + * shiftZ[i] = dm[2][i] # <<<<<<<<<<<<<< + * end[i] = dm[0][i] + dm[1][i] + dm[2][i] + * # Calculate reciprocal vectors + */ + (__pyx_v_shiftZ[__pyx_v_i]) = ((__pyx_v_dm[2])[__pyx_v_i]); + + /* "MDAnalysis/lib/_augment.pyx":132 + * shiftY[i] = dm[1][i] + * shiftZ[i] = dm[2][i] + * end[i] = dm[0][i] + dm[1][i] + dm[2][i] # <<<<<<<<<<<<<< + * # Calculate reciprocal vectors + * _cross(&dm[1][0], &dm[2][0], &reciprocal[0][0]) + */ + (__pyx_v_end[__pyx_v_i]) = ((((__pyx_v_dm[0])[__pyx_v_i]) + ((__pyx_v_dm[1])[__pyx_v_i])) + ((__pyx_v_dm[2])[__pyx_v_i])); + } + + /* "MDAnalysis/lib/_augment.pyx":134 + * end[i] = dm[0][i] + dm[1][i] + dm[2][i] + * # Calculate reciprocal vectors + * _cross(&dm[1][0], &dm[2][0], &reciprocal[0][0]) # <<<<<<<<<<<<<< + * _cross(&dm[2][0], &dm[0][0], &reciprocal[1][0]) + * _cross(&dm[0][0], &dm[1][0], &reciprocal[2][0]) + */ + __pyx_f_10MDAnalysis_3lib_6_cutil__cross((&((__pyx_v_dm[1])[0])), (&((__pyx_v_dm[2])[0])), (&((__pyx_v_reciprocal[0])[0]))); + + /* "MDAnalysis/lib/_augment.pyx":135 + * # Calculate reciprocal vectors + * _cross(&dm[1][0], &dm[2][0], &reciprocal[0][0]) + * _cross(&dm[2][0], &dm[0][0], &reciprocal[1][0]) # <<<<<<<<<<<<<< + * _cross(&dm[0][0], &dm[1][0], &reciprocal[2][0]) + * # Normalize + */ + __pyx_f_10MDAnalysis_3lib_6_cutil__cross((&((__pyx_v_dm[2])[0])), (&((__pyx_v_dm[0])[0])), (&((__pyx_v_reciprocal[1])[0]))); + + /* "MDAnalysis/lib/_augment.pyx":136 + * _cross(&dm[1][0], &dm[2][0], &reciprocal[0][0]) + * _cross(&dm[2][0], &dm[0][0], &reciprocal[1][0]) + * _cross(&dm[0][0], &dm[1][0], &reciprocal[2][0]) # <<<<<<<<<<<<<< + * # Normalize + * for i in range(3): + */ + __pyx_f_10MDAnalysis_3lib_6_cutil__cross((&((__pyx_v_dm[0])[0])), (&((__pyx_v_dm[1])[0])), (&((__pyx_v_reciprocal[2])[0]))); + + /* "MDAnalysis/lib/_augment.pyx":138 + * _cross(&dm[0][0], &dm[1][0], &reciprocal[2][0]) + * # Normalize + * for i in range(3): # <<<<<<<<<<<<<< + * norm = _norm(&reciprocal[i][0]) + * for j in range(3): + */ + for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "MDAnalysis/lib/_augment.pyx":139 + * # Normalize + * for i in range(3): + * norm = _norm(&reciprocal[i][0]) # <<<<<<<<<<<<<< + * for j in range(3): + * reciprocal[i][j] = reciprocal[i][j]/norm + */ + __pyx_v_norm = __pyx_f_10MDAnalysis_3lib_6_cutil__norm((&((__pyx_v_reciprocal[__pyx_v_i])[0]))); + + /* "MDAnalysis/lib/_augment.pyx":140 + * for i in range(3): + * norm = _norm(&reciprocal[i][0]) + * for j in range(3): # <<<<<<<<<<<<<< + * reciprocal[i][j] = reciprocal[i][j]/norm + * + */ + for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { + __pyx_v_j = __pyx_t_8; + + /* "MDAnalysis/lib/_augment.pyx":141 + * norm = _norm(&reciprocal[i][0]) + * for j in range(3): + * reciprocal[i][j] = reciprocal[i][j]/norm # <<<<<<<<<<<<<< + * + * N = coordinates.shape[0] + */ + if (unlikely(__pyx_v_norm == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 141, __pyx_L1_error) + } + ((__pyx_v_reciprocal[__pyx_v_i])[__pyx_v_j]) = (((__pyx_v_reciprocal[__pyx_v_i])[__pyx_v_j]) / __pyx_v_norm); + } + } + + /* "MDAnalysis/lib/_augment.pyx":143 + * reciprocal[i][j] = reciprocal[i][j]/norm + * + * N = coordinates.shape[0] # <<<<<<<<<<<<<< + * + * cdef vector[float] output + */ + __pyx_v_N = (__pyx_v_coordinates.shape[0]); + + /* "MDAnalysis/lib/_augment.pyx":148 + * cdef vector[int] indices + * + * for i in range(N): # <<<<<<<<<<<<<< + * for j in range(3): + * coord[j] = coordinates[i, j] + */ + __pyx_t_7 = __pyx_v_N; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "MDAnalysis/lib/_augment.pyx":149 + * + * for i in range(N): + * for j in range(3): # <<<<<<<<<<<<<< + * coord[j] = coordinates[i, j] + * other[j] = end[j] - coordinates[i, j] + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":150 + * for i in range(N): + * for j in range(3): + * coord[j] = coordinates[i, j] # <<<<<<<<<<<<<< + * other[j] = end[j] - coordinates[i, j] + * # identify the condition + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = __pyx_v_j; + (__pyx_v_coord[__pyx_v_j]) = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coordinates.data + __pyx_t_11 * __pyx_v_coordinates.strides[0]) )) + __pyx_t_12)) ))); + + /* "MDAnalysis/lib/_augment.pyx":151 + * for j in range(3): + * coord[j] = coordinates[i, j] + * other[j] = end[j] - coordinates[i, j] # <<<<<<<<<<<<<< + * # identify the condition + * lo_x = _dot(&coord[0], &reciprocal[0][0]) <= r + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + (__pyx_v_other[__pyx_v_j]) = ((__pyx_v_end[__pyx_v_j]) - (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coordinates.data + __pyx_t_13 * __pyx_v_coordinates.strides[0]) )) + __pyx_t_14)) )))); + } + + /* "MDAnalysis/lib/_augment.pyx":153 + * other[j] = end[j] - coordinates[i, j] + * # identify the condition + * lo_x = _dot(&coord[0], &reciprocal[0][0]) <= r # <<<<<<<<<<<<<< + * hi_x = _dot(&other[0], &reciprocal[0][0]) <= r + * lo_y = _dot(&coord[0], &reciprocal[1][0]) <= r + */ + __pyx_v_lo_x = (__pyx_f_10MDAnalysis_3lib_6_cutil__dot((&(__pyx_v_coord[0])), (&((__pyx_v_reciprocal[0])[0]))) <= __pyx_v_r); + + /* "MDAnalysis/lib/_augment.pyx":154 + * # identify the condition + * lo_x = _dot(&coord[0], &reciprocal[0][0]) <= r + * hi_x = _dot(&other[0], &reciprocal[0][0]) <= r # <<<<<<<<<<<<<< + * lo_y = _dot(&coord[0], &reciprocal[1][0]) <= r + * hi_y = _dot(&other[0], &reciprocal[1][0]) <= r + */ + __pyx_v_hi_x = (__pyx_f_10MDAnalysis_3lib_6_cutil__dot((&(__pyx_v_other[0])), (&((__pyx_v_reciprocal[0])[0]))) <= __pyx_v_r); + + /* "MDAnalysis/lib/_augment.pyx":155 + * lo_x = _dot(&coord[0], &reciprocal[0][0]) <= r + * hi_x = _dot(&other[0], &reciprocal[0][0]) <= r + * lo_y = _dot(&coord[0], &reciprocal[1][0]) <= r # <<<<<<<<<<<<<< + * hi_y = _dot(&other[0], &reciprocal[1][0]) <= r + * lo_z = _dot(&coord[0], &reciprocal[2][0]) <= r + */ + __pyx_v_lo_y = (__pyx_f_10MDAnalysis_3lib_6_cutil__dot((&(__pyx_v_coord[0])), (&((__pyx_v_reciprocal[1])[0]))) <= __pyx_v_r); + + /* "MDAnalysis/lib/_augment.pyx":156 + * hi_x = _dot(&other[0], &reciprocal[0][0]) <= r + * lo_y = _dot(&coord[0], &reciprocal[1][0]) <= r + * hi_y = _dot(&other[0], &reciprocal[1][0]) <= r # <<<<<<<<<<<<<< + * lo_z = _dot(&coord[0], &reciprocal[2][0]) <= r + * hi_z = _dot(&other[0], &reciprocal[2][0]) <= r + */ + __pyx_v_hi_y = (__pyx_f_10MDAnalysis_3lib_6_cutil__dot((&(__pyx_v_other[0])), (&((__pyx_v_reciprocal[1])[0]))) <= __pyx_v_r); + + /* "MDAnalysis/lib/_augment.pyx":157 + * lo_y = _dot(&coord[0], &reciprocal[1][0]) <= r + * hi_y = _dot(&other[0], &reciprocal[1][0]) <= r + * lo_z = _dot(&coord[0], &reciprocal[2][0]) <= r # <<<<<<<<<<<<<< + * hi_z = _dot(&other[0], &reciprocal[2][0]) <= r + * + */ + __pyx_v_lo_z = (__pyx_f_10MDAnalysis_3lib_6_cutil__dot((&(__pyx_v_coord[0])), (&((__pyx_v_reciprocal[2])[0]))) <= __pyx_v_r); + + /* "MDAnalysis/lib/_augment.pyx":158 + * hi_y = _dot(&other[0], &reciprocal[1][0]) <= r + * lo_z = _dot(&coord[0], &reciprocal[2][0]) <= r + * hi_z = _dot(&other[0], &reciprocal[2][0]) <= r # <<<<<<<<<<<<<< + * + * if lo_x: + */ + __pyx_v_hi_z = (__pyx_f_10MDAnalysis_3lib_6_cutil__dot((&(__pyx_v_other[0])), (&((__pyx_v_reciprocal[2])[0]))) <= __pyx_v_r); + + /* "MDAnalysis/lib/_augment.pyx":160 + * hi_z = _dot(&other[0], &reciprocal[2][0]) <= r + * + * if lo_x: # <<<<<<<<<<<<<< + * # if X, face piece + * for j in range(3): + */ + __pyx_t_15 = (__pyx_v_lo_x != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":162 + * if lo_x: + * # if X, face piece + * for j in range(3): # <<<<<<<<<<<<<< + * # add to output + * output.push_back(coord[j] + shiftX[j]) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":164 + * for j in range(3): + * # add to output + * output.push_back(coord[j] + shiftX[j]) # <<<<<<<<<<<<<< + * # keep record of which index this augmented + * # position was created from + */ + try { + __pyx_v_output.push_back(((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 164, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":167 + * # keep record of which index this augmented + * # position was created from + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_y: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 167, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":169 + * indices.push_back(i) + * + * if lo_y: # <<<<<<<<<<<<<< + * # if X&Y, edge piece + * for j in range(3): + */ + __pyx_t_15 = (__pyx_v_lo_y != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":171 + * if lo_y: + * # if X&Y, edge piece + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] + shiftY[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":172 + * # if X&Y, edge piece + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftY[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 172, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":173 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 173, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":175 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * # if X&Y&Z, corner piece + * for j in range(3): + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":177 + * if lo_z: + * # if X&Y&Z, corner piece + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] + shiftY[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":178 + * # if X&Y&Z, corner piece + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftY[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 178, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":179 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 179, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":175 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * # if X&Y&Z, corner piece + * for j in range(3): + */ + goto __pyx_L19; + } + + /* "MDAnalysis/lib/_augment.pyx":181 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":182 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] + shiftY[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":183 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftY[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 183, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":184 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_y: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 184, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":181 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftY[j] - shiftZ[j]) + */ + } + __pyx_L19:; + + /* "MDAnalysis/lib/_augment.pyx":169 + * indices.push_back(i) + * + * if lo_y: # <<<<<<<<<<<<<< + * # if X&Y, edge piece + * for j in range(3): + */ + goto __pyx_L16; + } + + /* "MDAnalysis/lib/_augment.pyx":186 + * indices.push_back(i) + * + * elif hi_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j]) + */ + __pyx_t_15 = (__pyx_v_hi_y != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":187 + * + * elif hi_y: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] - shiftY[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":188 + * elif hi_y: + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftY[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 188, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":189 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 189, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":191 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":192 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] - shiftY[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":193 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftY[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 193, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":194 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 194, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":191 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] + shiftZ[j]) + */ + goto __pyx_L26; + } + + /* "MDAnalysis/lib/_augment.pyx":196 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":197 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] - shiftY[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":198 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftY[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 198, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":199 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 199, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":196 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j] - shiftZ[j]) + */ + } + __pyx_L26:; + + /* "MDAnalysis/lib/_augment.pyx":186 + * indices.push_back(i) + * + * elif hi_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftY[j]) + */ + } + __pyx_L16:; + + /* "MDAnalysis/lib/_augment.pyx":201 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":202 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":203 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 203, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":204 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 204, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":201 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] + shiftZ[j]) + */ + goto __pyx_L31; + } + + /* "MDAnalysis/lib/_augment.pyx":206 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":207 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftX[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":208 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 208, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":209 + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_x: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 209, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":206 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftX[j] - shiftZ[j]) + */ + } + __pyx_L31:; + + /* "MDAnalysis/lib/_augment.pyx":160 + * hi_z = _dot(&other[0], &reciprocal[2][0]) <= r + * + * if lo_x: # <<<<<<<<<<<<<< + * # if X, face piece + * for j in range(3): + */ + goto __pyx_L13; + } + + /* "MDAnalysis/lib/_augment.pyx":211 + * indices.push_back(i) + * + * elif hi_x: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j]) + */ + __pyx_t_15 = (__pyx_v_hi_x != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":212 + * + * elif hi_x: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":213 + * elif hi_x: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 213, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":214 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_y: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 214, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":216 + * indices.push_back(i) + * + * if lo_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j]) + */ + __pyx_t_15 = (__pyx_v_lo_y != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":217 + * + * if lo_y: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] + shiftY[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":218 + * if lo_y: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftY[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 218, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":219 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 219, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":221 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":222 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] + shiftY[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":223 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftY[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 223, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":224 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 224, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":221 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] + shiftZ[j]) + */ + goto __pyx_L41; + } + + /* "MDAnalysis/lib/_augment.pyx":226 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":227 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] + shiftY[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":228 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftY[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 228, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":229 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_y: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 229, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":226 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j] - shiftZ[j]) + */ + } + __pyx_L41:; + + /* "MDAnalysis/lib/_augment.pyx":216 + * indices.push_back(i) + * + * if lo_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftY[j]) + */ + goto __pyx_L38; + } + + /* "MDAnalysis/lib/_augment.pyx":231 + * indices.push_back(i) + * + * elif hi_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j]) + */ + __pyx_t_15 = (__pyx_v_hi_y != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":232 + * + * elif hi_y: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] - shiftY[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":233 + * elif hi_y: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftY[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 233, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":234 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 234, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":236 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":237 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] - shiftY[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":238 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftY[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 238, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":239 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 239, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":236 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] + shiftZ[j]) + */ + goto __pyx_L48; + } + + /* "MDAnalysis/lib/_augment.pyx":241 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":242 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] - shiftY[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":243 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftY[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 243, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":244 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 244, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":241 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j] - shiftZ[j]) + */ + } + __pyx_L48:; + + /* "MDAnalysis/lib/_augment.pyx":231 + * indices.push_back(i) + * + * elif hi_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftY[j]) + */ + } + __pyx_L38:; + + /* "MDAnalysis/lib/_augment.pyx":246 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":247 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":248 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 248, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":249 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 249, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":246 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] + shiftZ[j]) + */ + goto __pyx_L53; + } + + /* "MDAnalysis/lib/_augment.pyx":251 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":252 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftX[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":253 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftX[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 253, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":254 + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_y: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 254, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":251 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j] - shiftZ[j]) + */ + } + __pyx_L53:; + + /* "MDAnalysis/lib/_augment.pyx":211 + * indices.push_back(i) + * + * elif hi_x: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftX[j]) + */ + } + __pyx_L13:; + + /* "MDAnalysis/lib/_augment.pyx":256 + * indices.push_back(i) + * + * if lo_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftY[j]) + */ + __pyx_t_15 = (__pyx_v_lo_y != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":257 + * + * if lo_y: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftY[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":258 + * if lo_y: + * for j in range(3): + * output.push_back(coord[j] + shiftY[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftY[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 258, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":259 + * for j in range(3): + * output.push_back(coord[j] + shiftY[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 259, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":261 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":262 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftY[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":263 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftY[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 263, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":264 + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 264, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":261 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] + shiftZ[j]) + */ + goto __pyx_L61; + } + + /* "MDAnalysis/lib/_augment.pyx":266 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":267 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftY[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":268 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftY[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 268, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":269 + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_y: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 269, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":266 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftY[j] - shiftZ[j]) + */ + } + __pyx_L61:; + + /* "MDAnalysis/lib/_augment.pyx":256 + * indices.push_back(i) + * + * if lo_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftY[j]) + */ + goto __pyx_L58; + } + + /* "MDAnalysis/lib/_augment.pyx":271 + * indices.push_back(i) + * + * elif hi_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftY[j]) + */ + __pyx_t_15 = (__pyx_v_hi_y != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":272 + * + * elif hi_y: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftY[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":273 + * elif hi_y: + * for j in range(3): + * output.push_back(coord[j] - shiftY[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftY[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 273, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":274 + * for j in range(3): + * output.push_back(coord[j] - shiftY[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 274, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":276 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":277 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftY[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":278 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftY[__pyx_v_j])) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 278, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":279 + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 279, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":276 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] + shiftZ[j]) + */ + goto __pyx_L68; + } + + /* "MDAnalysis/lib/_augment.pyx":281 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":282 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftY[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":283 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back((((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftY[__pyx_v_j])) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 283, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":284 + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * if lo_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 284, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":281 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftY[j] - shiftZ[j]) + */ + } + __pyx_L68:; + + /* "MDAnalysis/lib/_augment.pyx":271 + * indices.push_back(i) + * + * elif hi_y: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftY[j]) + */ + } + __pyx_L58:; + + /* "MDAnalysis/lib/_augment.pyx":286 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_lo_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":287 + * + * if lo_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] + shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":288 + * if lo_z: + * for j in range(3): + * output.push_back(coord[j] + shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * + */ + try { + __pyx_v_output.push_back(((__pyx_v_coord[__pyx_v_j]) + (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 288, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":289 + * for j in range(3): + * output.push_back(coord[j] + shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * + * elif hi_z: + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 289, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":286 + * indices.push_back(i) + * + * if lo_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] + shiftZ[j]) + */ + goto __pyx_L73; + } + + /* "MDAnalysis/lib/_augment.pyx":291 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftZ[j]) + */ + __pyx_t_15 = (__pyx_v_hi_z != 0); + if (__pyx_t_15) { + + /* "MDAnalysis/lib/_augment.pyx":292 + * + * elif hi_z: + * for j in range(3): # <<<<<<<<<<<<<< + * output.push_back(coord[j] - shiftZ[j]) + * indices.push_back(i) + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_j = __pyx_t_10; + + /* "MDAnalysis/lib/_augment.pyx":293 + * elif hi_z: + * for j in range(3): + * output.push_back(coord[j] - shiftZ[j]) # <<<<<<<<<<<<<< + * indices.push_back(i) + * n = indices.size() + */ + try { + __pyx_v_output.push_back(((__pyx_v_coord[__pyx_v_j]) - (__pyx_v_shiftZ[__pyx_v_j]))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 293, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_augment.pyx":294 + * for j in range(3): + * output.push_back(coord[j] - shiftZ[j]) + * indices.push_back(i) # <<<<<<<<<<<<<< + * n = indices.size() + * return np.asarray(output, dtype=np.float32).reshape(n, 3), np.asarray(indices, dtype=np.int64) + */ + try { + __pyx_v_indices.push_back(__pyx_v_i); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 294, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_augment.pyx":291 + * indices.push_back(i) + * + * elif hi_z: # <<<<<<<<<<<<<< + * for j in range(3): + * output.push_back(coord[j] - shiftZ[j]) + */ + } + __pyx_L73:; + } + + /* "MDAnalysis/lib/_augment.pyx":295 + * output.push_back(coord[j] - shiftZ[j]) + * indices.push_back(i) + * n = indices.size() # <<<<<<<<<<<<<< + * return np.asarray(output, dtype=np.float32).reshape(n, 3), np.asarray(indices, dtype=np.int64) + * + */ + __pyx_v_n = __pyx_v_indices.size(); + + /* "MDAnalysis/lib/_augment.pyx":296 + * indices.push_back(i) + * n = indices.size() + * return np.asarray(output, dtype=np.float32).reshape(n, 3), np.asarray(indices, dtype=np.int64) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_convert_vector_to_py_float(__pyx_v_output); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_16) < 0) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_3 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_16, __pyx_int_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_16, __pyx_int_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_t_16); + __Pyx_INCREF(__pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_int_3); + __pyx_t_16 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_convert_vector_to_py_int(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/_augment.pyx":39 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def augment_coordinates(float[:, ::1] coordinates, float[:] box, float r): # <<<<<<<<<<<<<< + * r"""Calculates the periodic images of particles which are within a distance + * `r` from the box walls. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("MDAnalysis.lib._augment.augment_coordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_coordinates, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_box, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/_augment.pyx":301 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def undo_augment(np.int64_t[:] results, np.int64_t[:] translation, int nreal): # <<<<<<<<<<<<<< + * """Translate augmented indices back to original indices. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_8_augment_3undo_augment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_8_augment_2undo_augment[] = "Translate augmented indices back to original indices.\n\n Parameters\n ----------\n results : numpy.ndarray\n Array of dtype ``numpy.int64`` containing coordinate indices, including\n \"augmented\" indices.\n translation : numpy.ndarray\n Index map of dtype ``numpy.int64`` linking the augmented indices to the\n original particle indices such that\n ``translation[augmented_index] = original_index``.\n nreal : int\n Number of real coordinates, i.e., indices in `results` equal or larger\n than this need to be mapped to their real counterpart.\n\n Returns\n -------\n results : numpy.ndarray\n Modified input `results` with all the augmented indices translated to\n their corresponding initial original indices.\n\n Note\n ----\n Modifies the results array in place.\n\n See Also\n --------\n :meth:`augment_coordinates`\n\n\n .. versionadded:: 0.19.0\n "; +static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_8_augment_3undo_augment = {"undo_augment", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_8_augment_3undo_augment, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_8_augment_2undo_augment}; +static PyObject *__pyx_pw_10MDAnalysis_3lib_8_augment_3undo_augment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_results = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_translation = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_nreal; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("undo_augment (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_results,&__pyx_n_s_translation,&__pyx_n_s_nreal,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_translation)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("undo_augment", 1, 3, 3, 1); __PYX_ERR(0, 301, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nreal)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("undo_augment", 1, 3, 3, 2); __PYX_ERR(0, 301, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "undo_augment") < 0)) __PYX_ERR(0, 301, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_results = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_results.memview)) __PYX_ERR(0, 301, __pyx_L3_error) + __pyx_v_translation = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_translation.memview)) __PYX_ERR(0, 301, __pyx_L3_error) + __pyx_v_nreal = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nreal == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("undo_augment", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib._augment.undo_augment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_8_augment_2undo_augment(__pyx_self, __pyx_v_results, __pyx_v_translation, __pyx_v_nreal); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_8_augment_2undo_augment(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_results, __Pyx_memviewslice __pyx_v_translation, int __pyx_v_nreal) { + int __pyx_v_N; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __pyx_t_5numpy_int64_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __Pyx_RefNannySetupContext("undo_augment", 0); + + /* "MDAnalysis/lib/_augment.pyx":336 + * cdef int N + * cdef ssize_t i + * N = results.shape[0] # <<<<<<<<<<<<<< + * + * for i in range(N): + */ + __pyx_v_N = (__pyx_v_results.shape[0]); + + /* "MDAnalysis/lib/_augment.pyx":338 + * N = results.shape[0] + * + * for i in range(N): # <<<<<<<<<<<<<< + * if results[i] >= nreal: + * results[i] = translation[results[i] - nreal] + */ + __pyx_t_1 = __pyx_v_N; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "MDAnalysis/lib/_augment.pyx":339 + * + * for i in range(N): + * if results[i] >= nreal: # <<<<<<<<<<<<<< + * results[i] = translation[results[i] - nreal] + * return np.asarray(results, dtype=np.int64) + */ + __pyx_t_4 = __pyx_v_i; + __pyx_t_5 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_results.data + __pyx_t_4 * __pyx_v_results.strides[0]) ))) >= __pyx_v_nreal) != 0); + if (__pyx_t_5) { + + /* "MDAnalysis/lib/_augment.pyx":340 + * for i in range(N): + * if results[i] >= nreal: + * results[i] = translation[results[i] - nreal] # <<<<<<<<<<<<<< + * return np.asarray(results, dtype=np.int64) + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = ((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_results.data + __pyx_t_6 * __pyx_v_results.strides[0]) ))) - __pyx_v_nreal); + __pyx_t_8 = __pyx_v_i; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_results.data + __pyx_t_8 * __pyx_v_results.strides[0]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_translation.data + __pyx_t_7 * __pyx_v_translation.strides[0]) ))); + + /* "MDAnalysis/lib/_augment.pyx":339 + * + * for i in range(N): + * if results[i] >= nreal: # <<<<<<<<<<<<<< + * results[i] = translation[results[i] - nreal] + * return np.asarray(results, dtype=np.int64) + */ + } + } + + /* "MDAnalysis/lib/_augment.pyx":341 + * if results[i] >= nreal: + * results[i] = translation[results[i] - nreal] + * return np.asarray(results, dtype=np.int64) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_results, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int64); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_13) < 0) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/_augment.pyx":301 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def undo_augment(np.int64_t[:] results, np.int64_t[:] translation, int nreal): # <<<<<<<<<<<<<< + * """Translate augmented indices back to original indices. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("MDAnalysis.lib._augment.undo_augment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_results, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_translation, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fulfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * + * cdef int i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + * cdef int i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 229, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 233, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + * # This is allocated as one block, strides first. + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L9; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L9:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset + */ + __pyx_v_f = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * cdef int offset + * + * info.obj = self # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(descr): + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self + * + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L15_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L14_bool_binop_done; + } + __pyx_L15_next_or:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L14_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 263, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 282, __pyx_L1_error) + break; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self + * + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + * return + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format = PyObject_Malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) + __pyx_v_f = __pyx_t_8; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fulfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * PyObject_Free(info.strides) + */ + PyObject_Free(__pyx_v_info->format); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * PyObject_Free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * PyObject_Free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + PyObject_Free(__pyx_v_info->strides); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * PyObject_Free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + * 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 */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + * 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 */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * return () + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(1, 805, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 805, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 806, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 806, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 807, __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_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 807, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 807, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 810, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L7_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 814, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 834, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 848, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 848, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 849, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 849, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 852, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(__pyx_t_6)) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 855, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 860, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * return () + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + /*else*/ { + Py_INCREF(__pyx_v_base); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 998, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 999, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * _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__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1000, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1004, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1005, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + * _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__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1006, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1006, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1010, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1011, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1012, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1012, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py_float") + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: + */ + +static int __Pyx_carray_from_py_float(PyObject *__pyx_v_o, float *__pyx_v_v, Py_ssize_t __pyx_v_length) { + Py_ssize_t __pyx_v_i; + PyObject *__pyx_v_item = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + float __pyx_t_11; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py_float", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py_float") + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length # <<<<<<<<<<<<<< + * try: + * i = len(o) + */ + __pyx_v_i = __pyx_v_length; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "carray.from_py":80 + * cdef Py_ssize_t i = length + * try: + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass + */ + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "carray.from_py":81 + * try: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); + if (__pyx_t_5) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 84, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } else { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } + } else { + __pyx_t_10 = __pyx_t_9(__pyx_t_7); + if (unlikely(!__pyx_t_10)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 84, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_v_i = __pyx_t_4; + __pyx_t_4 = (__pyx_t_4 + 1); + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: + */ + goto __pyx_L11_break; + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + } + + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< + * else: + * i += 1 # convert index to length + */ + __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_v_item); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 87, __pyx_L1_error) + (__pyx_v_v[__pyx_v_i]) = __pyx_t_11; + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + } + /*else*/ { + + /* "carray.from_py":89 + * v[i] = item + * else: + * i += 1 # convert index to length # <<<<<<<<<<<<<< + * if i == length: + * return 0 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< + * + * PyErr_Format( + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + } + } + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_L11_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + } + + /* "carray.from_py":96 + * IndexError, + * ("too many values found during array assignment, expected %zd" + * if i >= length else # <<<<<<<<<<<<<< + * "not enough values found during array assignment, expected %zd, got %zd"), + * length, i) + */ + if (((__pyx_v_i >= __pyx_v_length) != 0)) { + __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd"); + } else { + __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd"); + } + + /* "carray.from_py":93 + * return 0 + * + * PyErr_Format( # <<<<<<<<<<<<<< + * IndexError, + * ("too many values found during array assignment, expected %zd" + */ + __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py_float") + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __Pyx_carray_from_py_float___5b_3_5d_(PyObject *__pyx_v_o, float (*__pyx_v_v)[3], Py_ssize_t __pyx_v_length) { + Py_ssize_t __pyx_v_i; + PyObject *__pyx_v_item = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + float __pyx_t_11[3]; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py_float___5b_3_5d_", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py_float___5b_3_5d_") + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length # <<<<<<<<<<<<<< + * try: + * i = len(o) + */ + __pyx_v_i = __pyx_v_length; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "carray.from_py":80 + * cdef Py_ssize_t i = length + * try: + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass + */ + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "carray.from_py":81 + * try: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); + if (__pyx_t_5) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 84, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } else { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } + } else { + __pyx_t_10 = __pyx_t_9(__pyx_t_7); + if (unlikely(!__pyx_t_10)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 84, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_v_i = __pyx_t_4; + __pyx_t_4 = (__pyx_t_4 + 1); + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: + */ + goto __pyx_L11_break; + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + } + + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< + * else: + * i += 1 # convert index to length + */ + if (unlikely(__Pyx_carray_from_py_float(__pyx_v_item, __pyx_t_11, 3) < 0)) __PYX_ERR(2, 87, __pyx_L1_error) + memcpy(&((__pyx_v_v[__pyx_v_i])[0]), __pyx_t_11, sizeof((__pyx_v_v[__pyx_v_i])[0]) * (3)); + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + } + /*else*/ { + + /* "carray.from_py":89 + * v[i] = item + * else: + * i += 1 # convert index to length # <<<<<<<<<<<<<< + * if i == length: + * return 0 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< + * + * PyErr_Format( + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + } + } + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_L11_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + } + + /* "carray.from_py":96 + * IndexError, + * ("too many values found during array assignment, expected %zd" + * if i >= length else # <<<<<<<<<<<<<< + * "not enough values found during array assignment, expected %zd, got %zd"), + * length, i) + */ + if (((__pyx_v_i >= __pyx_v_length) != 0)) { + __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd"); + } else { + __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd"); + } + + /* "carray.from_py":93 + * return 0 + * + * PyErr_Format( # <<<<<<<<<<<<<< + * IndexError, + * ("too many values found during array assignment, expected %zd" + */ + __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py_float___5b_3_5d_") + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_float___5b_3_5d_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_float") + * cdef object __pyx_convert_vector_to_py_float(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + +static PyObject *__pyx_convert_vector_to_py_float(const std::vector &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_float", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py_float") + * cdef object __pyx_convert_vector_to_py_float(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_float") + * cdef object __pyx_convert_vector_to_py_float(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_convert_vector_to_py_int(const std::vector &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 121, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 121, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 121, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error) + } else { + + /* "View.MemoryView":122 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 121, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 121, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 121, __pyx_L1_error) + } + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":128 + * 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()"); + __PYX_ERR(2, 128, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 128, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":129 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":131 + * 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":132 + * + * 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__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 132, __pyx_L1_error) + + /* "View.MemoryView":131 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":134 + * 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":135 + * + * 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__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 135, __pyx_L1_error) + + /* "View.MemoryView":134 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":137 + * 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_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":138 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":137 + * 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 + */ + } + + /* "View.MemoryView":139 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":140 + * 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"); + __PYX_ERR(2, 140, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 140, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":143 + * + * + * 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":144 + * + * 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":146 + * 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":147 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 147, __pyx_L1_error) + + /* "View.MemoryView":146 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":150 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_7 = 0; + __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 150, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_dim = __pyx_t_8; + __pyx_v_idx = __pyx_t_7; + __pyx_t_7 = (__pyx_t_7 + 1); + + /* "View.MemoryView":151 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":152 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __pyx_t_3 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(2, 152, __pyx_L1_error) + + /* "View.MemoryView":151 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":153 + * 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":150 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "View.MemoryView":156 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 156, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":157 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":158 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + + /* "View.MemoryView":156 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":159 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 159, __pyx_L1_error) + if (likely(__pyx_t_4)) { + + /* "View.MemoryView":160 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":161 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + + /* "View.MemoryView":159 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":163 + * 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*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(2, 163, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":165 + * 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":168 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":169 + * + * 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, 169, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":170 + * 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":173 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":174 + * + * 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)) { + + /* "View.MemoryView":175 + * 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, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(2, 175, __pyx_L1_error) + + /* "View.MemoryView":174 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":177 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":178 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":179 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(2, 179, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(2, 179, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + __pyx_t_8 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "View.MemoryView":180 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":181 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":177 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":170 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":184 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":185 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":186 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 186, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":187 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":186 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":188 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 188, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":189 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":188 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":190 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":191 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 191, __pyx_L1_error) + + /* "View.MemoryView":190 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":192 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":193 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":194 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":195 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":196 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":197 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":198 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":199 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":201 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":202 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + + /* "View.MemoryView":201 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":204 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":206 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":184 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":210 + * __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) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":211 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":212 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + + /* "View.MemoryView":211 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":213 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":215 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + + /* "View.MemoryView":214 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":217 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) + * + */ + free(__pyx_v_self->data); + + /* "View.MemoryView":213 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":218 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":210 + * __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) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":221 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":222 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":221 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":225 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":226 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":227 + * 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); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":225 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":229 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":230 + * + * def __len__(self): + * return self._shape[0] # <<<<<<<<<<<<<< + * + * def __getattr__(self, attr): + */ + __pyx_r = (__pyx_v_self->_shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":229 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":232 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":233 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":232 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":235 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":236 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":235 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":238 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":239 + * + * 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, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":238 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":243 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":247 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":248 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":247 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":250 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":251 + * else: + * 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, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 251, __pyx_L1_error) + + /* "View.MemoryView":250 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":252 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":254 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":243 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":280 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 280, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 280, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":281 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":280 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":282 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":283 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":282 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.name,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->name); + __Pyx_GIVEREF(__pyx_v_self->name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = self.name is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":11 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":15 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":297 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":299 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "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":303 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":305 + * 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":306 + * + * 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":305 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":308 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":297 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":344 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 344, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 344, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 344, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 344, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 344, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":345 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":346 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":347 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_obj != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":348 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 348, __pyx_L1_error) + + /* "View.MemoryView":349 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":350 + * __Pyx_GetBuffer(obj, &self.view, flags) + * 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; + + /* "View.MemoryView":351 + * 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); + + /* "View.MemoryView":349 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + } + + /* "View.MemoryView":347 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + } + + /* "View.MemoryView":354 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":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] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":356 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":354 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":357 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":358 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":359 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":360 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(2, 360, __pyx_L1_error) + + /* "View.MemoryView":359 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":357 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":362 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":363 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_self->dtype_is_object = __pyx_t_1; + + /* "View.MemoryView":362 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":365 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":367 + * 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 + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":369 + * 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":344 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":371 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyThread_type_lock __pyx_t_6; + PyThread_type_lock __pyx_t_7; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":372 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":373 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * + * cdef int i + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + + /* "View.MemoryView":372 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":377 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":378 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":379 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":381 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":382 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; + + /* "View.MemoryView":381 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":384 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":379 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":386 + * 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); + } + __pyx_L6_break:; + + /* "View.MemoryView":377 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":371 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":388 + * 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 + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":390 + * 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":392 + * 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)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 392, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 392, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 392, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 392, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":393 + * + * 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, 393, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 393, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":392 + * 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":395 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":388 + * 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 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":398 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":399 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":400 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "View.MemoryView":399 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":402 + * 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, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 402, __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_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 402, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":405 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 405, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":406 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":405 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":408 + * return memview_slice(self, indices) + * 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, 408, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":409 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":398 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":411 + * 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") + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":412 + * + * 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)) { + + /* "View.MemoryView":413 + * 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, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 413, __pyx_L1_error) + + /* "View.MemoryView":412 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + } + + /* "View.MemoryView":415 + * 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, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 415, __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_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 415, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":417 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 417, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":418 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_obj = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":419 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 419, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":420 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":419 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":422 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 422, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "View.MemoryView":417 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":424 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * 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") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":426 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":427 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":429 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":430 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 430, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":429 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":431 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 431, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":432 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":427 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":434 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":426 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":436 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":440 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 440, __pyx_L1_error) + + /* "View.MemoryView":441 + * + * 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, 441, __pyx_L1_error) + + /* "View.MemoryView":442 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":440 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 440, __pyx_L1_error) + + /* "View.MemoryView":436 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":444 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":446 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":451 + * 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_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + + /* "View.MemoryView":453 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":454 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":455 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":456 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(2, 456, __pyx_L1_error) + + /* "View.MemoryView":455 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":457 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":453 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":459 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":461 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":462 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":463 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + + /* "View.MemoryView":462 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":465 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 465, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":469 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":470 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 470, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":469 + * + * + * 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, + */ + } + + /* "View.MemoryView":471 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":474 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":444 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":476 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":477 + * + * 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, 477, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":478 + * 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, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":476 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":480 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":483 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":486 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":488 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":492 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":493 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":492 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":494 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":489 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 489, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); + __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 489, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":490 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 490, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 490, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":480 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":496 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + char *__pyx_t_12; + char *__pyx_t_13; + char *__pyx_t_14; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":499 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":504 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":505 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 505, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":504 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":507 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 507, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":509 + * 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)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(2, 509, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_10 = __pyx_v_bytesvalue; + __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); + __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); + for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { + __pyx_t_11 = __pyx_t_14; + __pyx_v_c = (__pyx_t_11[0]); + + /* "View.MemoryView":510 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":509 + * 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":510 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "View.MemoryView":496 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":513 + * + * @cname('getbuffer') + * 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") + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + char *__pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":514 + * @cname('getbuffer') + * 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) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->view.readonly != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":515 + * 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_STRIDES: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 515, __pyx_L1_error) + + /* "View.MemoryView":514 + * @cname('getbuffer') + * 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":517 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":518 + * + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_4 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_4; + + /* "View.MemoryView":517 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":520 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":522 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":523 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_4 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_4; + + /* "View.MemoryView":522 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L7; + } + + /* "View.MemoryView":525 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L7:; + + /* "View.MemoryView":527 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":528 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_4 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_4; + + /* "View.MemoryView":527 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":530 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L8:; + + /* "View.MemoryView":532 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":533 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_5 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_5; + + /* "View.MemoryView":532 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":535 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L9:; + + /* "View.MemoryView":537 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_6 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_6; + + /* "View.MemoryView":538 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_7 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_7; + + /* "View.MemoryView":539 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = self.view.readonly + */ + __pyx_t_8 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_8; + + /* "View.MemoryView":540 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = self.view.readonly + * info.obj = self + */ + __pyx_t_8 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_8; + + /* "View.MemoryView":541 + * info.itemsize = self.view.itemsize + * 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; + + /* "View.MemoryView":542 + * 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)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":513 + * + * @cname('getbuffer') + * 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") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":548 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":549 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 549, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":550 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 550, __pyx_L1_error) + + /* "View.MemoryView":551 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":548 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":554 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":555 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":554 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":558 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":559 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":558 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":562 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_stride; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":563 + * @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); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":565 + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 565, __pyx_L1_error) + + /* "View.MemoryView":563 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":567 + * 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); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":570 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + Py_ssize_t *__pyx_t_6; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":571 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":572 + * 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); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__22, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":571 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":574 + * return (-1,) * self.view.ndim + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":570 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":577 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":578 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":577 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":581 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":582 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":581 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":585 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":586 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":585 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":589 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":590 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":591 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":593 + * 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++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":594 + * + * 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, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":596 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + + /* "View.MemoryView":590 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":598 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":589 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":600 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":601 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":602 + * 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":601 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":604 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":600 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":606 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":607 + * + * 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, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":608 + * 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, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "View.MemoryView":607 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":606 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":610 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":611 + * + * 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, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":610 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":614 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":617 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":618 + * 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); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":614 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":620 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":623 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":624 + * 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); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":620 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":626 + * 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 + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":628 + * 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":630 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":631 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 631, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":636 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":626 + * 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 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":638 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":640 + * 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":642 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":643 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 643, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":648 + * 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, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":638 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":652 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":653 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":654 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":655 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":652 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":658 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":659 + * @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_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":658 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":661 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":666 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":667 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":666 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":669 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":671 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":672 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":673 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":674 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 674, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 674, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 674, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 674, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":675 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":676 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":677 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 677, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__25); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 677, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":678 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + + /* "View.MemoryView":676 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":680 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__26); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 680, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":681 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + + /* "View.MemoryView":675 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":683 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":684 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(2, 684, __pyx_L1_error) + + /* "View.MemoryView":683 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":686 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + __pyx_t_10 = (__pyx_v_have_slices != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = (__pyx_t_10 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_have_slices = __pyx_t_1; + + /* "View.MemoryView":687 + * + * 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, 687, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":674 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":689 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":690 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":691 + * 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, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__27); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":690 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":693 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_have_slices) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "View.MemoryView":661 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":695 + * 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: + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":696 + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); + for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { + __pyx_t_1 = __pyx_t_3; + __pyx_v_suboffset = (__pyx_t_1[0]); + + /* "View.MemoryView":697 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":698 + * 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__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 698, __pyx_L1_error) + + /* "View.MemoryView":697 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":695 + * 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: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":705 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":706 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":713 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); + + /* "View.MemoryView":717 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(2, 717, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":719 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":720 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 720, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":721 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + + /* "View.MemoryView":719 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":723 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":724 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":730 + * + * + * 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":731 + * + * 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":736 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":737 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":741 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 741, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 741, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 741, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 741, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":742 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":746 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + + /* "View.MemoryView":743 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 743, __pyx_L1_error) + + /* "View.MemoryView":742 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":749 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":750 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":751 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":752 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":753 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + + /* "View.MemoryView":749 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":755 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 755, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 755, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":756 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 756, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 756, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":757 + * 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, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 757, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 757, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":759 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":760 + * + * 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, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":761 + * 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, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":763 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 763, __pyx_L1_error) + + /* "View.MemoryView":769 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + + /* "View.MemoryView":741 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":771 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":772 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":773 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 773, __pyx_L1_error) } + + /* "View.MemoryView":774 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 774, __pyx_L1_error) } + + /* "View.MemoryView":772 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 772, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":771 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":777 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":778 + * 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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":777 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":705 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":802 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":822 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":824 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":825 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":824 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":826 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":827 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 827, __pyx_L1_error) + + /* "View.MemoryView":826 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":822 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":830 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step < 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __pyx_v_negative_step = __pyx_t_2; + + /* "View.MemoryView":832 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_t_1 = (__pyx_v_have_step != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step == 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L9_bool_binop_done:; + if (__pyx_t_2) { + + /* "View.MemoryView":833 + * + * 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, 833, __pyx_L1_error) + + /* "View.MemoryView":832 + * 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":836 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":837 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":839 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":840 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":839 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":837 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":841 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":842 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":843 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":842 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":845 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":841 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":836 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":847 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":848 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":847 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":850 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":852 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":854 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":855 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":856 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":855 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":853 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":857 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":858 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":857 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":852 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":860 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":861 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":860 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":863 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":865 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":866 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":865 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":870 + * + * 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":872 + * 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":873 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":872 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":875 + * 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":876 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":875 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":879 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":880 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":881 + * 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":884 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":885 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + + /* "View.MemoryView":884 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":887 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":889 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":890 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":891 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":892 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":891 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":894 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + /*else*/ { + + /* "View.MemoryView":895 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 894, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":890 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":897 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":889 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":899 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":802 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":905 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":907 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":908 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":911 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":912 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(2, 912, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(2, 912, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":913 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":911 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":915 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":916 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":917 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":918 + * 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]); + + /* "View.MemoryView":917 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":920 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":921 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":922 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":923 + * 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, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 923, __pyx_L1_error) + + /* "View.MemoryView":922 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":920 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":925 + * 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":926 + * + * 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, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 926, __pyx_L1_error) + + /* "View.MemoryView":925 + * 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":928 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":929 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":930 + * 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":929 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":932 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":905 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":938 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + + /* "View.MemoryView":939 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":941 + * 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":942 + * + * 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":946 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":947 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":948 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; + + /* "View.MemoryView":949 + * 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]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":951 + * 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) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + if (__pyx_t_7) { + + /* "View.MemoryView":952 + * + * 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, 952, __pyx_L1_error) + + /* "View.MemoryView":951 + * 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":954 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":938 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":971 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":972 + * + * 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":971 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":974 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":975 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":976 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 976, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":975 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":978 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":974 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":980 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":981 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":982 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 982, __pyx_L1_error) + + /* "View.MemoryView":981 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":984 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * @property + */ + /*else*/ { + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":980 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":987 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":988 + * @property + * def base(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":987 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":994 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t *__pyx_t_6; + Py_ssize_t *__pyx_t_7; + Py_ssize_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":1002 + * 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":1003 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "View.MemoryView":1002 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":1008 + * + * + * 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, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1010 + * 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":1011 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1013 + * __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, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":1014 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":1016 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":1017 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":1018 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":1019 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":1020 + * 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":1022 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1023 + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * else: + * result.flags = PyBUF_RECORDS_RO + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1022 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1025 + * result.flags = PyBUF_RECORDS + * else: + * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + /*else*/ { + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; + } + __pyx_L4:; + + /* "View.MemoryView":1027 + * 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":1028 + * + * 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":1031 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1032 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1033 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1034 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * 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); + + /* "View.MemoryView":1035 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L6_break; + + /* "View.MemoryView":1033 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L6_break:; + + /* "View.MemoryView":1037 + * break + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for length in result.view.shape[:ndim]: + * result.view.len *= length + */ + __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + + /* "View.MemoryView":1038 + * + * 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++) { + __pyx_t_6 = __pyx_t_8; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1039 + * 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, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1039, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1041 + * 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":1042 + * + * 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":1044 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":994 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1047 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1050 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1051 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1051, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1052 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + + /* "View.MemoryView":1050 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1054 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1055 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1047 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1058 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1062 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1063 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1064 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1066 + * 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":1067 + * + * 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":1069 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_dim = __pyx_t_4; + + /* "View.MemoryView":1070 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1071 + * for dim in range(memview.view.ndim): + * 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]); + + /* "View.MemoryView":1072 + * 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)) { + __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_5 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; + } + + /* "View.MemoryView":1058 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1075 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1078 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1079 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1075 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1082 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1089 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1090 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1091 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + + /* "View.MemoryView":1089 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1093 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1094 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1096 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1098 + * 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, 1096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1082 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1104 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1105 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1106 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + + /* "View.MemoryView":1105 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1108 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1104 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1111 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1116 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1117 + * 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":1119 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1120 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1121 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1122 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1120 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1124 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_1; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1125 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1126 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1127 + * 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":1125 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1129 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1130 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + + /* "View.MemoryView":1129 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1132 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1111 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1135 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1142 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1143 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1144 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1145 + * 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":1147 + * 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): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "View.MemoryView":1149 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + if (__pyx_t_1) { + + /* "View.MemoryView":1150 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1152 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1153 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); + + /* "View.MemoryView":1154 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1155 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + + /* "View.MemoryView":1147 + * 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): + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1157 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1158 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1162 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1163 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1135 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1165 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1168 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1165 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1172 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1175 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1177 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1178 + * + * for i in range(ndim): + * size *= src.shape[i] # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + } + + /* "View.MemoryView":1180 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1172 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1183 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1192 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1193 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_idx = __pyx_t_4; + + /* "View.MemoryView":1194 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1195 + * for idx in range(ndim): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + + /* "View.MemoryView":1192 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1197 + * stride = stride * shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + /*else*/ { + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1198 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1199 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1201 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1183 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1204 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + + /* "View.MemoryView":1215 + * 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":1216 + * + * 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":1218 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1219 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1220 + * 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, 1220, __pyx_L1_error) + + /* "View.MemoryView":1219 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1223 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1224 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1225 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1226 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1227 + * 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; + } + + /* "View.MemoryView":1229 + * 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":1233 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1234 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1235 + * 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":1234 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1237 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1238 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); + + /* "View.MemoryView":1237 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1240 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1242 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1204 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1247 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1250 + * 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, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1249 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 1249, __pyx_L1_error) + + /* "View.MemoryView":1247 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1253 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1254 + * @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, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 1254, __pyx_L1_error) + + /* "View.MemoryView":1253 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":1259 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1259, __pyx_L1_error) + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1261 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(2, 1261, __pyx_L1_error) + } + + /* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1264 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + void *__pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":1272 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1273 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1275 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1276 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1277 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1280 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1281 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + + /* "View.MemoryView":1280 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1282 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1283 + * 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); + + /* "View.MemoryView":1282 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1285 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1287 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_5; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1288 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1290 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1291 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1289 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1293 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1293, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1288 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1295 + * _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":1296 + * + * 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, 1296, __pyx_L1_error) + + /* "View.MemoryView":1295 + * _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":1298 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * 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":1301 + * + * 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":1300 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1303 + * 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, 1303, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_7; + + /* "View.MemoryView":1304 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1298 + * _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":1306 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1309 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1310 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1309 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1311 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1312 + * 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); + + /* "View.MemoryView":1311 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1314 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1316 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1317 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); + + /* "View.MemoryView":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1319 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1314 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1306 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1322 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":1325 + * + * + * 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, 1325, __pyx_L1_error) + + /* "View.MemoryView":1326 + * + * 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, 1326, __pyx_L1_error) + + /* "View.MemoryView":1322 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1328 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1329 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1330 + * 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":1332 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1333 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1264 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1336 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1340 + * 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":1342 + * 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] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1343 + * + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + */ + (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + + /* "View.MemoryView":1344 + * for i in range(ndim - 1, -1, -1): + * 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]); + + /* "View.MemoryView":1345 + * 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]); + } + + /* "View.MemoryView":1347 + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1348 + * + * for i in range(offset): + * mslice.shape[i] = 1 # <<<<<<<<<<<<<< + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 + */ + (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1349 + * for i in range(offset): + * 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]); + + /* "View.MemoryView":1350 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1336 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1358 + * + * @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":1362 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1363 + * + * 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":1362 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1358 + * + * @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":1367 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1370 + * 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":1367 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1373 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1377 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1378 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1379 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_4 = (__pyx_v_inc != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1380 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1379 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1382 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + /*else*/ { + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + + /* "View.MemoryView":1378 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1384 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1385 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1387 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1373 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1393 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1396 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1397 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1399 + * _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":1393 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1403 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + + /* "View.MemoryView":1407 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1408 + * 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":1410 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1411 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1412 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); + + /* "View.MemoryView":1413 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + + /* "View.MemoryView":1410 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1415 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1416 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1418 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1403 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = NULL; + PyObject *__pyx_v___pyx_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_5) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_6) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_v___pyx_type); + __Pyx_GIVEREF(__pyx_v___pyx_type); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 7, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 10, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->name); + __Pyx_DECREF(__pyx_v___pyx_result->name); + __pyx_v___pyx_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(2, 11, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":12 + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (!__pyx_t_8) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_array __pyx_vtable_array; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_array; + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_array___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + __pyx_array___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + __pyx_array___len__, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._augment.array", /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._augment.Enum", /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, + {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, + {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, + {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._augment.memoryview", /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryviewslice___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._augment._memoryviewslice", /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Internal class for passing memoryview slices to Python", /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__augment(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__augment}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_augment", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_MDAnalysis_lib__augment, __pyx_k_MDAnalysis_lib__augment, sizeof(__pyx_k_MDAnalysis_lib__augment), 0, 0, 1, 1}, + {&__pyx_kp_s_MDAnalysis_lib__augment_pyx, __pyx_k_MDAnalysis_lib__augment_pyx, sizeof(__pyx_k_MDAnalysis_lib__augment_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_augment_coordinates, __pyx_k_augment_coordinates, sizeof(__pyx_k_augment_coordinates), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_coord, __pyx_k_coord, sizeof(__pyx_k_coord), 0, 0, 1, 1}, + {&__pyx_n_s_coordinates, __pyx_k_coordinates, sizeof(__pyx_k_coordinates), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_hi_x, __pyx_k_hi_x, sizeof(__pyx_k_hi_x), 0, 0, 1, 1}, + {&__pyx_n_s_hi_y, __pyx_k_hi_y, sizeof(__pyx_k_hi_y), 0, 0, 1, 1}, + {&__pyx_n_s_hi_z, __pyx_k_hi_z, sizeof(__pyx_k_hi_z), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_lo_x, __pyx_k_lo_x, sizeof(__pyx_k_lo_x), 0, 0, 1, 1}, + {&__pyx_n_s_lo_y, __pyx_k_lo_y, sizeof(__pyx_k_lo_y), 0, 0, 1, 1}, + {&__pyx_n_s_lo_z, __pyx_k_lo_z, sizeof(__pyx_k_lo_z), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_mdamath, __pyx_k_mdamath, sizeof(__pyx_k_mdamath), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_nreal, __pyx_k_nreal, sizeof(__pyx_k_nreal), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reciprocal, __pyx_k_reciprocal, sizeof(__pyx_k_reciprocal), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1}, + {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_shiftX, __pyx_k_shiftX, sizeof(__pyx_k_shiftX), 0, 0, 1, 1}, + {&__pyx_n_s_shiftY, __pyx_k_shiftY, sizeof(__pyx_k_shiftY), 0, 0, 1, 1}, + {&__pyx_n_s_shiftZ, __pyx_k_shiftZ, sizeof(__pyx_k_shiftZ), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_translation, __pyx_k_translation, sizeof(__pyx_k_translation), 0, 0, 1, 1}, + {&__pyx_n_s_triclinic_vectors, __pyx_k_triclinic_vectors, sizeof(__pyx_k_triclinic_vectors), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_undo_augment, __pyx_k_undo_augment, sizeof(__pyx_k_undo_augment), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 81, __pyx_L1_error) + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(2, 81, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 84, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 94, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 147, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 608, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "View.MemoryView":132 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "View.MemoryView":135 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "View.MemoryView":138 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "View.MemoryView":147 + * + * 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, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "View.MemoryView":175 + * 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, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":191 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":413 + * 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, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":490 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":515 + * 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_STRIDES: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "View.MemoryView":565 + * 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, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "View.MemoryView":572 + * 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, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__22, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "View.MemoryView":677 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(2, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__25); + __Pyx_GIVEREF(__pyx_slice__25); + + /* "View.MemoryView":680 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(2, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__26); + __Pyx_GIVEREF(__pyx_slice__26); + + /* "View.MemoryView":691 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(2, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__27); + __Pyx_GIVEREF(__pyx_slice__27); + + /* "View.MemoryView":698 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "MDAnalysis/lib/_augment.pyx":39 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def augment_coordinates(float[:, ::1] coordinates, float[:] box, float r): # <<<<<<<<<<<<<< + * r"""Calculates the periodic images of particles which are within a distance + * `r` from the box walls. + */ + __pyx_tuple__31 = PyTuple_Pack(24, __pyx_n_s_coordinates, __pyx_n_s_box, __pyx_n_s_r, __pyx_n_s_lo_x, __pyx_n_s_hi_x, __pyx_n_s_lo_y, __pyx_n_s_hi_y, __pyx_n_s_lo_z, __pyx_n_s_hi_z, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_N, __pyx_n_s_norm, __pyx_n_s_shiftX, __pyx_n_s_shiftY, __pyx_n_s_shiftZ, __pyx_n_s_coord, __pyx_n_s_end, __pyx_n_s_other, __pyx_n_s_dm, __pyx_n_s_reciprocal, __pyx_n_s_output, __pyx_n_s_indices, __pyx_n_s_n); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 24, 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_MDAnalysis_lib__augment_pyx, __pyx_n_s_augment_coordinates, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 39, __pyx_L1_error) + + /* "MDAnalysis/lib/_augment.pyx":301 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def undo_augment(np.int64_t[:] results, np.int64_t[:] translation, int nreal): # <<<<<<<<<<<<<< + * """Translate augmented indices back to original indices. + * + */ + __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_results, __pyx_n_s_translation, __pyx_n_s_nreal, __pyx_n_s_N, __pyx_n_s_i); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 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_MDAnalysis_lib__augment_pyx, __pyx_n_s_undo_augment, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 301, __pyx_L1_error) + + /* "View.MemoryView":285 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "View.MemoryView":286 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + + /* "View.MemoryView":287 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + + /* "View.MemoryView":290 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "View.MemoryView":291 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_modinit_global_init_code(void); /*proto*/ +static int __Pyx_modinit_variable_export_code(void); /*proto*/ +static int __Pyx_modinit_function_export_code(void); /*proto*/ +static int __Pyx_modinit_type_init_code(void); /*proto*/ +static int __Pyx_modinit_type_import_code(void); /*proto*/ +static int __Pyx_modinit_variable_import_code(void); /*proto*/ +static int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 164, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 186, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 190, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 199, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 872, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = __Pyx_ImportModule("MDAnalysis.lib._cutil"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "_dot", (void (**)(void))&__pyx_f_10MDAnalysis_3lib_6_cutil__dot, "float (float *, float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "_cross", (void (**)(void))&__pyx_f_10MDAnalysis_3lib_6_cutil__cross, "void (float *, float *, float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "_norm", (void (**)(void))&__pyx_f_10MDAnalysis_3lib_6_cutil__norm, "float (float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_augment(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_augment(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__augment(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__augment(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + result = PyDict_SetItemString(moddict, to_name, value); + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static int __pyx_pymod_exec__augment(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + static PyThread_type_lock __pyx_t_3[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__augment(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_augment", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_MDAnalysis__lib___augment) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "MDAnalysis.lib._augment")) { + if (unlikely(PyDict_SetItemString(modules, "MDAnalysis.lib._augment", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "MDAnalysis/lib/_augment.pyx":25 + * + * import cython + * import numpy as np # <<<<<<<<<<<<<< + * from .mdamath import triclinic_vectors + * cimport numpy as np + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "MDAnalysis/lib/_augment.pyx":26 + * import cython + * import numpy as np + * from .mdamath import triclinic_vectors # <<<<<<<<<<<<<< + * cimport numpy as np + * cimport _cutil + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_triclinic_vectors); + __Pyx_GIVEREF(__pyx_n_s_triclinic_vectors); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_triclinic_vectors); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_mdamath, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_triclinic_vectors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_triclinic_vectors, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_augment.pyx":34 + * + * + * __all__ = ['augment_coordinates', 'undo_augment'] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_augment_coordinates); + __Pyx_GIVEREF(__pyx_n_s_augment_coordinates); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_augment_coordinates); + __Pyx_INCREF(__pyx_n_s_undo_augment); + __Pyx_GIVEREF(__pyx_n_s_undo_augment); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_undo_augment); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_augment.pyx":39 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def augment_coordinates(float[:, ::1] coordinates, float[:] box, float r): # <<<<<<<<<<<<<< + * r"""Calculates the periodic images of particles which are within a distance + * `r` from the box walls. + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_8_augment_1augment_coordinates, NULL, __pyx_n_s_MDAnalysis_lib__augment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_augment_coordinates, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_augment.pyx":301 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def undo_augment(np.int64_t[:] results, np.int64_t[:] translation, int nreal): # <<<<<<<<<<<<<< + * """Translate augmented indices back to original indices. + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_8_augment_3undo_augment, NULL, __pyx_n_s_MDAnalysis_lib__augment); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_undo_augment, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_augment.pyx":1 + * # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- # <<<<<<<<<<<<<< + * # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 + * # + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":208 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 208, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":285 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":286 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":287 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":290 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":291 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":315 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":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 = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_3[0] = PyThread_allocate_lock(); + __pyx_t_3[1] = PyThread_allocate_lock(); + __pyx_t_3[2] = PyThread_allocate_lock(); + __pyx_t_3[3] = PyThread_allocate_lock(); + __pyx_t_3[4] = PyThread_allocate_lock(); + __pyx_t_3[5] = PyThread_allocate_lock(); + __pyx_t_3[6] = PyThread_allocate_lock(); + __pyx_t_3[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":544 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 544, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":990 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 990, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init MDAnalysis.lib._augment", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init MDAnalysis.lib._augment"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* GetModuleGlobalName */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + if (likely(result)) { + Py_INCREF(result); + } else if (unlikely(PyErr_Occurred())) { + result = NULL; + } else { +#else + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* MemviewSliceInit */ + static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (!buf) { + PyErr_SetString(PyExc_ValueError, + "buf is NULL."); + goto fail; + } else if (memviewslice->memview || memviewslice->data) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +#ifndef Py_NO_RETURN +#define Py_NO_RETURN +#endif +static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + va_end(vargs); + Py_FatalError(msg); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* PyErrFetchRestore */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ + #if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* DictGetItem */ + #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if PY_VERSION_HEX >= 0x030700A3 + *type = tstate->exc_state.exc_type; + *value = tstate->exc_state.exc_value; + *tb = tstate->exc_state.exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = type; + tstate->exc_state.exc_value = value; + tstate->exc_state.exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = local_type; + tstate->exc_state.exc_value = local_value; + tstate->exc_state.exc_traceback = local_tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* ArgTypeTest */ + static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* BytesEquals */ + static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ + static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* None */ + static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ + #if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* decode_c_string */ + static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* GetAttr3 */ + static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = *type; + tstate->exc_state.exc_value = *value; + tstate->exc_state.exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* None */ + static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* WriteUnraisableException */ + static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* HasAttr */ + static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* PyObject_GenericGetAttrNoDict */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* SetupReduce */ + static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto GOOD; +BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (PyObject_Not(use_cline) != 0) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* IsLittleEndian */ + static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ + static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG, + (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2, + &__Pyx_TypeInfo_float, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_float, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(float *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) { + float value = __pyx_PyFloat_AsFloat(obj); + if ((value == (float)-1) && PyErr_Occurred()) + return 0; + *(float *) itemp = value; + return 1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj); + if ((value == ((npy_int64)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int64_t *) itemp = value; + return 1; +} + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = 1.0 / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = 1.0 / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0, -1); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = 1.0 / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = 1.0 / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0, -1); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum NPY_TYPES) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum NPY_TYPES) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), + little, !is_unsigned); + } +} + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_int64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0]) + case 2: + if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) { + return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) { + return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) { + return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_int64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_int64) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) { + return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) { + return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_int64"); + return (npy_int64) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = (char) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + } +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* ModuleImport */ + #ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +/* FunctionImport */ + #ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(x); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/package/MDAnalysis/lib/_augment.pyx b/package/MDAnalysis/lib/_augment.pyx new file mode 100644 index 00000000000..b9dd8cfba9f --- /dev/null +++ b/package/MDAnalysis/lib/_augment.pyx @@ -0,0 +1,341 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +# + +import cython +import numpy as np +from .mdamath import triclinic_vectors +cimport numpy as np +cimport _cutil +from _cutil cimport _dot ,_norm, _cross + +from libcpp.vector cimport vector + + +__all__ = ['augment_coordinates', 'undo_augment'] + + +@cython.boundscheck(False) +@cython.wraparound(False) +def augment_coordinates(float[:, ::1] coordinates, float[:] box, float r): + r"""Calculates the periodic images of particles which are within a distance + `r` from the box walls. + + The algorithm works by generating explicit periodic images of atoms residing + close to any of the six box walls. The steps involved in generating images + involves the evaluation of reciprocal box vectors followed by the + calculation of distances of atoms from the walls by means of projection onto + the reciprocal vectors. If the distance is less than a specified cutoff + distance, relevant periodic images are generated using box translation + vectors :math:`\vec{t}` with + + .. math:: \vec{t}=l\cdot\vec{a}+m\cdot\vec{b}+n\cdot \vec{c}\,, + + where :math:`l,\,m,\,n \in \{-1,\,0,\,1\}` are the neighboring cell indices + in :math:`x`-, :math:`y`-, and :math:`z`-direction relative to the central + cell with box vectors :math:`\vec{a},\,\vec{b},\,\vec{c}`. + + For instance, an atom close to the :math:`xy`-plane containing the origin + will generate a periodic image outside the central cell and close to the + opposite :math:`xy`-plane of the box, i.e., shifted by + :math:`\vec{t} = 0\cdot\vec{a}+0\cdot\vec{b}+1\cdot\vec{c}=\vec{c}`. + + Likewise, if the particle is close to more than one box walls, images along + the diagonals are also generated:: + + x x + +------------+ +------------+ + | | augment | | + | | -------> | | + | o | x | o | + +------------+ +------------+ + + Parameters + ---------- + coordinates : numpy.ndarray + Input coordinate array of shape ``(n, 3)`` and dtype ``numpy.float32`` + used to generate duplicate images in the vicinity of the central cell. All + coordinates must be within the primary unit cell. + box : numpy.ndarray + Box dimensions of shape ``(6,)`` and dtype ``numpy.float32``. The + dimensions must be provided in the same format as returned + by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: + ``[lx, ly, lz, alpha, beta, gamma]`` + r : float + Thickness of cutoff region for duplicate image generation. + + Returns + ------- + output : numpy.ndarray + Coordinates of duplicate (augmented) particles (dtype ``numpy.float32``). + indices : numpy.ndarray + Original indices of the augmented coordinates (dtype ``numpy.int64``). + Maps the indices of augmented particles to their original particle index + such that ``indices[augmented_index] = original_index``. + + Note + ---- + Output does not return coordinates from the initial array. + To merge the particles with their respective images, the following operation + is necessary when generating the images: + + .. code-block:: python + + images, mapping = augment_coordinates(coordinates, box, max_cutoff) + all_coords = numpy.concatenate([coordinates, images]) + + + See Also + -------- + :meth:`undo_augment` + + + .. versionadded:: 0.19.0 + """ + cdef bint lo_x, hi_x, lo_y, hi_y, lo_z, hi_z + cdef int i, j, N + cdef float norm + cdef float shiftX[3] + cdef float shiftY[3] + cdef float shiftZ[3] + cdef float coord[3] + cdef float end[3] + cdef float other[3] + cdef float dm[3][3] + cdef float reciprocal[3][3] + + dm = triclinic_vectors(box) + + for i in range(3): + shiftX[i] = dm[0][i] + shiftY[i] = dm[1][i] + shiftZ[i] = dm[2][i] + end[i] = dm[0][i] + dm[1][i] + dm[2][i] + # Calculate reciprocal vectors + _cross(&dm[1][0], &dm[2][0], &reciprocal[0][0]) + _cross(&dm[2][0], &dm[0][0], &reciprocal[1][0]) + _cross(&dm[0][0], &dm[1][0], &reciprocal[2][0]) + # Normalize + for i in range(3): + norm = _norm(&reciprocal[i][0]) + for j in range(3): + reciprocal[i][j] = reciprocal[i][j]/norm + + N = coordinates.shape[0] + + cdef vector[float] output + cdef vector[int] indices + + for i in range(N): + for j in range(3): + coord[j] = coordinates[i, j] + other[j] = end[j] - coordinates[i, j] + # identify the condition + lo_x = _dot(&coord[0], &reciprocal[0][0]) <= r + hi_x = _dot(&other[0], &reciprocal[0][0]) <= r + lo_y = _dot(&coord[0], &reciprocal[1][0]) <= r + hi_y = _dot(&other[0], &reciprocal[1][0]) <= r + lo_z = _dot(&coord[0], &reciprocal[2][0]) <= r + hi_z = _dot(&other[0], &reciprocal[2][0]) <= r + + if lo_x: + # if X, face piece + for j in range(3): + # add to output + output.push_back(coord[j] + shiftX[j]) + # keep record of which index this augmented + # position was created from + indices.push_back(i) + + if lo_y: + # if X&Y, edge piece + for j in range(3): + output.push_back(coord[j] + shiftX[j] + shiftY[j]) + indices.push_back(i) + + if lo_z: + # if X&Y&Z, corner piece + for j in range(3): + output.push_back(coord[j] + shiftX[j] + shiftY[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] + shiftX[j] + shiftY[j] - shiftZ[j]) + indices.push_back(i) + + elif hi_y: + for j in range(3): + output.push_back(coord[j] + shiftX[j] - shiftY[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] + shiftX[j] - shiftY[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] + shiftX[j] - shiftY[j] - shiftZ[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] + shiftX[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] + shiftX[j] - shiftZ[j]) + indices.push_back(i) + + elif hi_x: + for j in range(3): + output.push_back(coord[j] - shiftX[j]) + indices.push_back(i) + + if lo_y: + for j in range(3): + output.push_back(coord[j] - shiftX[j] + shiftY[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] - shiftX[j] + shiftY[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] - shiftX[j] + shiftY[j] - shiftZ[j]) + indices.push_back(i) + + elif hi_y: + for j in range(3): + output.push_back(coord[j] - shiftX[j] - shiftY[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] - shiftX[j] - shiftY[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] - shiftX[j] - shiftY[j] - shiftZ[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] - shiftX[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] - shiftX[j] - shiftZ[j]) + indices.push_back(i) + + if lo_y: + for j in range(3): + output.push_back(coord[j] + shiftY[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] + shiftY[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] + shiftY[j] - shiftZ[j]) + indices.push_back(i) + + elif hi_y: + for j in range(3): + output.push_back(coord[j] - shiftY[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] - shiftY[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] - shiftY[j] - shiftZ[j]) + indices.push_back(i) + + if lo_z: + for j in range(3): + output.push_back(coord[j] + shiftZ[j]) + indices.push_back(i) + + elif hi_z: + for j in range(3): + output.push_back(coord[j] - shiftZ[j]) + indices.push_back(i) + n = indices.size() + return np.asarray(output, dtype=np.float32).reshape(n, 3), np.asarray(indices, dtype=np.int64) + + +@cython.boundscheck(False) +@cython.wraparound(False) +def undo_augment(np.int64_t[:] results, np.int64_t[:] translation, int nreal): + """Translate augmented indices back to original indices. + + Parameters + ---------- + results : numpy.ndarray + Array of dtype ``numpy.int64`` containing coordinate indices, including + "augmented" indices. + translation : numpy.ndarray + Index map of dtype ``numpy.int64`` linking the augmented indices to the + original particle indices such that + ``translation[augmented_index] = original_index``. + nreal : int + Number of real coordinates, i.e., indices in `results` equal or larger + than this need to be mapped to their real counterpart. + + Returns + ------- + results : numpy.ndarray + Modified input `results` with all the augmented indices translated to + their corresponding initial original indices. + + Note + ---- + Modifies the results array in place. + + See Also + -------- + :meth:`augment_coordinates` + + + .. versionadded:: 0.19.0 + """ + cdef int N + cdef ssize_t i + N = results.shape[0] + + for i in range(N): + if results[i] >= nreal: + results[i] = translation[results[i] - nreal] + return np.asarray(results, dtype=np.int64) diff --git a/package/MDAnalysis/lib/_cutil.cpp b/package/MDAnalysis/lib/_cutil.cpp new file mode 100644 index 00000000000..4f5c03ec31e --- /dev/null +++ b/package/MDAnalysis/lib/_cutil.cpp @@ -0,0 +1,28436 @@ +/* Generated by Cython 0.28.5 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", + "MDAnalysis/lib/include/calc_distances.h" + ], + "extra_compile_args": [ + "-ffast-math", + "-O3", + "-funroll-loops", + "-std=c++11", + "-stdlib=libc++" + ], + "include_dirs": [ + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include", + "MDAnalysis/lib/include" + ], + "language": "c++", + "libraries": [ + "m" + ], + "name": "MDAnalysis.lib._cutil", + "sources": [ + "MDAnalysis/lib/_cutil.pyx" + ] + }, + "module_name": "MDAnalysis.lib._cutil" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_28_5" +#define CYTHON_FUTURE_DIVISION 0 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__MDAnalysis__lib___cutil +#define __PYX_HAVE_API__MDAnalysis__lib___cutil +/* Early includes */ +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include +#include +#include +#include "calc_distances.h" +#include "pythread.h" +#include +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "MDAnalysis/lib/_cutil.pyx", + "__init__.pxd", + "stringsource", + "type.pxd", +}; +/* MemviewSliceStruct.proto */ +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; +#define __Pyx_MemoryView_Len(m) (m.shape[0]) + +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 + * # 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 + * #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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 + * #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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 + * # 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 + * 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; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; + +/* "MDAnalysis/lib/_cutil.pyx":44 + * void minimum_image_triclinic(double *dx, coordinate *box) + * + * ctypedef cset[int] intset # <<<<<<<<<<<<<< + * ctypedef cmap[int, intset] intmap + * + */ +typedef std::set __pyx_t_10MDAnalysis_3lib_6_cutil_intset; + +/* "MDAnalysis/lib/_cutil.pyx":45 + * + * ctypedef cset[int] intset + * ctypedef cmap[int, intset] intmap # <<<<<<<<<<<<<< + * + * + */ +typedef std::map __pyx_t_10MDAnalysis_3lib_6_cutil_intmap; + +/* "View.MemoryView":104 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + struct __pyx_vtabstruct_array *__pyx_vtab; + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":278 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":329 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":960 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "View.MemoryView":104 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":329 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":960 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* MemviewSliceInit.proto */ +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* SliceObject.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* IncludeStringH.proto */ +#include + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* None.proto */ +static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* None.proto */ +static CYTHON_INLINE long __Pyx_div_long(long, long); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CppExceptionConversion.proto */ +#ifndef __Pyx_CppExn2PyErr +#include +#include +#include +#include +static void __Pyx_CppExn2PyErr() { + try { + if (PyErr_Occurred()) + ; // let the latest Python exn pass through and ignore the current one + else + throw; + } catch (const std::bad_alloc& exn) { + PyErr_SetString(PyExc_MemoryError, exn.what()); + } catch (const std::bad_cast& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::domain_error& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::invalid_argument& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::ios_base::failure& exn) { + PyErr_SetString(PyExc_IOError, exn.what()); + } catch (const std::out_of_range& exn) { + PyErr_SetString(PyExc_IndexError, exn.what()); + } catch (const std::overflow_error& exn) { + PyErr_SetString(PyExc_OverflowError, exn.what()); + } catch (const std::range_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::underflow_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::exception& exn) { + PyErr_SetString(PyExc_RuntimeError, exn.what()); + } + catch (...) + { + PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); + } +} +#endif + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj); + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); + +/* MemviewSliceCopyTemplate.proto */ +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_Py_ssize_t(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *, int writable_flag); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* PyIdentifierFromString.proto */ +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +/* ModuleImport.proto */ +static PyObject *__Pyx_ImportModule(const char *name); + +/* TypeImport.proto */ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ + +/* Module declarations from 'cython.view' */ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'libc.math' */ + +/* Module declarations from 'libcpp.utility' */ + +/* Module declarations from 'libcpp.set' */ + +/* Module declarations from 'libcpp.map' */ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'MDAnalysis.lib._cutil' */ +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static int __pyx_memoryview_thread_locks_used; +static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_f_10MDAnalysis_3lib_6_cutil_difference(__pyx_t_10MDAnalysis_3lib_6_cutil_intset, __pyx_t_10MDAnalysis_3lib_6_cutil_intset); /*proto*/ +static int __Pyx_carray_from_py_float(PyObject *, float *, Py_ssize_t); /*proto*/ +static int __Pyx_carray_from_py_float___5b_3_5d_(PyObject *, float (*)[3], Py_ssize_t); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_int(const std::vector &); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_Py_ssize_t = { "Py_ssize_t", NULL, sizeof(Py_ssize_t), { 0 }, 0, IS_UNSIGNED(Py_ssize_t) ? 'U' : 'I', IS_UNSIGNED(Py_ssize_t), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 }; +#define __Pyx_MODULE_NAME "MDAnalysis.lib._cutil" +extern int __pyx_module_is_main_MDAnalysis__lib___cutil; +int __pyx_module_is_main_MDAnalysis__lib___cutil = 0; + +/* Implementation of 'MDAnalysis.lib._cutil' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_OverflowError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_IndexError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static const char __pyx_k_O[] = "O"; +static const char __pyx_k_a[] = "a"; +static const char __pyx_k_b[] = "b"; +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_j[] = "j"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_ix[] = "ix"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_box[] = "box"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_vec[] = "vec"; +static const char __pyx_k_atom[] = "atom"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_done[] = "done"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_sort[] = "sort"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_todo[] = "todo"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_array[] = "array"; +static const char __pyx_k_atoms[] = "atoms"; +static const char __pyx_k_bonds[] = "bonds"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_frags[] = "frags"; +static const char __pyx_k_int32[] = "int32"; +static const char __pyx_k_int64[] = "int64"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_ortho[] = "ortho"; +static const char __pyx_k_other[] = "other"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_natoms[] = "natoms"; +static const char __pyx_k_newpos[] = "newpos"; +static const char __pyx_k_nloops[] = "nloops"; +static const char __pyx_k_oldpos[] = "oldpos"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_struct[] = "struct"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_values[] = "values"; +static const char __pyx_k_asarray[] = "asarray"; +static const char __pyx_k_bonding[] = "bonding"; +static const char __pyx_k_bondmap[] = "bondmap"; +static const char __pyx_k_float32[] = "float32"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_ix_view[] = "ix_view"; +static const char __pyx_k_mdamath[] = "mdamath"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_tri_box[] = "tri_box"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_bondlist[] = "bondlist"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_n_values[] = "n_values"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_atomgroup[] = "atomgroup"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_frag_done[] = "frag_done"; +static const char __pyx_k_frag_todo[] = "frag_todo"; +static const char __pyx_k_ix_to_rel[] = "ix_to_rel"; +static const char __pyx_k_positions[] = "positions"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_refpoints[] = "refpoints"; +static const char __pyx_k_this_frag[] = "this_frag"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_MDAnalysis[] = "MDAnalysis"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_atoms_view[] = "atoms_view"; +static const char __pyx_k_bonds_view[] = "bonds_view"; +static const char __pyx_k_dimensions[] = "dimensions"; +static const char __pyx_k_make_whole[] = "make_whole"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_to_indices[] = "to_indices"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_NoDataError[] = "NoDataError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_inverse_box[] = "inverse_box"; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_is_monotonic[] = "is_monotonic"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_OverflowError[] = "OverflowError"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_unique_int_1d[] = "unique_int_1d"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_find_fragments[] = "find_fragments"; +static const char __pyx_k_reference_atom[] = "reference_atom"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; +static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_triclinic_vectors[] = "triclinic_vectors"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_strided_and_indirect[] = ""; +static const char __pyx_k_MDAnalysis_lib__cutil[] = "MDAnalysis.lib._cutil"; +static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_MDAnalysis_lib__cutil_pyx[] = "MDAnalysis/lib/_cutil.pyx"; +static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; +static const char __pyx_k_One_or_more_dimensions_was_zero[] = "One or more dimensions was zero. You can set dimensions using 'atomgroup.dimensions='"; +static const char __pyx_k_Reference_atom_not_in_atomgroup[] = "Reference atom not in atomgroup"; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static const char __pyx_k_AtomGroup_was_not_contiguous_fro[] = "AtomGroup was not contiguous from bonds, process failed"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; +static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static const char __pyx_k_The_atomgroup_is_required_to_hav[] = "The atomgroup is required to have bonds"; +static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_kp_s_AtomGroup_was_not_contiguous_fro; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; +static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_n_s_MDAnalysis; +static PyObject *__pyx_n_s_MDAnalysis_lib__cutil; +static PyObject *__pyx_kp_s_MDAnalysis_lib__cutil_pyx; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_n_s_NoDataError; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_kp_s_One_or_more_dimensions_was_zero; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_OverflowError; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_kp_s_Reference_atom_not_in_atomgroup; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_kp_s_The_atomgroup_is_required_to_hav; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_n_s_a; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_array; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_atom; +static PyObject *__pyx_n_s_atomgroup; +static PyObject *__pyx_n_s_atoms; +static PyObject *__pyx_n_s_atoms_view; +static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_bonding; +static PyObject *__pyx_n_s_bondlist; +static PyObject *__pyx_n_s_bondmap; +static PyObject *__pyx_n_s_bonds; +static PyObject *__pyx_n_s_bonds_view; +static PyObject *__pyx_n_s_box; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dimensions; +static PyObject *__pyx_n_s_done; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_find_fragments; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_frag_done; +static PyObject *__pyx_n_s_frag_todo; +static PyObject *__pyx_n_s_frags; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_i; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_int32; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_inverse_box; +static PyObject *__pyx_n_s_is_monotonic; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_ix; +static PyObject *__pyx_n_s_ix_to_rel; +static PyObject *__pyx_n_s_ix_view; +static PyObject *__pyx_n_s_j; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_make_whole; +static PyObject *__pyx_n_s_mdamath; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_n_values; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_natoms; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_newpos; +static PyObject *__pyx_n_s_nloops; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_oldpos; +static PyObject *__pyx_n_s_ortho; +static PyObject *__pyx_n_s_other; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_positions; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_reference_atom; +static PyObject *__pyx_n_s_refpoints; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_sort; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_this_frag; +static PyObject *__pyx_n_s_to_indices; +static PyObject *__pyx_n_s_todo; +static PyObject *__pyx_n_s_tri_box; +static PyObject *__pyx_n_s_triclinic_vectors; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_n_s_unique_int_1d; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_n_s_vec; +static PyObject *__pyx_n_s_zeros; +static PyObject *__pyx_pf_10MDAnalysis_3lib_6_cutil_unique_int_1d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6_cutil_2make_whole(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_atomgroup, PyObject *__pyx_v_reference_atom); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6_cutil_4find_fragments(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_bondlist); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_slice_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__30; +static PyObject *__pyx_slice__31; +static PyObject *__pyx_slice__32; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__44; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__48; +/* Late includes */ + +/* "MDAnalysis/lib/_cutil.pyx":50 + * @cython.boundscheck(False) # turn off bounds-checking for entire function + * @cython.wraparound(False) # turn off negative index wrapping for entire function + * def unique_int_1d(np.int64_t[:] values): # <<<<<<<<<<<<<< + * """Find the unique elements of a 1D array of integers. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6_cutil_1unique_int_1d(PyObject *__pyx_self, PyObject *__pyx_arg_values); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6_cutil_unique_int_1d[] = "Find the unique elements of a 1D array of integers.\n\n This function is optimal on sorted arrays.\n\n Parameters\n ----------\n values: numpy.ndarray\n 1D array of dtype ``numpy.int64`` in which to find the unique values.\n\n Returns\n -------\n numpy.ndarray\n A deduplicated copy of `values`.\n\n\n .. versionadded:: 0.19.0\n "; +static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_6_cutil_1unique_int_1d = {"unique_int_1d", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6_cutil_1unique_int_1d, METH_O, __pyx_doc_10MDAnalysis_3lib_6_cutil_unique_int_1d}; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6_cutil_1unique_int_1d(PyObject *__pyx_self, PyObject *__pyx_arg_values) { + __Pyx_memviewslice __pyx_v_values = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unique_int_1d (wrapper)", 0); + assert(__pyx_arg_values); { + __pyx_v_values = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_arg_values, PyBUF_WRITABLE); if (unlikely(!__pyx_v_values.memview)) __PYX_ERR(0, 50, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib._cutil.unique_int_1d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6_cutil_unique_int_1d(__pyx_self, __pyx_v_values); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6_cutil_unique_int_1d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_values) { + int __pyx_v_is_monotonic; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_v_n_values; + __Pyx_memviewslice __pyx_v_result = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + __Pyx_RefNannySetupContext("unique_int_1d", 0); + + /* "MDAnalysis/lib/_cutil.pyx":68 + * .. versionadded:: 0.19.0 + * """ + * cdef bint is_monotonic = True # <<<<<<<<<<<<<< + * cdef int i = 0 + * cdef int j = 0 + */ + __pyx_v_is_monotonic = 1; + + /* "MDAnalysis/lib/_cutil.pyx":69 + * """ + * cdef bint is_monotonic = True + * cdef int i = 0 # <<<<<<<<<<<<<< + * cdef int j = 0 + * cdef int n_values = values.shape[0] + */ + __pyx_v_i = 0; + + /* "MDAnalysis/lib/_cutil.pyx":70 + * cdef bint is_monotonic = True + * cdef int i = 0 + * cdef int j = 0 # <<<<<<<<<<<<<< + * cdef int n_values = values.shape[0] + * cdef np.int64_t[:] result = np.empty(n_values, dtype=np.int64) + */ + __pyx_v_j = 0; + + /* "MDAnalysis/lib/_cutil.pyx":71 + * cdef int i = 0 + * cdef int j = 0 + * cdef int n_values = values.shape[0] # <<<<<<<<<<<<<< + * cdef np.int64_t[:] result = np.empty(n_values, dtype=np.int64) + * + */ + __pyx_v_n_values = (__pyx_v_values.shape[0]); + + /* "MDAnalysis/lib/_cutil.pyx":72 + * cdef int j = 0 + * cdef int n_values = values.shape[0] + * cdef np.int64_t[:] result = np.empty(n_values, dtype=np.int64) # <<<<<<<<<<<<<< + * + * if n_values == 0: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":74 + * cdef np.int64_t[:] result = np.empty(n_values, dtype=np.int64) + * + * if n_values == 0: # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_7 = ((__pyx_v_n_values == 0) != 0); + if (__pyx_t_7) { + + /* "MDAnalysis/lib/_cutil.pyx":75 + * + * if n_values == 0: + * return result # <<<<<<<<<<<<<< + * + * result[0] = values[0] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/_cutil.pyx":74 + * cdef np.int64_t[:] result = np.empty(n_values, dtype=np.int64) + * + * if n_values == 0: # <<<<<<<<<<<<<< + * return result + * + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":77 + * return result + * + * result[0] = values[0] # <<<<<<<<<<<<<< + * for i in range(1, n_values): + * if values[i] != result[j]: + */ + __pyx_t_8 = 0; + __pyx_t_9 = 0; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_9 * __pyx_v_result.strides[0]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_8 * __pyx_v_values.strides[0]) ))); + + /* "MDAnalysis/lib/_cutil.pyx":78 + * + * result[0] = values[0] + * for i in range(1, n_values): # <<<<<<<<<<<<<< + * if values[i] != result[j]: + * j += 1 + */ + __pyx_t_10 = __pyx_v_n_values; + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_v_i = __pyx_t_12; + + /* "MDAnalysis/lib/_cutil.pyx":79 + * result[0] = values[0] + * for i in range(1, n_values): + * if values[i] != result[j]: # <<<<<<<<<<<<<< + * j += 1 + * result[j] = values[i] + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = __pyx_v_j; + __pyx_t_7 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_13 * __pyx_v_values.strides[0]) ))) != (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_14 * __pyx_v_result.strides[0]) )))) != 0); + if (__pyx_t_7) { + + /* "MDAnalysis/lib/_cutil.pyx":80 + * for i in range(1, n_values): + * if values[i] != result[j]: + * j += 1 # <<<<<<<<<<<<<< + * result[j] = values[i] + * if values[i] < values[i - 1]: + */ + __pyx_v_j = (__pyx_v_j + 1); + + /* "MDAnalysis/lib/_cutil.pyx":81 + * if values[i] != result[j]: + * j += 1 + * result[j] = values[i] # <<<<<<<<<<<<<< + * if values[i] < values[i - 1]: + * is_monotonic = False + */ + __pyx_t_15 = __pyx_v_i; + __pyx_t_16 = __pyx_v_j; + *((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_result.data + __pyx_t_16 * __pyx_v_result.strides[0]) )) = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_15 * __pyx_v_values.strides[0]) ))); + + /* "MDAnalysis/lib/_cutil.pyx":79 + * result[0] = values[0] + * for i in range(1, n_values): + * if values[i] != result[j]: # <<<<<<<<<<<<<< + * j += 1 + * result[j] = values[i] + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":82 + * j += 1 + * result[j] = values[i] + * if values[i] < values[i - 1]: # <<<<<<<<<<<<<< + * is_monotonic = False + * result = result[:j + 1] + */ + __pyx_t_17 = __pyx_v_i; + __pyx_t_18 = (__pyx_v_i - 1); + __pyx_t_7 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_17 * __pyx_v_values.strides[0]) ))) < (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_18 * __pyx_v_values.strides[0]) )))) != 0); + if (__pyx_t_7) { + + /* "MDAnalysis/lib/_cutil.pyx":83 + * result[j] = values[i] + * if values[i] < values[i - 1]: + * is_monotonic = False # <<<<<<<<<<<<<< + * result = result[:j + 1] + * if not is_monotonic: + */ + __pyx_v_is_monotonic = 0; + + /* "MDAnalysis/lib/_cutil.pyx":82 + * j += 1 + * result[j] = values[i] + * if values[i] < values[i - 1]: # <<<<<<<<<<<<<< + * is_monotonic = False + * result = result[:j + 1] + */ + } + } + + /* "MDAnalysis/lib/_cutil.pyx":84 + * if values[i] < values[i - 1]: + * is_monotonic = False + * result = result[:j + 1] # <<<<<<<<<<<<<< + * if not is_monotonic: + * result = unique_int_1d(np.sort(result)) + */ + __pyx_t_6.data = __pyx_v_result.data; + __pyx_t_6.memview = __pyx_v_result.memview; + __PYX_INC_MEMVIEW(&__pyx_t_6, 0); + __pyx_t_10 = -1; + if (unlikely(__pyx_memoryview_slice_memviewslice( + &__pyx_t_6, + __pyx_v_result.shape[0], __pyx_v_result.strides[0], __pyx_v_result.suboffsets[0], + 0, + 0, + &__pyx_t_10, + 0, + (__pyx_v_j + 1), + 0, + 0, + 1, + 0, + 1) < 0)) +{ + __PYX_ERR(0, 84, __pyx_L1_error) +} + +__PYX_XDEC_MEMVIEW(&__pyx_v_result, 1); + __pyx_v_result = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":85 + * is_monotonic = False + * result = result[:j + 1] + * if not is_monotonic: # <<<<<<<<<<<<<< + * result = unique_int_1d(np.sort(result)) + * + */ + __pyx_t_7 = ((!(__pyx_v_is_monotonic != 0)) != 0); + if (__pyx_t_7) { + + /* "MDAnalysis/lib/_cutil.pyx":86 + * result = result[:j + 1] + * if not is_monotonic: + * result = unique_int_1d(np.sort(result)) # <<<<<<<<<<<<<< + * + * return np.array(result) + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unique_int_1d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_19)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_19); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_19) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_19, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL; + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (!__pyx_t_4) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1); + __pyx_v_result = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":85 + * is_monotonic = False + * result = result[:j + 1] + * if not is_monotonic: # <<<<<<<<<<<<<< + * result = unique_int_1d(np.sort(result)) + * + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":88 + * result = unique_int_1d(np.sort(result)) + * + * return np.array(result) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_20); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_20, function); + } + } + if (!__pyx_t_3) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_5); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_20)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/_cutil.pyx":50 + * @cython.boundscheck(False) # turn off bounds-checking for entire function + * @cython.wraparound(False) # turn off negative index wrapping for entire function + * def unique_int_1d(np.int64_t[:] values): # <<<<<<<<<<<<<< + * """Find the unique elements of a 1D array of integers. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("MDAnalysis.lib._cutil.unique_int_1d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_values, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_result, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/_cutil.pyx":91 + * + * + * cdef intset difference(intset a, intset b): # <<<<<<<<<<<<<< + * """a.difference(b) + * + */ + +static __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_f_10MDAnalysis_3lib_6_cutil_difference(__pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_a, __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_b) { + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_output; + int __pyx_v_val; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_r; + __Pyx_RefNannyDeclarations + std::set ::iterator __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("difference", 0); + + /* "MDAnalysis/lib/_cutil.pyx":97 + * """ + * cdef intset output + * for val in a: # <<<<<<<<<<<<<< + * if b.count(val) != 1: + * output.insert(val) + */ + __pyx_t_1 = __pyx_v_a.begin(); + for (;;) { + if (!(__pyx_t_1 != __pyx_v_a.end())) break; + __pyx_t_2 = *__pyx_t_1; + ++__pyx_t_1; + __pyx_v_val = __pyx_t_2; + + /* "MDAnalysis/lib/_cutil.pyx":98 + * cdef intset output + * for val in a: + * if b.count(val) != 1: # <<<<<<<<<<<<<< + * output.insert(val) + * return output + */ + __pyx_t_3 = ((__pyx_v_b.count(__pyx_v_val) != 1) != 0); + if (__pyx_t_3) { + + /* "MDAnalysis/lib/_cutil.pyx":99 + * for val in a: + * if b.count(val) != 1: + * output.insert(val) # <<<<<<<<<<<<<< + * return output + * + */ + try { + __pyx_v_output.insert(__pyx_v_val); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 99, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":98 + * cdef intset output + * for val in a: + * if b.count(val) != 1: # <<<<<<<<<<<<<< + * output.insert(val) + * return output + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":97 + * """ + * cdef intset output + * for val in a: # <<<<<<<<<<<<<< + * if b.count(val) != 1: + * output.insert(val) + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":100 + * if b.count(val) != 1: + * output.insert(val) + * return output # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_output; + goto __pyx_L0; + + /* "MDAnalysis/lib/_cutil.pyx":91 + * + * + * cdef intset difference(intset a, intset b): # <<<<<<<<<<<<<< + * """a.difference(b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("MDAnalysis.lib._cutil.difference", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/_cutil.pyx":105 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def make_whole(atomgroup, reference_atom=None): # <<<<<<<<<<<<<< + * """Move all atoms in a single molecule so that bonds don't split over images + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6_cutil_3make_whole(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6_cutil_2make_whole[] = "Move all atoms in a single molecule so that bonds don't split over images\n\n Atom positions are modified in place.\n\n This function is most useful when atoms have been packed into the primary\n unit cell, causing breaks mid molecule, with the molecule then appearing\n on either side of the unit cell. This is problematic for operations\n such as calculating the center of mass of the molecule. ::\n\n +-----------+ +-----------+\n | | | |\n | 6 3 | | 3 | 6\n | ! ! | | ! | !\n |-5-8 1-2-| -> | 1-2-|-5-8\n | ! ! | | ! | !\n | 7 4 | | 4 | 7\n | | | |\n +-----------+ +-----------+\n\n\n Parameters\n ----------\n atomgroup : AtomGroup\n The :class:`MDAnalysis.core.groups.AtomGroup` to work with.\n The positions of this are modified in place. All these atoms\n must belong in the same molecule or fragment.\n reference_atom : :class:`~MDAnalysis.core.groups.Atom`\n The atom around which all other atoms will be moved.\n Defaults to atom 0 in the atomgroup.\n\n Raises\n ------\n NoDataError\n There are no bonds present.\n (See :func:`~MDAnalysis.topology.core.guess_bonds`)\n\n ValueError\n The algorithm fails to work. This is usually\n caused by the atomgroup not being a single fragment.\n (ie the molecule can't be traversed by following bonds)\n\n\n Example\n -------\n Make fragments whole::\n\n from MDAnalysis.lib.mdamath import make_whole\n\n # This algorithm requires bonds, these can be guessed!\n u = mda.Universe(......, guess_bonds=True)\n\n # MDAnalysis can split molecules into their fragments\n # based on bonding information.\n # Note that this function will only handle a single fragment\n # at a time, necessitating"" a loop.\n for frag in u.fragments:\n make_whole(frag)\n\n Alternatively, to keep a single atom in place as the anchor::\n\n # This will mean that atomgroup[10] will NOT get moved,\n # and all other atoms will move (if necessary).\n make_whole(atomgroup, reference_atom=atomgroup[10])\n\n\n .. versionadded:: 0.11.0\n "; +static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_6_cutil_3make_whole = {"make_whole", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6_cutil_3make_whole, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_6_cutil_2make_whole}; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6_cutil_3make_whole(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_atomgroup = 0; + PyObject *__pyx_v_reference_atom = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("make_whole (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_atomgroup,&__pyx_n_s_reference_atom,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atomgroup)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reference_atom); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_whole") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_atomgroup = values[0]; + __pyx_v_reference_atom = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("make_whole", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 105, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib._cutil.make_whole", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6_cutil_2make_whole(__pyx_self, __pyx_v_atomgroup, __pyx_v_reference_atom); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6_cutil_2make_whole(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_atomgroup, PyObject *__pyx_v_reference_atom) { + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_refpoints; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_todo; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_done; + int __pyx_v_i; + int __pyx_v_nloops; + int __pyx_v_ref; + int __pyx_v_atom; + int __pyx_v_other; + int __pyx_v_natoms; + std::map __pyx_v_ix_to_rel; + __pyx_t_10MDAnalysis_3lib_6_cutil_intmap __pyx_v_bonding; + __Pyx_memviewslice __pyx_v_bonds = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_oldpos = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_newpos = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_ortho; + __Pyx_memviewslice __pyx_v_box = { 0, 0, { 0 }, { 0 }, { 0 } }; + float __pyx_v_tri_box[3][3]; + float __pyx_v_inverse_box[3]; + double __pyx_v_vec[3]; + __Pyx_memviewslice __pyx_v_ix_view = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_triclinic_vectors = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_memviewslice __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + float __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + float __pyx_t_18[3][3]; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + __Pyx_memviewslice __pyx_t_22 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + __Pyx_memviewslice __pyx_t_29 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_t_30; + Py_ssize_t __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + Py_ssize_t __pyx_t_34; + std::set ::iterator __pyx_t_35; + std::set ::iterator __pyx_t_36; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset *__pyx_t_37; + Py_ssize_t __pyx_t_38; + Py_ssize_t __pyx_t_39; + Py_ssize_t __pyx_t_40; + Py_ssize_t __pyx_t_41; + Py_ssize_t __pyx_t_42; + Py_ssize_t __pyx_t_43; + Py_ssize_t __pyx_t_44; + Py_ssize_t __pyx_t_45; + Py_ssize_t __pyx_t_46; + __Pyx_RefNannySetupContext("make_whole", 0); + + /* "MDAnalysis/lib/_cutil.pyx":187 + * + * # map of global indices to local indices + * ix_view = atomgroup.ix[:] # <<<<<<<<<<<<<< + * natoms = atomgroup.ix.shape[0] + * for i in range(natoms): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_atomgroup, __pyx_n_s_ix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_Py_ssize_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ix_view = __pyx_t_3; + __pyx_t_3.memview = NULL; + __pyx_t_3.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":188 + * # map of global indices to local indices + * ix_view = atomgroup.ix[:] + * natoms = atomgroup.ix.shape[0] # <<<<<<<<<<<<<< + * for i in range(natoms): + * ix_to_rel[ix_view[i]] = i + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_atomgroup, __pyx_n_s_ix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_natoms = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":189 + * ix_view = atomgroup.ix[:] + * natoms = atomgroup.ix.shape[0] + * for i in range(natoms): # <<<<<<<<<<<<<< + * ix_to_rel[ix_view[i]] = i + * + */ + __pyx_t_4 = __pyx_v_natoms; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "MDAnalysis/lib/_cutil.pyx":190 + * natoms = atomgroup.ix.shape[0] + * for i in range(natoms): + * ix_to_rel[ix_view[i]] = i # <<<<<<<<<<<<<< + * + * if reference_atom is None: + */ + __pyx_t_7 = __pyx_v_i; + (__pyx_v_ix_to_rel[(*((Py_ssize_t *) ( /* dim=0 */ (__pyx_v_ix_view.data + __pyx_t_7 * __pyx_v_ix_view.strides[0]) )))]) = __pyx_v_i; + } + + /* "MDAnalysis/lib/_cutil.pyx":192 + * ix_to_rel[ix_view[i]] = i + * + * if reference_atom is None: # <<<<<<<<<<<<<< + * ref = 0 + * else: + */ + __pyx_t_8 = (__pyx_v_reference_atom == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "MDAnalysis/lib/_cutil.pyx":193 + * + * if reference_atom is None: + * ref = 0 # <<<<<<<<<<<<<< + * else: + * # Sanity check + */ + __pyx_v_ref = 0; + + /* "MDAnalysis/lib/_cutil.pyx":192 + * ix_to_rel[ix_view[i]] = i + * + * if reference_atom is None: # <<<<<<<<<<<<<< + * ref = 0 + * else: + */ + goto __pyx_L5; + } + + /* "MDAnalysis/lib/_cutil.pyx":196 + * else: + * # Sanity check + * if not reference_atom in atomgroup: # <<<<<<<<<<<<<< + * raise ValueError("Reference atom not in atomgroup") + * ref = ix_to_rel[reference_atom.ix] + */ + /*else*/ { + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_reference_atom, __pyx_v_atomgroup, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_9 != 0); + if (unlikely(__pyx_t_8)) { + + /* "MDAnalysis/lib/_cutil.pyx":197 + * # Sanity check + * if not reference_atom in atomgroup: + * raise ValueError("Reference atom not in atomgroup") # <<<<<<<<<<<<<< + * ref = ix_to_rel[reference_atom.ix] + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 197, __pyx_L1_error) + + /* "MDAnalysis/lib/_cutil.pyx":196 + * else: + * # Sanity check + * if not reference_atom in atomgroup: # <<<<<<<<<<<<<< + * raise ValueError("Reference atom not in atomgroup") + * ref = ix_to_rel[reference_atom.ix] + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":198 + * if not reference_atom in atomgroup: + * raise ValueError("Reference atom not in atomgroup") + * ref = ix_to_rel[reference_atom.ix] # <<<<<<<<<<<<<< + * + * box = atomgroup.dimensions + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_reference_atom, __pyx_n_s_ix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ref = (__pyx_v_ix_to_rel[__pyx_t_4]); + } + __pyx_L5:; + + /* "MDAnalysis/lib/_cutil.pyx":200 + * ref = ix_to_rel[reference_atom.ix] + * + * box = atomgroup.dimensions # <<<<<<<<<<<<<< + * + * for i in range(3): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_atomgroup, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_box = __pyx_t_10; + __pyx_t_10.memview = NULL; + __pyx_t_10.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":202 + * box = atomgroup.dimensions + * + * for i in range(3): # <<<<<<<<<<<<<< + * if box[i] == 0.0: + * raise ValueError("One or more dimensions was zero. " + */ + for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":203 + * + * for i in range(3): + * if box[i] == 0.0: # <<<<<<<<<<<<<< + * raise ValueError("One or more dimensions was zero. " + * "You can set dimensions using 'atomgroup.dimensions='") + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_8 = (((*((float *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_11 * __pyx_v_box.strides[0]) ))) == 0.0) != 0); + if (unlikely(__pyx_t_8)) { + + /* "MDAnalysis/lib/_cutil.pyx":204 + * for i in range(3): + * if box[i] == 0.0: + * raise ValueError("One or more dimensions was zero. " # <<<<<<<<<<<<<< + * "You can set dimensions using 'atomgroup.dimensions='") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 204, __pyx_L1_error) + + /* "MDAnalysis/lib/_cutil.pyx":203 + * + * for i in range(3): + * if box[i] == 0.0: # <<<<<<<<<<<<<< + * raise ValueError("One or more dimensions was zero. " + * "You can set dimensions using 'atomgroup.dimensions='") + */ + } + } + + /* "MDAnalysis/lib/_cutil.pyx":207 + * "You can set dimensions using 'atomgroup.dimensions='") + * + * ortho = True # <<<<<<<<<<<<<< + * for i in range(3, 6): + * if box[i] != 90.0: + */ + __pyx_v_ortho = 1; + + /* "MDAnalysis/lib/_cutil.pyx":208 + * + * ortho = True + * for i in range(3, 6): # <<<<<<<<<<<<<< + * if box[i] != 90.0: + * ortho = False + */ + for (__pyx_t_4 = 3; __pyx_t_4 < 6; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":209 + * ortho = True + * for i in range(3, 6): + * if box[i] != 90.0: # <<<<<<<<<<<<<< + * ortho = False + * + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_8 = (((*((float *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_12 * __pyx_v_box.strides[0]) ))) != 90.0) != 0); + if (__pyx_t_8) { + + /* "MDAnalysis/lib/_cutil.pyx":210 + * for i in range(3, 6): + * if box[i] != 90.0: + * ortho = False # <<<<<<<<<<<<<< + * + * if ortho: + */ + __pyx_v_ortho = 0; + + /* "MDAnalysis/lib/_cutil.pyx":209 + * ortho = True + * for i in range(3, 6): + * if box[i] != 90.0: # <<<<<<<<<<<<<< + * ortho = False + * + */ + } + } + + /* "MDAnalysis/lib/_cutil.pyx":212 + * ortho = False + * + * if ortho: # <<<<<<<<<<<<<< + * for i in range(3): + * inverse_box[i] = 1.0 / box[i] + */ + __pyx_t_8 = (__pyx_v_ortho != 0); + if (__pyx_t_8) { + + /* "MDAnalysis/lib/_cutil.pyx":213 + * + * if ortho: + * for i in range(3): # <<<<<<<<<<<<<< + * inverse_box[i] = 1.0 / box[i] + * else: + */ + for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":214 + * if ortho: + * for i in range(3): + * inverse_box[i] = 1.0 / box[i] # <<<<<<<<<<<<<< + * else: + * from .mdamath import triclinic_vectors + */ + __pyx_t_13 = __pyx_v_i; + __pyx_t_14 = (*((float *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_13 * __pyx_v_box.strides[0]) ))); + if (unlikely(__pyx_t_14 == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "float division"); + __PYX_ERR(0, 214, __pyx_L1_error) + } + (__pyx_v_inverse_box[__pyx_v_i]) = (1.0 / __pyx_t_14); + } + + /* "MDAnalysis/lib/_cutil.pyx":212 + * ortho = False + * + * if ortho: # <<<<<<<<<<<<<< + * for i in range(3): + * inverse_box[i] = 1.0 / box[i] + */ + goto __pyx_L13; + } + + /* "MDAnalysis/lib/_cutil.pyx":216 + * inverse_box[i] = 1.0 / box[i] + * else: + * from .mdamath import triclinic_vectors # <<<<<<<<<<<<<< + * tri_box = triclinic_vectors(box) + * + */ + /*else*/ { + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_triclinic_vectors); + __Pyx_GIVEREF(__pyx_n_s_triclinic_vectors); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_triclinic_vectors); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_mdamath, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_triclinic_vectors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_triclinic_vectors = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":217 + * else: + * from .mdamath import triclinic_vectors + * tri_box = triclinic_vectors(box) # <<<<<<<<<<<<<< + * + * # C++ dict of bonds + */ + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_box, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_triclinic_vectors); + __pyx_t_15 = __pyx_v_triclinic_vectors; __pyx_t_16 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) { + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_16)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_16); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + } + } + if (!__pyx_t_16) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_15)) { + PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) { + PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL; + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + } + } + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(__Pyx_carray_from_py_float___5b_3_5d_(__pyx_t_1, __pyx_t_18, 3) < 0)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + memcpy(&(__pyx_v_tri_box[0]), __pyx_t_18, sizeof(__pyx_v_tri_box[0]) * (3)); + } + __pyx_L13:; + + /* "MDAnalysis/lib/_cutil.pyx":220 + * + * # C++ dict of bonds + * try: # <<<<<<<<<<<<<< + * bonds = atomgroup.bonds.to_indices() + * except (AttributeError, NoDataError): + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + /*try:*/ { + + /* "MDAnalysis/lib/_cutil.pyx":221 + * # C++ dict of bonds + * try: + * bonds = atomgroup.bonds.to_indices() # <<<<<<<<<<<<<< + * except (AttributeError, NoDataError): + * raise NoDataError("The atomgroup is required to have bonds") + */ + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_atomgroup, __pyx_n_s_bonds); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 221, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_to_indices); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 221, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_17, function); + } + } + if (__pyx_t_15) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } else { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L16_error) + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_22 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_22.memview)) __PYX_ERR(0, 221, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_bonds = __pyx_t_22; + __pyx_t_22.memview = NULL; + __pyx_t_22.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":220 + * + * # C++ dict of bonds + * try: # <<<<<<<<<<<<<< + * bonds = atomgroup.bonds.to_indices() + * except (AttributeError, NoDataError): + */ + } + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + goto __pyx_L21_try_end; + __pyx_L16_error:; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1); + + /* "MDAnalysis/lib/_cutil.pyx":222 + * try: + * bonds = atomgroup.bonds.to_indices() + * except (AttributeError, NoDataError): # <<<<<<<<<<<<<< + * raise NoDataError("The atomgroup is required to have bonds") + * for i in range(bonds.shape[0]): + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_17, &__pyx_t_15); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NoDataError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_builtin_AttributeError) || __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_17, __pyx_t_15); + __pyx_t_1 = 0; __pyx_t_17 = 0; __pyx_t_15 = 0; + if (__pyx_t_4) { + __Pyx_AddTraceback("MDAnalysis.lib._cutil.make_whole", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_17, &__pyx_t_1) < 0) __PYX_ERR(0, 222, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GOTREF(__pyx_t_17); + __Pyx_GOTREF(__pyx_t_1); + + /* "MDAnalysis/lib/_cutil.pyx":223 + * bonds = atomgroup.bonds.to_indices() + * except (AttributeError, NoDataError): + * raise NoDataError("The atomgroup is required to have bonds") # <<<<<<<<<<<<<< + * for i in range(bonds.shape[0]): + * atom = bonds[i, 0] + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NoDataError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 223, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_16, 0, 0, 0); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __PYX_ERR(0, 223, __pyx_L18_except_error) + } + goto __pyx_L18_except_error; + __pyx_L18_except_error:; + + /* "MDAnalysis/lib/_cutil.pyx":220 + * + * # C++ dict of bonds + * try: # <<<<<<<<<<<<<< + * bonds = atomgroup.bonds.to_indices() + * except (AttributeError, NoDataError): + */ + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); + goto __pyx_L1_error; + __pyx_L21_try_end:; + } + + /* "MDAnalysis/lib/_cutil.pyx":224 + * except (AttributeError, NoDataError): + * raise NoDataError("The atomgroup is required to have bonds") + * for i in range(bonds.shape[0]): # <<<<<<<<<<<<<< + * atom = bonds[i, 0] + * other = bonds[i, 1] + */ + __pyx_t_23 = (__pyx_v_bonds.shape[0]); + __pyx_t_24 = __pyx_t_23; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_24; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":225 + * raise NoDataError("The atomgroup is required to have bonds") + * for i in range(bonds.shape[0]): + * atom = bonds[i, 0] # <<<<<<<<<<<<<< + * other = bonds[i, 1] + * # only add bonds if both atoms are in atoms set + */ + __pyx_t_25 = __pyx_v_i; + __pyx_t_26 = 0; + __pyx_v_atom = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_bonds.data + __pyx_t_25 * __pyx_v_bonds.strides[0]) ) + __pyx_t_26 * __pyx_v_bonds.strides[1]) ))); + + /* "MDAnalysis/lib/_cutil.pyx":226 + * for i in range(bonds.shape[0]): + * atom = bonds[i, 0] + * other = bonds[i, 1] # <<<<<<<<<<<<<< + * # only add bonds if both atoms are in atoms set + * if ix_to_rel.count(atom) and ix_to_rel.count(other): + */ + __pyx_t_27 = __pyx_v_i; + __pyx_t_28 = 1; + __pyx_v_other = (*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_bonds.data + __pyx_t_27 * __pyx_v_bonds.strides[0]) ) + __pyx_t_28 * __pyx_v_bonds.strides[1]) ))); + + /* "MDAnalysis/lib/_cutil.pyx":228 + * other = bonds[i, 1] + * # only add bonds if both atoms are in atoms set + * if ix_to_rel.count(atom) and ix_to_rel.count(other): # <<<<<<<<<<<<<< + * atom = ix_to_rel[atom] + * other = ix_to_rel[other] + */ + __pyx_t_9 = (__pyx_v_ix_to_rel.count(__pyx_v_atom) != 0); + if (__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L27_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_ix_to_rel.count(__pyx_v_other) != 0); + __pyx_t_8 = __pyx_t_9; + __pyx_L27_bool_binop_done:; + if (__pyx_t_8) { + + /* "MDAnalysis/lib/_cutil.pyx":229 + * # only add bonds if both atoms are in atoms set + * if ix_to_rel.count(atom) and ix_to_rel.count(other): + * atom = ix_to_rel[atom] # <<<<<<<<<<<<<< + * other = ix_to_rel[other] + * + */ + __pyx_v_atom = (__pyx_v_ix_to_rel[__pyx_v_atom]); + + /* "MDAnalysis/lib/_cutil.pyx":230 + * if ix_to_rel.count(atom) and ix_to_rel.count(other): + * atom = ix_to_rel[atom] + * other = ix_to_rel[other] # <<<<<<<<<<<<<< + * + * bonding[atom].insert(other) + */ + __pyx_v_other = (__pyx_v_ix_to_rel[__pyx_v_other]); + + /* "MDAnalysis/lib/_cutil.pyx":232 + * other = ix_to_rel[other] + * + * bonding[atom].insert(other) # <<<<<<<<<<<<<< + * bonding[other].insert(atom) + * + */ + try { + (__pyx_v_bonding[__pyx_v_atom]).insert(__pyx_v_other); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 232, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":233 + * + * bonding[atom].insert(other) + * bonding[other].insert(atom) # <<<<<<<<<<<<<< + * + * oldpos = atomgroup.positions + */ + try { + (__pyx_v_bonding[__pyx_v_other]).insert(__pyx_v_atom); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 233, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":228 + * other = bonds[i, 1] + * # only add bonds if both atoms are in atoms set + * if ix_to_rel.count(atom) and ix_to_rel.count(other): # <<<<<<<<<<<<<< + * atom = ix_to_rel[atom] + * other = ix_to_rel[other] + */ + } + } + + /* "MDAnalysis/lib/_cutil.pyx":235 + * bonding[other].insert(atom) + * + * oldpos = atomgroup.positions # <<<<<<<<<<<<<< + * newpos = np.zeros((oldpos.shape[0], 3), dtype=np.float32) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_atomgroup, __pyx_n_s_positions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_29 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_29.memview)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_oldpos = __pyx_t_29; + __pyx_t_29.memview = NULL; + __pyx_t_29.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":236 + * + * oldpos = atomgroup.positions + * newpos = np.zeros((oldpos.shape[0], 3), dtype=np.float32) # <<<<<<<<<<<<<< + * + * refpoints = intset() # Who is safe to use as reference point? + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_oldpos.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_int_3); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15); + __pyx_t_15 = 0; + __pyx_t_15 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_29 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_29.memview)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_newpos = __pyx_t_29; + __pyx_t_29.memview = NULL; + __pyx_t_29.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":238 + * newpos = np.zeros((oldpos.shape[0], 3), dtype=np.float32) + * + * refpoints = intset() # Who is safe to use as reference point? # <<<<<<<<<<<<<< + * done = intset() # Who have I already searched around? + * # initially we have one starting atom whose position is in correct image + */ + try { + __pyx_t_30 = __pyx_t_10MDAnalysis_3lib_6_cutil_intset(); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 238, __pyx_L1_error) + } + __pyx_v_refpoints = __pyx_t_30; + + /* "MDAnalysis/lib/_cutil.pyx":239 + * + * refpoints = intset() # Who is safe to use as reference point? + * done = intset() # Who have I already searched around? # <<<<<<<<<<<<<< + * # initially we have one starting atom whose position is in correct image + * refpoints.insert(ref) + */ + try { + __pyx_t_30 = __pyx_t_10MDAnalysis_3lib_6_cutil_intset(); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 239, __pyx_L1_error) + } + __pyx_v_done = __pyx_t_30; + + /* "MDAnalysis/lib/_cutil.pyx":241 + * done = intset() # Who have I already searched around? + * # initially we have one starting atom whose position is in correct image + * refpoints.insert(ref) # <<<<<<<<<<<<<< + * for i in range(3): + * newpos[ref, i] = oldpos[ref, i] + */ + try { + __pyx_v_refpoints.insert(__pyx_v_ref); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 241, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":242 + * # initially we have one starting atom whose position is in correct image + * refpoints.insert(ref) + * for i in range(3): # <<<<<<<<<<<<<< + * newpos[ref, i] = oldpos[ref, i] + * + */ + for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":243 + * refpoints.insert(ref) + * for i in range(3): + * newpos[ref, i] = oldpos[ref, i] # <<<<<<<<<<<<<< + * + * nloops = 0 + */ + __pyx_t_31 = __pyx_v_ref; + __pyx_t_32 = __pyx_v_i; + __pyx_t_33 = __pyx_v_ref; + __pyx_t_34 = __pyx_v_i; + *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_newpos.data + __pyx_t_33 * __pyx_v_newpos.strides[0]) ) + __pyx_t_34 * __pyx_v_newpos.strides[1]) )) = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oldpos.data + __pyx_t_31 * __pyx_v_oldpos.strides[0]) ) + __pyx_t_32 * __pyx_v_oldpos.strides[1]) ))); + } + + /* "MDAnalysis/lib/_cutil.pyx":245 + * newpos[ref, i] = oldpos[ref, i] + * + * nloops = 0 # <<<<<<<<<<<<<< + * while refpoints.size() < natoms and nloops < natoms: + * # count iterations to prevent infinite loop here + */ + __pyx_v_nloops = 0; + + /* "MDAnalysis/lib/_cutil.pyx":246 + * + * nloops = 0 + * while refpoints.size() < natoms and nloops < natoms: # <<<<<<<<<<<<<< + * # count iterations to prevent infinite loop here + * nloops += 1 + */ + while (1) { + __pyx_t_9 = ((__pyx_v_refpoints.size() < __pyx_v_natoms) != 0); + if (__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L33_bool_binop_done; + } + __pyx_t_9 = ((__pyx_v_nloops < __pyx_v_natoms) != 0); + __pyx_t_8 = __pyx_t_9; + __pyx_L33_bool_binop_done:; + if (!__pyx_t_8) break; + + /* "MDAnalysis/lib/_cutil.pyx":248 + * while refpoints.size() < natoms and nloops < natoms: + * # count iterations to prevent infinite loop here + * nloops += 1 # <<<<<<<<<<<<<< + * + * # We want to iterate over atoms that are good to use as reference + */ + __pyx_v_nloops = (__pyx_v_nloops + 1); + + /* "MDAnalysis/lib/_cutil.pyx":252 + * # We want to iterate over atoms that are good to use as reference + * # points, but haven't been searched yet. + * todo = difference(refpoints, done) # <<<<<<<<<<<<<< + * for atom in todo: + * for other in bonding[atom]: + */ + __pyx_v_todo = __pyx_f_10MDAnalysis_3lib_6_cutil_difference(__pyx_v_refpoints, __pyx_v_done); + + /* "MDAnalysis/lib/_cutil.pyx":253 + * # points, but haven't been searched yet. + * todo = difference(refpoints, done) + * for atom in todo: # <<<<<<<<<<<<<< + * for other in bonding[atom]: + * # If other is already a refpoint, leave alone + */ + __pyx_t_35 = __pyx_v_todo.begin(); + for (;;) { + if (!(__pyx_t_35 != __pyx_v_todo.end())) break; + __pyx_t_4 = *__pyx_t_35; + ++__pyx_t_35; + __pyx_v_atom = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":254 + * todo = difference(refpoints, done) + * for atom in todo: + * for other in bonding[atom]: # <<<<<<<<<<<<<< + * # If other is already a refpoint, leave alone + * if refpoints.count(other): + */ + __pyx_t_37 = &(__pyx_v_bonding[__pyx_v_atom]); + __pyx_t_36 = __pyx_t_37->begin(); + for (;;) { + if (!(__pyx_t_36 != __pyx_t_37->end())) break; + __pyx_t_4 = *__pyx_t_36; + ++__pyx_t_36; + __pyx_v_other = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":256 + * for other in bonding[atom]: + * # If other is already a refpoint, leave alone + * if refpoints.count(other): # <<<<<<<<<<<<<< + * continue + * # Draw vector from atom to other + */ + __pyx_t_8 = (__pyx_v_refpoints.count(__pyx_v_other) != 0); + if (__pyx_t_8) { + + /* "MDAnalysis/lib/_cutil.pyx":257 + * # If other is already a refpoint, leave alone + * if refpoints.count(other): + * continue # <<<<<<<<<<<<<< + * # Draw vector from atom to other + * for i in range(3): + */ + goto __pyx_L37_continue; + + /* "MDAnalysis/lib/_cutil.pyx":256 + * for other in bonding[atom]: + * # If other is already a refpoint, leave alone + * if refpoints.count(other): # <<<<<<<<<<<<<< + * continue + * # Draw vector from atom to other + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":259 + * continue + * # Draw vector from atom to other + * for i in range(3): # <<<<<<<<<<<<<< + * vec[i] = oldpos[other, i] - newpos[atom, i] + * # Apply periodic boundary conditions to this vector + */ + for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":260 + * # Draw vector from atom to other + * for i in range(3): + * vec[i] = oldpos[other, i] - newpos[atom, i] # <<<<<<<<<<<<<< + * # Apply periodic boundary conditions to this vector + * if ortho: + */ + __pyx_t_38 = __pyx_v_other; + __pyx_t_39 = __pyx_v_i; + __pyx_t_40 = __pyx_v_atom; + __pyx_t_41 = __pyx_v_i; + (__pyx_v_vec[__pyx_v_i]) = ((*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_oldpos.data + __pyx_t_38 * __pyx_v_oldpos.strides[0]) ) + __pyx_t_39 * __pyx_v_oldpos.strides[1]) ))) - (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_newpos.data + __pyx_t_40 * __pyx_v_newpos.strides[0]) ) + __pyx_t_41 * __pyx_v_newpos.strides[1]) )))); + } + + /* "MDAnalysis/lib/_cutil.pyx":262 + * vec[i] = oldpos[other, i] - newpos[atom, i] + * # Apply periodic boundary conditions to this vector + * if ortho: # <<<<<<<<<<<<<< + * minimum_image(&vec[0], &box[0], &inverse_box[0]) + * else: + */ + __pyx_t_8 = (__pyx_v_ortho != 0); + if (__pyx_t_8) { + + /* "MDAnalysis/lib/_cutil.pyx":263 + * # Apply periodic boundary conditions to this vector + * if ortho: + * minimum_image(&vec[0], &box[0], &inverse_box[0]) # <<<<<<<<<<<<<< + * else: + * minimum_image_triclinic(&vec[0], &tri_box[0]) + */ + __pyx_t_42 = 0; + minimum_image((&(__pyx_v_vec[0])), (&(*((float *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_42 * __pyx_v_box.strides[0]) )))), (&(__pyx_v_inverse_box[0]))); + + /* "MDAnalysis/lib/_cutil.pyx":262 + * vec[i] = oldpos[other, i] - newpos[atom, i] + * # Apply periodic boundary conditions to this vector + * if ortho: # <<<<<<<<<<<<<< + * minimum_image(&vec[0], &box[0], &inverse_box[0]) + * else: + */ + goto __pyx_L42; + } + + /* "MDAnalysis/lib/_cutil.pyx":265 + * minimum_image(&vec[0], &box[0], &inverse_box[0]) + * else: + * minimum_image_triclinic(&vec[0], &tri_box[0]) # <<<<<<<<<<<<<< + * # Then define position of other based on this vector + * for i in range(3): + */ + /*else*/ { + minimum_image_triclinic((&(__pyx_v_vec[0])), ((coordinate *)(&(__pyx_v_tri_box[0])))); + } + __pyx_L42:; + + /* "MDAnalysis/lib/_cutil.pyx":267 + * minimum_image_triclinic(&vec[0], &tri_box[0]) + * # Then define position of other based on this vector + * for i in range(3): # <<<<<<<<<<<<<< + * newpos[other, i] = newpos[atom, i] + vec[i] + * + */ + for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "MDAnalysis/lib/_cutil.pyx":268 + * # Then define position of other based on this vector + * for i in range(3): + * newpos[other, i] = newpos[atom, i] + vec[i] # <<<<<<<<<<<<<< + * + * # This other atom can now be used as a reference point + */ + __pyx_t_43 = __pyx_v_atom; + __pyx_t_44 = __pyx_v_i; + __pyx_t_45 = __pyx_v_other; + __pyx_t_46 = __pyx_v_i; + *((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_newpos.data + __pyx_t_45 * __pyx_v_newpos.strides[0]) ) + __pyx_t_46 * __pyx_v_newpos.strides[1]) )) = ((*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_newpos.data + __pyx_t_43 * __pyx_v_newpos.strides[0]) ) + __pyx_t_44 * __pyx_v_newpos.strides[1]) ))) + (__pyx_v_vec[__pyx_v_i])); + } + + /* "MDAnalysis/lib/_cutil.pyx":271 + * + * # This other atom can now be used as a reference point + * refpoints.insert(other) # <<<<<<<<<<<<<< + * done.insert(atom) + * + */ + try { + __pyx_v_refpoints.insert(__pyx_v_other); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 271, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":254 + * todo = difference(refpoints, done) + * for atom in todo: + * for other in bonding[atom]: # <<<<<<<<<<<<<< + * # If other is already a refpoint, leave alone + * if refpoints.count(other): + */ + __pyx_L37_continue:; + } + + /* "MDAnalysis/lib/_cutil.pyx":272 + * # This other atom can now be used as a reference point + * refpoints.insert(other) + * done.insert(atom) # <<<<<<<<<<<<<< + * + * if refpoints.size() < natoms: + */ + try { + __pyx_v_done.insert(__pyx_v_atom); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 272, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":253 + * # points, but haven't been searched yet. + * todo = difference(refpoints, done) + * for atom in todo: # <<<<<<<<<<<<<< + * for other in bonding[atom]: + * # If other is already a refpoint, leave alone + */ + } + } + + /* "MDAnalysis/lib/_cutil.pyx":274 + * done.insert(atom) + * + * if refpoints.size() < natoms: # <<<<<<<<<<<<<< + * raise ValueError("AtomGroup was not contiguous from bonds, process failed") + * else: + */ + __pyx_t_8 = ((__pyx_v_refpoints.size() < __pyx_v_natoms) != 0); + if (unlikely(__pyx_t_8)) { + + /* "MDAnalysis/lib/_cutil.pyx":275 + * + * if refpoints.size() < natoms: + * raise ValueError("AtomGroup was not contiguous from bonds, process failed") # <<<<<<<<<<<<<< + * else: + * atomgroup.positions = newpos + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 275, __pyx_L1_error) + + /* "MDAnalysis/lib/_cutil.pyx":274 + * done.insert(atom) + * + * if refpoints.size() < natoms: # <<<<<<<<<<<<<< + * raise ValueError("AtomGroup was not contiguous from bonds, process failed") + * else: + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":277 + * raise ValueError("AtomGroup was not contiguous from bonds, process failed") + * else: + * atomgroup.positions = newpos # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_newpos, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_atomgroup, __pyx_n_s_positions, __pyx_t_2) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "MDAnalysis/lib/_cutil.pyx":105 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def make_whole(atomgroup, reference_atom=None): # <<<<<<<<<<<<<< + * """Move all atoms in a single molecule so that bonds don't split over images + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __PYX_XDEC_MEMVIEW(&__pyx_t_22, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1); + __Pyx_AddTraceback("MDAnalysis.lib._cutil.make_whole", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_bonds, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_oldpos, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_newpos, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_box, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_ix_view, 1); + __Pyx_XDECREF(__pyx_v_triclinic_vectors); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/_cutil.pyx":282 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef float _dot(float * a, float * b): # <<<<<<<<<<<<<< + * """Return dot product of two 3d vectors""" + * cdef ssize_t n + */ + +static float __pyx_f_10MDAnalysis_3lib_6_cutil__dot(float *__pyx_v_a, float *__pyx_v_b) { + Py_ssize_t __pyx_v_n; + float __pyx_v_sum1; + float __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __Pyx_RefNannySetupContext("_dot", 0); + + /* "MDAnalysis/lib/_cutil.pyx":287 + * cdef float sum1 + * + * sum1 = 0.0 # <<<<<<<<<<<<<< + * for n in range(3): + * sum1 += a[n] * b[n] + */ + __pyx_v_sum1 = 0.0; + + /* "MDAnalysis/lib/_cutil.pyx":288 + * + * sum1 = 0.0 + * for n in range(3): # <<<<<<<<<<<<<< + * sum1 += a[n] * b[n] + * return sum1 + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_n = __pyx_t_1; + + /* "MDAnalysis/lib/_cutil.pyx":289 + * sum1 = 0.0 + * for n in range(3): + * sum1 += a[n] * b[n] # <<<<<<<<<<<<<< + * return sum1 + * + */ + __pyx_v_sum1 = (__pyx_v_sum1 + ((__pyx_v_a[__pyx_v_n]) * (__pyx_v_b[__pyx_v_n]))); + } + + /* "MDAnalysis/lib/_cutil.pyx":290 + * for n in range(3): + * sum1 += a[n] * b[n] + * return sum1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_sum1; + goto __pyx_L0; + + /* "MDAnalysis/lib/_cutil.pyx":282 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef float _dot(float * a, float * b): # <<<<<<<<<<<<<< + * """Return dot product of two 3d vectors""" + * cdef ssize_t n + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/_cutil.pyx":295 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef void _cross(float * a, float * b, float * result): # <<<<<<<<<<<<<< + * """ + * Calculates the cross product between 3d vectors + */ + +static void __pyx_f_10MDAnalysis_3lib_6_cutil__cross(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_result) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cross", 0); + + /* "MDAnalysis/lib/_cutil.pyx":304 + * """ + * + * result[0] = a[1]*b[2] - a[2]*b[1] # <<<<<<<<<<<<<< + * result[1] = - a[0]*b[2] + a[2]*b[0] + * result[2] = a[0]*b[1] - a[1]*b[0] + */ + (__pyx_v_result[0]) = (((__pyx_v_a[1]) * (__pyx_v_b[2])) - ((__pyx_v_a[2]) * (__pyx_v_b[1]))); + + /* "MDAnalysis/lib/_cutil.pyx":305 + * + * result[0] = a[1]*b[2] - a[2]*b[1] + * result[1] = - a[0]*b[2] + a[2]*b[0] # <<<<<<<<<<<<<< + * result[2] = a[0]*b[1] - a[1]*b[0] + * + */ + (__pyx_v_result[1]) = (((-(__pyx_v_a[0])) * (__pyx_v_b[2])) + ((__pyx_v_a[2]) * (__pyx_v_b[0]))); + + /* "MDAnalysis/lib/_cutil.pyx":306 + * result[0] = a[1]*b[2] - a[2]*b[1] + * result[1] = - a[0]*b[2] + a[2]*b[0] + * result[2] = a[0]*b[1] - a[1]*b[0] # <<<<<<<<<<<<<< + * + * cdef float _norm(float * a): + */ + (__pyx_v_result[2]) = (((__pyx_v_a[0]) * (__pyx_v_b[1])) - ((__pyx_v_a[1]) * (__pyx_v_b[0]))); + + /* "MDAnalysis/lib/_cutil.pyx":295 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * cdef void _cross(float * a, float * b, float * result): # <<<<<<<<<<<<<< + * """ + * Calculates the cross product between 3d vectors + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "MDAnalysis/lib/_cutil.pyx":308 + * result[2] = a[0]*b[1] - a[1]*b[0] + * + * cdef float _norm(float * a): # <<<<<<<<<<<<<< + * """ + * Calculates the magnitude of the vector + */ + +static float __pyx_f_10MDAnalysis_3lib_6_cutil__norm(float *__pyx_v_a) { + float __pyx_v_result; + Py_ssize_t __pyx_v_n; + float __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + __Pyx_RefNannySetupContext("_norm", 0); + + /* "MDAnalysis/lib/_cutil.pyx":314 + * cdef float result + * cdef ssize_t n + * result = 0.0 # <<<<<<<<<<<<<< + * for n in range(3): + * result += a[n]*a[n] + */ + __pyx_v_result = 0.0; + + /* "MDAnalysis/lib/_cutil.pyx":315 + * cdef ssize_t n + * result = 0.0 + * for n in range(3): # <<<<<<<<<<<<<< + * result += a[n]*a[n] + * return sqrt(result) + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_n = __pyx_t_1; + + /* "MDAnalysis/lib/_cutil.pyx":316 + * result = 0.0 + * for n in range(3): + * result += a[n]*a[n] # <<<<<<<<<<<<<< + * return sqrt(result) + * + */ + __pyx_v_result = (__pyx_v_result + ((__pyx_v_a[__pyx_v_n]) * (__pyx_v_a[__pyx_v_n]))); + } + + /* "MDAnalysis/lib/_cutil.pyx":317 + * for n in range(3): + * result += a[n]*a[n] + * return sqrt(result) # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = sqrt(__pyx_v_result); + goto __pyx_L0; + + /* "MDAnalysis/lib/_cutil.pyx":308 + * result[2] = a[0]*b[1] - a[1]*b[0] + * + * cdef float _norm(float * a): # <<<<<<<<<<<<<< + * """ + * Calculates the magnitude of the vector + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/_cutil.pyx":322 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def find_fragments(atoms, bondlist): # <<<<<<<<<<<<<< + * """Calculate distinct fragments from nodes (atom indices) and edges (pairs + * of atom indices). + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6_cutil_5find_fragments(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6_cutil_4find_fragments[] = "Calculate distinct fragments from nodes (atom indices) and edges (pairs\n of atom indices).\n\n Parameters\n ----------\n atoms : array_like\n 1-D Array of atom indices (dtype will be converted to ``numpy.int64``\n internally)\n bonds : array_like\n 2-D array of bonds (dtype will be converted to ``numpy.int32``\n internally), where ``bonds[i, 0]`` and ``bonds[i, 1]`` are the\n indices of atoms connected by the ``i``-th bond. Any bonds referring to\n atom indices not in `atoms` will be ignored.\n\n Returns\n -------\n fragments : list\n List of arrays, each containing the atom indices of a fragment.\n\n .. versionaddded:: 0.19.0\n "; +static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_6_cutil_5find_fragments = {"find_fragments", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6_cutil_5find_fragments, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_6_cutil_4find_fragments}; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6_cutil_5find_fragments(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_atoms = 0; + PyObject *__pyx_v_bondlist = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("find_fragments (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_atoms,&__pyx_n_s_bondlist,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atoms)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bondlist)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("find_fragments", 1, 2, 2, 1); __PYX_ERR(0, 322, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_fragments") < 0)) __PYX_ERR(0, 322, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_atoms = values[0]; + __pyx_v_bondlist = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("find_fragments", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 322, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib._cutil.find_fragments", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6_cutil_4find_fragments(__pyx_self, __pyx_v_atoms, __pyx_v_bondlist); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6_cutil_4find_fragments(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_atoms, PyObject *__pyx_v_bondlist) { + __pyx_t_10MDAnalysis_3lib_6_cutil_intmap __pyx_v_bondmap; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_todo; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_frag_todo; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset __pyx_v_frag_done; + std::vector __pyx_v_this_frag; + int __pyx_v_i; + int __pyx_v_a; + int __pyx_v_b; + __Pyx_memviewslice __pyx_v_atoms_view = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_bonds_view = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_v_frags = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + int __pyx_t_16; + int __pyx_t_17; + std::set ::iterator __pyx_t_18; + __pyx_t_10MDAnalysis_3lib_6_cutil_intset *__pyx_t_19; + int __pyx_t_20; + __Pyx_RefNannySetupContext("find_fragments", 0); + + /* "MDAnalysis/lib/_cutil.pyx":351 + * cdef np.int32_t[:, :] bonds_view + * + * atoms_view = np.asarray(atoms, dtype=np.int64) # <<<<<<<<<<<<<< + * bonds_view = np.asarray(bondlist, dtype=np.int32) + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_atoms); + __Pyx_GIVEREF(__pyx_v_atoms); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_atoms); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_atoms_view = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":352 + * + * atoms_view = np.asarray(atoms, dtype=np.int64) + * bonds_view = np.asarray(bondlist, dtype=np.int32) # <<<<<<<<<<<<<< + * + * # grab record of which atoms I have to process + */ + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_bondlist); + __Pyx_GIVEREF(__pyx_v_bondlist); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_bondlist); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_bonds_view = __pyx_t_7; + __pyx_t_7.memview = NULL; + __pyx_t_7.data = NULL; + + /* "MDAnalysis/lib/_cutil.pyx":356 + * # grab record of which atoms I have to process + * # ie set of all nodes + * for i in range(atoms_view.shape[0]): # <<<<<<<<<<<<<< + * todo.insert(atoms_view[i]) + * # Process edges into map + */ + __pyx_t_8 = (__pyx_v_atoms_view.shape[0]); + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "MDAnalysis/lib/_cutil.pyx":357 + * # ie set of all nodes + * for i in range(atoms_view.shape[0]): + * todo.insert(atoms_view[i]) # <<<<<<<<<<<<<< + * # Process edges into map + * for i in range(bonds_view.shape[0]): + */ + __pyx_t_11 = __pyx_v_i; + try { + __pyx_v_todo.insert((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_atoms_view.data + __pyx_t_11 * __pyx_v_atoms_view.strides[0]) )))); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 357, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/_cutil.pyx":359 + * todo.insert(atoms_view[i]) + * # Process edges into map + * for i in range(bonds_view.shape[0]): # <<<<<<<<<<<<<< + * a = bonds_view[i, 0] + * b = bonds_view[i, 1] + */ + __pyx_t_8 = (__pyx_v_bonds_view.shape[0]); + __pyx_t_9 = __pyx_t_8; + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { + __pyx_v_i = __pyx_t_10; + + /* "MDAnalysis/lib/_cutil.pyx":360 + * # Process edges into map + * for i in range(bonds_view.shape[0]): + * a = bonds_view[i, 0] # <<<<<<<<<<<<<< + * b = bonds_view[i, 1] + * # only include edges if both are known nodes + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = 0; + __pyx_v_a = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_bonds_view.data + __pyx_t_12 * __pyx_v_bonds_view.strides[0]) ) + __pyx_t_13 * __pyx_v_bonds_view.strides[1]) ))); + + /* "MDAnalysis/lib/_cutil.pyx":361 + * for i in range(bonds_view.shape[0]): + * a = bonds_view[i, 0] + * b = bonds_view[i, 1] # <<<<<<<<<<<<<< + * # only include edges if both are known nodes + * if todo.count(a) and todo.count(b): + */ + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = 1; + __pyx_v_b = (*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_bonds_view.data + __pyx_t_14 * __pyx_v_bonds_view.strides[0]) ) + __pyx_t_15 * __pyx_v_bonds_view.strides[1]) ))); + + /* "MDAnalysis/lib/_cutil.pyx":363 + * b = bonds_view[i, 1] + * # only include edges if both are known nodes + * if todo.count(a) and todo.count(b): # <<<<<<<<<<<<<< + * bondmap[a].insert(b) + * bondmap[b].insert(a) + */ + __pyx_t_17 = (__pyx_v_todo.count(__pyx_v_a) != 0); + if (__pyx_t_17) { + } else { + __pyx_t_16 = __pyx_t_17; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_17 = (__pyx_v_todo.count(__pyx_v_b) != 0); + __pyx_t_16 = __pyx_t_17; + __pyx_L8_bool_binop_done:; + if (__pyx_t_16) { + + /* "MDAnalysis/lib/_cutil.pyx":364 + * # only include edges if both are known nodes + * if todo.count(a) and todo.count(b): + * bondmap[a].insert(b) # <<<<<<<<<<<<<< + * bondmap[b].insert(a) + * + */ + try { + (__pyx_v_bondmap[__pyx_v_a]).insert(__pyx_v_b); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 364, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":365 + * if todo.count(a) and todo.count(b): + * bondmap[a].insert(b) + * bondmap[b].insert(a) # <<<<<<<<<<<<<< + * + * frags = [] + */ + try { + (__pyx_v_bondmap[__pyx_v_b]).insert(__pyx_v_a); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 365, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":363 + * b = bonds_view[i, 1] + * # only include edges if both are known nodes + * if todo.count(a) and todo.count(b): # <<<<<<<<<<<<<< + * bondmap[a].insert(b) + * bondmap[b].insert(a) + */ + } + } + + /* "MDAnalysis/lib/_cutil.pyx":367 + * bondmap[b].insert(a) + * + * frags = [] # <<<<<<<<<<<<<< + * + * while not todo.empty(): # While not all nodes have been done + */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_frags = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":369 + * frags = [] + * + * while not todo.empty(): # While not all nodes have been done # <<<<<<<<<<<<<< + * # Start a new fragment + * frag_todo.clear() + */ + while (1) { + __pyx_t_16 = ((!(__pyx_v_todo.empty() != 0)) != 0); + if (!__pyx_t_16) break; + + /* "MDAnalysis/lib/_cutil.pyx":371 + * while not todo.empty(): # While not all nodes have been done + * # Start a new fragment + * frag_todo.clear() # <<<<<<<<<<<<<< + * frag_done.clear() + * this_frag.clear() + */ + __pyx_v_frag_todo.clear(); + + /* "MDAnalysis/lib/_cutil.pyx":372 + * # Start a new fragment + * frag_todo.clear() + * frag_done.clear() # <<<<<<<<<<<<<< + * this_frag.clear() + * # Grab a start point for next fragment + */ + __pyx_v_frag_done.clear(); + + /* "MDAnalysis/lib/_cutil.pyx":373 + * frag_todo.clear() + * frag_done.clear() + * this_frag.clear() # <<<<<<<<<<<<<< + * # Grab a start point for next fragment + * frag_todo.insert(deref(todo.begin())) + */ + __pyx_v_this_frag.clear(); + + /* "MDAnalysis/lib/_cutil.pyx":375 + * this_frag.clear() + * # Grab a start point for next fragment + * frag_todo.insert(deref(todo.begin())) # <<<<<<<<<<<<<< + * + * # Loop until fragment fully explored + */ + try { + __pyx_v_frag_todo.insert((*__pyx_v_todo.begin())); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 375, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":378 + * + * # Loop until fragment fully explored + * while not frag_todo.empty(): # <<<<<<<<<<<<<< + * # Pop next in this frag todo + * a = deref(frag_todo.begin()) + */ + while (1) { + __pyx_t_16 = ((!(__pyx_v_frag_todo.empty() != 0)) != 0); + if (!__pyx_t_16) break; + + /* "MDAnalysis/lib/_cutil.pyx":380 + * while not frag_todo.empty(): + * # Pop next in this frag todo + * a = deref(frag_todo.begin()) # <<<<<<<<<<<<<< + * frag_todo.erase(a) + * if not frag_done.count(a): + */ + __pyx_v_a = (*__pyx_v_frag_todo.begin()); + + /* "MDAnalysis/lib/_cutil.pyx":381 + * # Pop next in this frag todo + * a = deref(frag_todo.begin()) + * frag_todo.erase(a) # <<<<<<<<<<<<<< + * if not frag_done.count(a): + * this_frag.push_back(a) + */ + (void)(__pyx_v_frag_todo.erase(__pyx_v_a)); + + /* "MDAnalysis/lib/_cutil.pyx":382 + * a = deref(frag_todo.begin()) + * frag_todo.erase(a) + * if not frag_done.count(a): # <<<<<<<<<<<<<< + * this_frag.push_back(a) + * frag_done.insert(a) + */ + __pyx_t_16 = ((!(__pyx_v_frag_done.count(__pyx_v_a) != 0)) != 0); + if (__pyx_t_16) { + + /* "MDAnalysis/lib/_cutil.pyx":383 + * frag_todo.erase(a) + * if not frag_done.count(a): + * this_frag.push_back(a) # <<<<<<<<<<<<<< + * frag_done.insert(a) + * todo.erase(a) + */ + try { + __pyx_v_this_frag.push_back(__pyx_v_a); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 383, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":384 + * if not frag_done.count(a): + * this_frag.push_back(a) + * frag_done.insert(a) # <<<<<<<<<<<<<< + * todo.erase(a) + * for b in bondmap[a]: + */ + try { + __pyx_v_frag_done.insert(__pyx_v_a); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 384, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":385 + * this_frag.push_back(a) + * frag_done.insert(a) + * todo.erase(a) # <<<<<<<<<<<<<< + * for b in bondmap[a]: + * if not frag_done.count(b): + */ + (void)(__pyx_v_todo.erase(__pyx_v_a)); + + /* "MDAnalysis/lib/_cutil.pyx":386 + * frag_done.insert(a) + * todo.erase(a) + * for b in bondmap[a]: # <<<<<<<<<<<<<< + * if not frag_done.count(b): + * frag_todo.insert(b) + */ + __pyx_t_19 = &(__pyx_v_bondmap[__pyx_v_a]); + __pyx_t_18 = __pyx_t_19->begin(); + for (;;) { + if (!(__pyx_t_18 != __pyx_t_19->end())) break; + __pyx_t_10 = *__pyx_t_18; + ++__pyx_t_18; + __pyx_v_b = __pyx_t_10; + + /* "MDAnalysis/lib/_cutil.pyx":387 + * todo.erase(a) + * for b in bondmap[a]: + * if not frag_done.count(b): # <<<<<<<<<<<<<< + * frag_todo.insert(b) + * + */ + __pyx_t_16 = ((!(__pyx_v_frag_done.count(__pyx_v_b) != 0)) != 0); + if (__pyx_t_16) { + + /* "MDAnalysis/lib/_cutil.pyx":388 + * for b in bondmap[a]: + * if not frag_done.count(b): + * frag_todo.insert(b) # <<<<<<<<<<<<<< + * + * # Add fragment to output + */ + try { + __pyx_v_frag_todo.insert(__pyx_v_b); + } catch(...) { + __Pyx_CppExn2PyErr(); + __PYX_ERR(0, 388, __pyx_L1_error) + } + + /* "MDAnalysis/lib/_cutil.pyx":387 + * todo.erase(a) + * for b in bondmap[a]: + * if not frag_done.count(b): # <<<<<<<<<<<<<< + * frag_todo.insert(b) + * + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":386 + * frag_done.insert(a) + * todo.erase(a) + * for b in bondmap[a]: # <<<<<<<<<<<<<< + * if not frag_done.count(b): + * frag_todo.insert(b) + */ + } + + /* "MDAnalysis/lib/_cutil.pyx":382 + * a = deref(frag_todo.begin()) + * frag_todo.erase(a) + * if not frag_done.count(a): # <<<<<<<<<<<<<< + * this_frag.push_back(a) + * frag_done.insert(a) + */ + } + } + + /* "MDAnalysis/lib/_cutil.pyx":391 + * + * # Add fragment to output + * frags.append(np.asarray(this_frag)) # <<<<<<<<<<<<<< + * + * return frags + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_convert_vector_to_py_int(__pyx_v_this_frag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_3) { + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_frags, __pyx_t_4); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "MDAnalysis/lib/_cutil.pyx":393 + * frags.append(np.asarray(this_frag)) + * + * return frags # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_frags); + __pyx_r = __pyx_v_frags; + goto __pyx_L0; + + /* "MDAnalysis/lib/_cutil.pyx":322 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def find_fragments(atoms, bondlist): # <<<<<<<<<<<<<< + * """Calculate distinct fragments from nodes (atom indices) and edges (pairs + * of atom indices). + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); + __Pyx_AddTraceback("MDAnalysis.lib._cutil.find_fragments", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_atoms_view, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_bonds_view, 1); + __Pyx_XDECREF(__pyx_v_frags); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fulfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * + * cdef int i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + * cdef int i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 229, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 233, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + * # This is allocated as one block, strides first. + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L9; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L9:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset + */ + __pyx_v_f = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * cdef int offset + * + * info.obj = self # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(descr): + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self + * + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L15_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L14_bool_binop_done; + } + __pyx_L15_next_or:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L14_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 263, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 282, __pyx_L1_error) + break; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self + * + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + * return + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format = PyObject_Malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) + __pyx_v_f = __pyx_t_8; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fulfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * PyObject_Free(info.strides) + */ + PyObject_Free(__pyx_v_info->format); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * PyObject_Free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * PyObject_Free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + PyObject_Free(__pyx_v_info->strides); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * PyObject_Free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + * 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 */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + * 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 */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * return () + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(1, 805, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 805, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 806, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 806, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 807, __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_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 807, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 807, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 810, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L7_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 814, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 834, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 844, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 848, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 848, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 849, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 849, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 852, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 852, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(__pyx_t_6)) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 855, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 860, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * return () + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + /*else*/ { + Py_INCREF(__pyx_v_base); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 998, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 999, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1000, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1004, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1005, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1006, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1006, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1010, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1011, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1012, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(1, 1012, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py_float") + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: + */ + +static int __Pyx_carray_from_py_float(PyObject *__pyx_v_o, float *__pyx_v_v, Py_ssize_t __pyx_v_length) { + Py_ssize_t __pyx_v_i; + PyObject *__pyx_v_item = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + float __pyx_t_11; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py_float", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py_float") + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length # <<<<<<<<<<<<<< + * try: + * i = len(o) + */ + __pyx_v_i = __pyx_v_length; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "carray.from_py":80 + * cdef Py_ssize_t i = length + * try: + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass + */ + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "carray.from_py":81 + * try: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); + if (__pyx_t_5) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 84, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } else { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } + } else { + __pyx_t_10 = __pyx_t_9(__pyx_t_7); + if (unlikely(!__pyx_t_10)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 84, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_v_i = __pyx_t_4; + __pyx_t_4 = (__pyx_t_4 + 1); + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: + */ + goto __pyx_L11_break; + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + } + + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< + * else: + * i += 1 # convert index to length + */ + __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_v_item); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 87, __pyx_L1_error) + (__pyx_v_v[__pyx_v_i]) = __pyx_t_11; + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + } + /*else*/ { + + /* "carray.from_py":89 + * v[i] = item + * else: + * i += 1 # convert index to length # <<<<<<<<<<<<<< + * if i == length: + * return 0 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< + * + * PyErr_Format( + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + } + } + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_L11_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + } + + /* "carray.from_py":96 + * IndexError, + * ("too many values found during array assignment, expected %zd" + * if i >= length else # <<<<<<<<<<<<<< + * "not enough values found during array assignment, expected %zd, got %zd"), + * length, i) + */ + if (((__pyx_v_i >= __pyx_v_length) != 0)) { + __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd"); + } else { + __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd"); + } + + /* "carray.from_py":93 + * return 0 + * + * PyErr_Format( # <<<<<<<<<<<<<< + * IndexError, + * ("too many values found during array assignment, expected %zd" + */ + __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py_float") + * cdef int __Pyx_carray_from_py_float(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_float", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __Pyx_carray_from_py_float___5b_3_5d_(PyObject *__pyx_v_o, float (*__pyx_v_v)[3], Py_ssize_t __pyx_v_length) { + Py_ssize_t __pyx_v_i; + PyObject *__pyx_v_item = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + float __pyx_t_11[3]; + char const *__pyx_t_12; + __Pyx_RefNannySetupContext("__Pyx_carray_from_py_float___5b_3_5d_", 0); + + /* "carray.from_py":78 + * @cname("__Pyx_carray_from_py_float___5b_3_5d_") + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length # <<<<<<<<<<<<<< + * try: + * i = len(o) + */ + __pyx_v_i = __pyx_v_length; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "carray.from_py":80 + * cdef Py_ssize_t i = length + * try: + * i = len(o) # <<<<<<<<<<<<<< + * except (TypeError, OverflowError): + * pass + */ + __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 80, __pyx_L3_error) + __pyx_v_i = __pyx_t_4; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "carray.from_py":81 + * try: + * i = len(o) + * except (TypeError, OverflowError): # <<<<<<<<<<<<<< + * pass + * if i == length: + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError); + if (__pyx_t_5) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "carray.from_py":79 + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: + * cdef Py_ssize_t i = length + * try: # <<<<<<<<<<<<<< + * i = len(o) + * except (TypeError, OverflowError): + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + } else { + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 84, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_9)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } else { + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(2, 84, __pyx_L1_error) + #else + __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } + } else { + __pyx_t_10 = __pyx_t_9(__pyx_t_7); + if (unlikely(!__pyx_t_10)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 84, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_v_i = __pyx_t_4; + __pyx_t_4 = (__pyx_t_4 + 1); + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":86 + * for i, item in enumerate(o): + * if i >= length: + * break # <<<<<<<<<<<<<< + * v[i] = item + * else: + */ + goto __pyx_L11_break; + + /* "carray.from_py":85 + * if i == length: + * for i, item in enumerate(o): + * if i >= length: # <<<<<<<<<<<<<< + * break + * v[i] = item + */ + } + + /* "carray.from_py":87 + * if i >= length: + * break + * v[i] = item # <<<<<<<<<<<<<< + * else: + * i += 1 # convert index to length + */ + if (unlikely(__Pyx_carray_from_py_float(__pyx_v_item, __pyx_t_11, 3) < 0)) __PYX_ERR(2, 87, __pyx_L1_error) + memcpy(&((__pyx_v_v[__pyx_v_i])[0]), __pyx_t_11, sizeof((__pyx_v_v[__pyx_v_i])[0]) * (3)); + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + } + /*else*/ { + + /* "carray.from_py":89 + * v[i] = item + * else: + * i += 1 # convert index to length # <<<<<<<<<<<<<< + * if i == length: + * return 0 + */ + __pyx_v_i = (__pyx_v_i + 1); + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0); + if (__pyx_t_6) { + + /* "carray.from_py":91 + * i += 1 # convert index to length + * if i == length: + * return 0 # <<<<<<<<<<<<<< + * + * PyErr_Format( + */ + __pyx_r = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L0; + + /* "carray.from_py":90 + * else: + * i += 1 # convert index to length + * if i == length: # <<<<<<<<<<<<<< + * return 0 + * + */ + } + } + + /* "carray.from_py":84 + * pass + * if i == length: + * for i, item in enumerate(o): # <<<<<<<<<<<<<< + * if i >= length: + * break + */ + __pyx_L11_break:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":83 + * except (TypeError, OverflowError): + * pass + * if i == length: # <<<<<<<<<<<<<< + * for i, item in enumerate(o): + * if i >= length: + */ + } + + /* "carray.from_py":96 + * IndexError, + * ("too many values found during array assignment, expected %zd" + * if i >= length else # <<<<<<<<<<<<<< + * "not enough values found during array assignment, expected %zd, got %zd"), + * length, i) + */ + if (((__pyx_v_i >= __pyx_v_length) != 0)) { + __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd"); + } else { + __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd"); + } + + /* "carray.from_py":93 + * return 0 + * + * PyErr_Format( # <<<<<<<<<<<<<< + * IndexError, + * ("too many values found during array assignment, expected %zd" + */ + __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "carray.from_py":77 + * + * @cname("__Pyx_carray_from_py_float___5b_3_5d_") + * cdef int __Pyx_carray_from_py_float___5b_3_5d_(object o, base_type *v, Py_ssize_t length) except -1: # <<<<<<<<<<<<<< + * cdef Py_ssize_t i = length + * try: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_float___5b_3_5d_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + +static PyObject *__pyx_convert_vector_to_py_int(const std::vector &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_int") + * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 121, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 121, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 121, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error) + } else { + + /* "View.MemoryView":122 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 121, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 121, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 121, __pyx_L1_error) + } + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":128 + * 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()"); + __PYX_ERR(2, 128, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 128, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":129 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":131 + * 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":132 + * + * 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__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 132, __pyx_L1_error) + + /* "View.MemoryView":131 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":134 + * 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":135 + * + * 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__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 135, __pyx_L1_error) + + /* "View.MemoryView":134 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":137 + * 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_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":138 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":137 + * 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 + */ + } + + /* "View.MemoryView":139 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(2, 139, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":140 + * 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"); + __PYX_ERR(2, 140, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 140, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":143 + * + * + * 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":144 + * + * 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":146 + * 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":147 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 147, __pyx_L1_error) + + /* "View.MemoryView":146 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":150 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_7 = 0; + __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 150, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_dim = __pyx_t_8; + __pyx_v_idx = __pyx_t_7; + __pyx_t_7 = (__pyx_t_7 + 1); + + /* "View.MemoryView":151 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":152 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __pyx_t_3 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(2, 152, __pyx_L1_error) + + /* "View.MemoryView":151 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":153 + * 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":150 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "View.MemoryView":156 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 156, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":157 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":158 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + + /* "View.MemoryView":156 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":159 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 159, __pyx_L1_error) + if (likely(__pyx_t_4)) { + + /* "View.MemoryView":160 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":161 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + + /* "View.MemoryView":159 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":163 + * 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*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(2, 163, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":165 + * 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":168 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":169 + * + * 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, 169, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":170 + * 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":173 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":174 + * + * 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)) { + + /* "View.MemoryView":175 + * 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__19, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(2, 175, __pyx_L1_error) + + /* "View.MemoryView":174 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":177 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":178 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":179 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(2, 179, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(2, 179, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize); + __pyx_t_8 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "View.MemoryView":180 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":181 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":177 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":170 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":184 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":185 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":186 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 186, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":187 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":186 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":188 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 188, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":189 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":188 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":190 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":191 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 191, __pyx_L1_error) + + /* "View.MemoryView":190 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":192 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":193 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":194 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":195 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":196 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":197 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":198 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":199 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":201 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":202 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + + /* "View.MemoryView":201 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":204 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":206 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":184 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":210 + * __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) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":211 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":212 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + + /* "View.MemoryView":211 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":213 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":215 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + + /* "View.MemoryView":214 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":217 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) + * + */ + free(__pyx_v_self->data); + + /* "View.MemoryView":213 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":218 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":210 + * __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) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":221 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":222 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":221 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":225 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":226 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":227 + * 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); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":225 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":229 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":230 + * + * def __len__(self): + * return self._shape[0] # <<<<<<<<<<<<<< + * + * def __getattr__(self, attr): + */ + __pyx_r = (__pyx_v_self->_shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":229 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":232 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":233 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":232 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":235 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":236 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":235 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":238 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":239 + * + * 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, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":238 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":243 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":247 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":248 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":247 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":250 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":251 + * else: + * 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, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 251, __pyx_L1_error) + + /* "View.MemoryView":250 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":252 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":254 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":243 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":280 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 280, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 280, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":281 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":280 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":282 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":283 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":282 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.name,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->name); + __Pyx_GIVEREF(__pyx_v_self->name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = self.name is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":11 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":15 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":297 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":299 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "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":303 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":305 + * 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":306 + * + * 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":305 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":308 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":297 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":344 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 344, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 344, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 344, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 344, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 344, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":345 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":346 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":347 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_obj != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":348 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 348, __pyx_L1_error) + + /* "View.MemoryView":349 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":350 + * __Pyx_GetBuffer(obj, &self.view, flags) + * 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; + + /* "View.MemoryView":351 + * 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); + + /* "View.MemoryView":349 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + } + + /* "View.MemoryView":347 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + } + + /* "View.MemoryView":354 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":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] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":356 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":354 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":357 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":358 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":359 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":360 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(2, 360, __pyx_L1_error) + + /* "View.MemoryView":359 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":357 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":362 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":363 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_self->dtype_is_object = __pyx_t_1; + + /* "View.MemoryView":362 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":365 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":367 + * 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 + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":369 + * 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":344 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":371 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyThread_type_lock __pyx_t_6; + PyThread_type_lock __pyx_t_7; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":372 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":373 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * + * cdef int i + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + + /* "View.MemoryView":372 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":377 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":378 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":379 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":381 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":382 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; + + /* "View.MemoryView":381 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":384 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":379 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":386 + * 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); + } + __pyx_L6_break:; + + /* "View.MemoryView":377 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":371 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":388 + * 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 + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":390 + * 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":392 + * 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)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 392, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 392, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(2, 392, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 392, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":393 + * + * 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, 393, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 393, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":392 + * 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":395 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":388 + * 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 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":398 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":399 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":400 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "View.MemoryView":399 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":402 + * 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, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 402, __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_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 402, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":405 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 405, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":406 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":405 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":408 + * return memview_slice(self, indices) + * 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, 408, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":409 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":398 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":411 + * 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") + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":412 + * + * 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)) { + + /* "View.MemoryView":413 + * 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__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 413, __pyx_L1_error) + + /* "View.MemoryView":412 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + } + + /* "View.MemoryView":415 + * 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, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 415, __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_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 415, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":417 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 417, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":418 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_obj = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":419 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 419, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":420 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":419 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":422 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 422, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "View.MemoryView":417 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":424 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * 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") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":426 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":427 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":429 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":430 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 430, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":429 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":431 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 431, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":432 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":427 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":434 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":426 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":436 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":440 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 440, __pyx_L1_error) + + /* "View.MemoryView":441 + * + * 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, 441, __pyx_L1_error) + + /* "View.MemoryView":442 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":440 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 440, __pyx_L1_error) + + /* "View.MemoryView":436 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":444 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":446 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":451 + * 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_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + + /* "View.MemoryView":453 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":454 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":455 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":456 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(2, 456, __pyx_L1_error) + + /* "View.MemoryView":455 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":457 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":453 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":459 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":461 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":462 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":463 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + + /* "View.MemoryView":462 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":465 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 465, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":469 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":470 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 470, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":469 + * + * + * 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, + */ + } + + /* "View.MemoryView":471 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":474 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":444 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":476 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":477 + * + * 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, 477, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":478 + * 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, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":476 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":480 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":483 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":486 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":488 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":492 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":493 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":492 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":494 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":489 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 489, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); + __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 489, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":490 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 490, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(2, 490, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":480 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":496 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + char *__pyx_t_12; + char *__pyx_t_13; + char *__pyx_t_14; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":499 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":504 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":505 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 505, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":504 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":507 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(2, 507, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":509 + * 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)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(2, 509, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_10 = __pyx_v_bytesvalue; + __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); + __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); + for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { + __pyx_t_11 = __pyx_t_14; + __pyx_v_c = (__pyx_t_11[0]); + + /* "View.MemoryView":510 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":509 + * 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":510 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "View.MemoryView":496 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":513 + * + * @cname('getbuffer') + * 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") + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + char *__pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":514 + * @cname('getbuffer') + * 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) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->view.readonly != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":515 + * 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_STRIDES: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 515, __pyx_L1_error) + + /* "View.MemoryView":514 + * @cname('getbuffer') + * 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":517 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":518 + * + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_4 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_4; + + /* "View.MemoryView":517 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":520 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":522 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":523 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_4 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_4; + + /* "View.MemoryView":522 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L7; + } + + /* "View.MemoryView":525 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L7:; + + /* "View.MemoryView":527 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":528 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_4 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_4; + + /* "View.MemoryView":527 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":530 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L8:; + + /* "View.MemoryView":532 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":533 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_5 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_5; + + /* "View.MemoryView":532 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":535 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L9:; + + /* "View.MemoryView":537 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_6 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_6; + + /* "View.MemoryView":538 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_7 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_7; + + /* "View.MemoryView":539 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = self.view.readonly + */ + __pyx_t_8 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_8; + + /* "View.MemoryView":540 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = self.view.readonly + * info.obj = self + */ + __pyx_t_8 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_8; + + /* "View.MemoryView":541 + * info.itemsize = self.view.itemsize + * 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; + + /* "View.MemoryView":542 + * 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)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":513 + * + * @cname('getbuffer') + * 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") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":548 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":549 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 549, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":550 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 550, __pyx_L1_error) + + /* "View.MemoryView":551 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":548 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":554 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":555 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":554 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":558 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":559 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":558 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":562 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_stride; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":563 + * @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); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":565 + * 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__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 565, __pyx_L1_error) + + /* "View.MemoryView":563 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":567 + * 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); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":570 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + Py_ssize_t *__pyx_t_6; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":571 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":572 + * 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); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__27, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":571 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":574 + * return (-1,) * self.view.ndim + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":570 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":577 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":578 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":577 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":581 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":582 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":581 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":585 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":586 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":585 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":589 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":590 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":591 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":593 + * 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++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":594 + * + * 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, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":596 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + + /* "View.MemoryView":590 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":598 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":589 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":600 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":601 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":602 + * 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":601 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":604 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":600 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":606 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":607 + * + * 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, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":608 + * 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, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "View.MemoryView":607 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":606 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":610 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":611 + * + * 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, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":610 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":614 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":617 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":618 + * 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); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":614 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":620 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":623 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":624 + * 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); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":620 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":626 + * 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 + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":628 + * 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":630 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":631 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 631, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":636 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":626 + * 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 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":638 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":640 + * 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":642 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":643 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 643, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":648 + * 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, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":638 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":652 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":653 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":654 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":655 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":652 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":658 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":659 + * @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_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":658 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":661 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":666 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":667 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":666 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":669 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":671 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":672 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":673 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":674 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 674, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 674, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 674, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 674, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":675 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":676 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":677 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 677, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__30); + __Pyx_GIVEREF(__pyx_slice__30); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__30); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 677, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":678 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + + /* "View.MemoryView":676 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":680 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__31); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 680, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":681 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + + /* "View.MemoryView":675 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":683 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":684 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(2, 684, __pyx_L1_error) + + /* "View.MemoryView":683 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":686 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + __pyx_t_10 = (__pyx_v_have_slices != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = (__pyx_t_10 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_have_slices = __pyx_t_1; + + /* "View.MemoryView":687 + * + * 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, 687, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":674 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":689 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 689, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":690 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":691 + * 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, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__32); + __Pyx_GIVEREF(__pyx_slice__32); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":690 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":693 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_have_slices) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "View.MemoryView":661 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":695 + * 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: + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":696 + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); + for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { + __pyx_t_1 = __pyx_t_3; + __pyx_v_suboffset = (__pyx_t_1[0]); + + /* "View.MemoryView":697 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":698 + * 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__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(2, 698, __pyx_L1_error) + + /* "View.MemoryView":697 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":695 + * 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: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":705 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":706 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":713 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); + + /* "View.MemoryView":717 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(2, 717, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":719 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":720 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 720, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":721 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + + /* "View.MemoryView":719 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":723 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":724 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":730 + * + * + * 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":731 + * + * 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":736 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":737 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":741 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 741, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 741, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(2, 741, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(2, 741, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":742 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":746 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error) + + /* "View.MemoryView":743 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 743, __pyx_L1_error) + + /* "View.MemoryView":742 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":749 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":750 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":751 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":752 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":753 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + + /* "View.MemoryView":749 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":755 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 755, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 755, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":756 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 756, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 756, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":757 + * 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, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 757, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 757, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":759 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":760 + * + * 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, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":761 + * 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, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":763 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(2, 763, __pyx_L1_error) + + /* "View.MemoryView":769 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + + /* "View.MemoryView":741 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":771 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":772 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":773 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 773, __pyx_L1_error) } + + /* "View.MemoryView":774 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 774, __pyx_L1_error) } + + /* "View.MemoryView":772 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 772, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":771 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":777 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":778 + * 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, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":777 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":705 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":802 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":822 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":824 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":825 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":824 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":826 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":827 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 827, __pyx_L1_error) + + /* "View.MemoryView":826 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":822 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":830 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step < 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __pyx_v_negative_step = __pyx_t_2; + + /* "View.MemoryView":832 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_t_1 = (__pyx_v_have_step != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step == 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L9_bool_binop_done:; + if (__pyx_t_2) { + + /* "View.MemoryView":833 + * + * 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, 833, __pyx_L1_error) + + /* "View.MemoryView":832 + * 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":836 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":837 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":839 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":840 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":839 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":837 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":841 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":842 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":843 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":842 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":845 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":841 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":836 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":847 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":848 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":847 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":850 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":852 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":854 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":855 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":856 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":855 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":853 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":857 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":858 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":857 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":852 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":860 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":861 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":860 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":863 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":865 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":866 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":865 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":870 + * + * 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":872 + * 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":873 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":872 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":875 + * 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":876 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":875 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":879 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":880 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":881 + * 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":884 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":885 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + + /* "View.MemoryView":884 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":887 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":889 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":890 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":891 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":892 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":891 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":894 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + /*else*/ { + + /* "View.MemoryView":895 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 894, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":890 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":897 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":889 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":899 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":802 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":905 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":907 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":908 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":911 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":912 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(2, 912, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(2, 912, __pyx_L1_error) + } + __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize); + + /* "View.MemoryView":913 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":911 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":915 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":916 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":917 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":918 + * 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]); + + /* "View.MemoryView":917 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":920 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":921 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":922 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":923 + * 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, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 923, __pyx_L1_error) + + /* "View.MemoryView":922 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":920 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":925 + * 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":926 + * + * 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, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 926, __pyx_L1_error) + + /* "View.MemoryView":925 + * 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":928 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":929 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":930 + * 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":929 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":932 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":905 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":938 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + + /* "View.MemoryView":939 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":941 + * 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":942 + * + * 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":946 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":947 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":948 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; + + /* "View.MemoryView":949 + * 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]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":951 + * 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) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + if (__pyx_t_7) { + + /* "View.MemoryView":952 + * + * 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, 952, __pyx_L1_error) + + /* "View.MemoryView":951 + * 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":954 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":938 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":971 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":972 + * + * 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":971 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":974 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":975 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":976 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 976, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":975 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":978 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":974 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":980 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":981 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":982 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 982, __pyx_L1_error) + + /* "View.MemoryView":981 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":984 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * @property + */ + /*else*/ { + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":980 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":987 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":988 + * @property + * def base(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":987 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":994 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t *__pyx_t_6; + Py_ssize_t *__pyx_t_7; + Py_ssize_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":1002 + * 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":1003 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "View.MemoryView":1002 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":1008 + * + * + * 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, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1010 + * 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":1011 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1013 + * __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, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":1014 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":1016 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":1017 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":1018 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":1019 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":1020 + * 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":1022 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1023 + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * else: + * result.flags = PyBUF_RECORDS_RO + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1022 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1025 + * result.flags = PyBUF_RECORDS + * else: + * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + /*else*/ { + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; + } + __pyx_L4:; + + /* "View.MemoryView":1027 + * 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":1028 + * + * 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":1031 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1032 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1033 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1034 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * 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); + + /* "View.MemoryView":1035 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L6_break; + + /* "View.MemoryView":1033 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L6_break:; + + /* "View.MemoryView":1037 + * break + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for length in result.view.shape[:ndim]: + * result.view.len *= length + */ + __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + + /* "View.MemoryView":1038 + * + * 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++) { + __pyx_t_6 = __pyx_t_8; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1039 + * 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, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1039, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1041 + * 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":1042 + * + * 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":1044 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":994 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1047 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1050 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1051 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1051, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1052 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + + /* "View.MemoryView":1050 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1054 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1055 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1047 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1058 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1062 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1063 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1064 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1066 + * 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":1067 + * + * 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":1069 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_dim = __pyx_t_4; + + /* "View.MemoryView":1070 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1071 + * for dim in range(memview.view.ndim): + * 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]); + + /* "View.MemoryView":1072 + * 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)) { + __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_5 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; + } + + /* "View.MemoryView":1058 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1075 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1078 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1079 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1075 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1082 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1089 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1090 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1091 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + + /* "View.MemoryView":1089 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1093 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1094 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1096 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1098 + * 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, 1096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1082 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1104 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1105 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1106 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + + /* "View.MemoryView":1105 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1108 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1104 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1111 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1116 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1117 + * 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":1119 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1120 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1121 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1122 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1120 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1124 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_1; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1125 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1126 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1127 + * 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":1125 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1129 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1130 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + + /* "View.MemoryView":1129 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1132 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1111 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1135 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1142 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1143 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1144 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1145 + * 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":1147 + * 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): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "View.MemoryView":1149 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + if (__pyx_t_1) { + + /* "View.MemoryView":1150 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1152 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1153 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); + + /* "View.MemoryView":1154 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1155 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + + /* "View.MemoryView":1147 + * 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): + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1157 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1158 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1162 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1163 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1135 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1165 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1168 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1165 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1172 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1175 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1177 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1178 + * + * for i in range(ndim): + * size *= src.shape[i] # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + } + + /* "View.MemoryView":1180 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1172 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1183 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1192 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1193 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_idx = __pyx_t_4; + + /* "View.MemoryView":1194 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1195 + * for idx in range(ndim): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + + /* "View.MemoryView":1192 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1197 + * stride = stride * shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + /*else*/ { + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1198 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1199 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1201 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1183 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1204 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + + /* "View.MemoryView":1215 + * 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":1216 + * + * 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":1218 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1219 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1220 + * 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, 1220, __pyx_L1_error) + + /* "View.MemoryView":1219 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1223 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1224 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1225 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1226 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1227 + * 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; + } + + /* "View.MemoryView":1229 + * 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":1233 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1234 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1235 + * 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":1234 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1237 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1238 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); + + /* "View.MemoryView":1237 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1240 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1242 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1204 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1247 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1250 + * 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, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1249 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 1249, __pyx_L1_error) + + /* "View.MemoryView":1247 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1253 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1254 + * @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, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(2, 1254, __pyx_L1_error) + + /* "View.MemoryView":1253 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":1259 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(2, 1259, __pyx_L1_error) + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1261 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(2, 1261, __pyx_L1_error) + } + + /* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1264 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + void *__pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":1272 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1273 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1275 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1276 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1277 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1280 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1281 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + + /* "View.MemoryView":1280 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1282 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1283 + * 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); + + /* "View.MemoryView":1282 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1285 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1287 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_5; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1288 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1290 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1291 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1289 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1293 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1293, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1288 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1295 + * _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":1296 + * + * 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, 1296, __pyx_L1_error) + + /* "View.MemoryView":1295 + * _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":1298 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * 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":1301 + * + * 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":1300 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1303 + * 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, 1303, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_7; + + /* "View.MemoryView":1304 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1298 + * _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":1306 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1309 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1310 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1309 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1311 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1312 + * 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); + + /* "View.MemoryView":1311 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1314 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1316 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1317 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); + + /* "View.MemoryView":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1319 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1314 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1306 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1322 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":1325 + * + * + * 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, 1325, __pyx_L1_error) + + /* "View.MemoryView":1326 + * + * 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, 1326, __pyx_L1_error) + + /* "View.MemoryView":1322 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1328 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1329 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1330 + * 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":1332 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1333 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1264 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1336 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1340 + * 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":1342 + * 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] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1343 + * + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + */ + (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + + /* "View.MemoryView":1344 + * for i in range(ndim - 1, -1, -1): + * 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]); + + /* "View.MemoryView":1345 + * 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]); + } + + /* "View.MemoryView":1347 + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1348 + * + * for i in range(offset): + * mslice.shape[i] = 1 # <<<<<<<<<<<<<< + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 + */ + (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1349 + * for i in range(offset): + * 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]); + + /* "View.MemoryView":1350 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1336 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1358 + * + * @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":1362 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1363 + * + * 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":1362 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1358 + * + * @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":1367 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1370 + * 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":1367 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1373 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1377 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1378 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1379 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_4 = (__pyx_v_inc != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1380 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1379 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1382 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + /*else*/ { + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + + /* "View.MemoryView":1378 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1384 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1385 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1387 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1373 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1393 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1396 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1397 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1399 + * _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":1393 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1403 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + + /* "View.MemoryView":1407 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1408 + * 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":1410 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1411 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1412 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); + + /* "View.MemoryView":1413 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + + /* "View.MemoryView":1410 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1415 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1416 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1418 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1403 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = NULL; + PyObject *__pyx_v___pyx_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_5) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 4, __pyx_L1_error) + + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_6) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_v___pyx_type); + __Pyx_GIVEREF(__pyx_v___pyx_type); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(2, 7, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 10, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->name); + __Pyx_DECREF(__pyx_v___pyx_result->name); + __pyx_v___pyx_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(2, 11, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":12 + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 12, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (!__pyx_t_8) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_array __pyx_vtable_array; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_array; + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_array___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + __pyx_array___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + __pyx_array___len__, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._cutil.array", /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._cutil.Enum", /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, + {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, + {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, + {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._cutil.memoryview", /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryviewslice___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib._cutil._memoryviewslice", /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Internal class for passing memoryview slices to Python", /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__cutil(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__cutil}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_cutil", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_AtomGroup_was_not_contiguous_fro, __pyx_k_AtomGroup_was_not_contiguous_fro, sizeof(__pyx_k_AtomGroup_was_not_contiguous_fro), 0, 0, 1, 0}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_MDAnalysis, __pyx_k_MDAnalysis, sizeof(__pyx_k_MDAnalysis), 0, 0, 1, 1}, + {&__pyx_n_s_MDAnalysis_lib__cutil, __pyx_k_MDAnalysis_lib__cutil, sizeof(__pyx_k_MDAnalysis_lib__cutil), 0, 0, 1, 1}, + {&__pyx_kp_s_MDAnalysis_lib__cutil_pyx, __pyx_k_MDAnalysis_lib__cutil_pyx, sizeof(__pyx_k_MDAnalysis_lib__cutil_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_n_s_NoDataError, __pyx_k_NoDataError, sizeof(__pyx_k_NoDataError), 0, 0, 1, 1}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_kp_s_One_or_more_dimensions_was_zero, __pyx_k_One_or_more_dimensions_was_zero, sizeof(__pyx_k_One_or_more_dimensions_was_zero), 0, 0, 1, 0}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_kp_s_Reference_atom_not_in_atomgroup, __pyx_k_Reference_atom_not_in_atomgroup, sizeof(__pyx_k_Reference_atom_not_in_atomgroup), 0, 0, 1, 0}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_kp_s_The_atomgroup_is_required_to_hav, __pyx_k_The_atomgroup_is_required_to_hav, sizeof(__pyx_k_The_atomgroup_is_required_to_hav), 0, 0, 1, 0}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_atom, __pyx_k_atom, sizeof(__pyx_k_atom), 0, 0, 1, 1}, + {&__pyx_n_s_atomgroup, __pyx_k_atomgroup, sizeof(__pyx_k_atomgroup), 0, 0, 1, 1}, + {&__pyx_n_s_atoms, __pyx_k_atoms, sizeof(__pyx_k_atoms), 0, 0, 1, 1}, + {&__pyx_n_s_atoms_view, __pyx_k_atoms_view, sizeof(__pyx_k_atoms_view), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_bonding, __pyx_k_bonding, sizeof(__pyx_k_bonding), 0, 0, 1, 1}, + {&__pyx_n_s_bondlist, __pyx_k_bondlist, sizeof(__pyx_k_bondlist), 0, 0, 1, 1}, + {&__pyx_n_s_bondmap, __pyx_k_bondmap, sizeof(__pyx_k_bondmap), 0, 0, 1, 1}, + {&__pyx_n_s_bonds, __pyx_k_bonds, sizeof(__pyx_k_bonds), 0, 0, 1, 1}, + {&__pyx_n_s_bonds_view, __pyx_k_bonds_view, sizeof(__pyx_k_bonds_view), 0, 0, 1, 1}, + {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dimensions, __pyx_k_dimensions, sizeof(__pyx_k_dimensions), 0, 0, 1, 1}, + {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_find_fragments, __pyx_k_find_fragments, sizeof(__pyx_k_find_fragments), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_frag_done, __pyx_k_frag_done, sizeof(__pyx_k_frag_done), 0, 0, 1, 1}, + {&__pyx_n_s_frag_todo, __pyx_k_frag_todo, sizeof(__pyx_k_frag_todo), 0, 0, 1, 1}, + {&__pyx_n_s_frags, __pyx_k_frags, sizeof(__pyx_k_frags), 0, 0, 1, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_inverse_box, __pyx_k_inverse_box, sizeof(__pyx_k_inverse_box), 0, 0, 1, 1}, + {&__pyx_n_s_is_monotonic, __pyx_k_is_monotonic, sizeof(__pyx_k_is_monotonic), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_ix, __pyx_k_ix, sizeof(__pyx_k_ix), 0, 0, 1, 1}, + {&__pyx_n_s_ix_to_rel, __pyx_k_ix_to_rel, sizeof(__pyx_k_ix_to_rel), 0, 0, 1, 1}, + {&__pyx_n_s_ix_view, __pyx_k_ix_view, sizeof(__pyx_k_ix_view), 0, 0, 1, 1}, + {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_make_whole, __pyx_k_make_whole, sizeof(__pyx_k_make_whole), 0, 0, 1, 1}, + {&__pyx_n_s_mdamath, __pyx_k_mdamath, sizeof(__pyx_k_mdamath), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_n_values, __pyx_k_n_values, sizeof(__pyx_k_n_values), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_natoms, __pyx_k_natoms, sizeof(__pyx_k_natoms), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_newpos, __pyx_k_newpos, sizeof(__pyx_k_newpos), 0, 0, 1, 1}, + {&__pyx_n_s_nloops, __pyx_k_nloops, sizeof(__pyx_k_nloops), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_oldpos, __pyx_k_oldpos, sizeof(__pyx_k_oldpos), 0, 0, 1, 1}, + {&__pyx_n_s_ortho, __pyx_k_ortho, sizeof(__pyx_k_ortho), 0, 0, 1, 1}, + {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_positions, __pyx_k_positions, sizeof(__pyx_k_positions), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_reference_atom, __pyx_k_reference_atom, sizeof(__pyx_k_reference_atom), 0, 0, 1, 1}, + {&__pyx_n_s_refpoints, __pyx_k_refpoints, sizeof(__pyx_k_refpoints), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_this_frag, __pyx_k_this_frag, sizeof(__pyx_k_this_frag), 0, 0, 1, 1}, + {&__pyx_n_s_to_indices, __pyx_k_to_indices, sizeof(__pyx_k_to_indices), 0, 0, 1, 1}, + {&__pyx_n_s_todo, __pyx_k_todo, sizeof(__pyx_k_todo), 0, 0, 1, 1}, + {&__pyx_n_s_tri_box, __pyx_k_tri_box, sizeof(__pyx_k_tri_box), 0, 0, 1, 1}, + {&__pyx_n_s_triclinic_vectors, __pyx_k_triclinic_vectors, sizeof(__pyx_k_triclinic_vectors), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_n_s_unique_int_1d, __pyx_k_unique_int_1d, sizeof(__pyx_k_unique_int_1d), 0, 0, 1, 1}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1}, + {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 81, __pyx_L1_error) + __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(2, 81, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 84, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 94, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 147, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 399, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 608, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "MDAnalysis/lib/_cutil.pyx":187 + * + * # map of global indices to local indices + * ix_view = atomgroup.ix[:] # <<<<<<<<<<<<<< + * natoms = atomgroup.ix.shape[0] + * for i in range(natoms): + */ + __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice_); + __Pyx_GIVEREF(__pyx_slice_); + + /* "MDAnalysis/lib/_cutil.pyx":197 + * # Sanity check + * if not reference_atom in atomgroup: + * raise ValueError("Reference atom not in atomgroup") # <<<<<<<<<<<<<< + * ref = ix_to_rel[reference_atom.ix] + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Reference_atom_not_in_atomgroup); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "MDAnalysis/lib/_cutil.pyx":204 + * for i in range(3): + * if box[i] == 0.0: + * raise ValueError("One or more dimensions was zero. " # <<<<<<<<<<<<<< + * "You can set dimensions using 'atomgroup.dimensions='") + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_One_or_more_dimensions_was_zero); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "MDAnalysis/lib/_cutil.pyx":223 + * bonds = atomgroup.bonds.to_indices() + * except (AttributeError, NoDataError): + * raise NoDataError("The atomgroup is required to have bonds") # <<<<<<<<<<<<<< + * for i in range(bonds.shape[0]): + * atom = bonds[i, 0] + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_The_atomgroup_is_required_to_hav); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "MDAnalysis/lib/_cutil.pyx":275 + * + * if refpoints.size() < natoms: + * raise ValueError("AtomGroup was not contiguous from bonds, process failed") # <<<<<<<<<<<<<< + * else: + * atomgroup.positions = newpos + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_AtomGroup_was_not_contiguous_fro); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 1000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 1012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "View.MemoryView":132 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "View.MemoryView":135 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "View.MemoryView":138 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "View.MemoryView":147 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "View.MemoryView":175 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":191 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "View.MemoryView":413 + * 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__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "View.MemoryView":490 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "View.MemoryView":515 + * 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_STRIDES: + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "View.MemoryView":565 + * 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__26 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "View.MemoryView":572 + * 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__27 = PyTuple_New(1); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__27, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "View.MemoryView":677 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(2, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__30); + __Pyx_GIVEREF(__pyx_slice__30); + + /* "View.MemoryView":680 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(2, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__31); + __Pyx_GIVEREF(__pyx_slice__31); + + /* "View.MemoryView":691 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(2, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__32); + __Pyx_GIVEREF(__pyx_slice__32); + + /* "View.MemoryView":698 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(2, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + + /* "MDAnalysis/lib/_cutil.pyx":50 + * @cython.boundscheck(False) # turn off bounds-checking for entire function + * @cython.wraparound(False) # turn off negative index wrapping for entire function + * def unique_int_1d(np.int64_t[:] values): # <<<<<<<<<<<<<< + * """Find the unique elements of a 1D array of integers. + * + */ + __pyx_tuple__36 = PyTuple_Pack(7, __pyx_n_s_values, __pyx_n_s_values, __pyx_n_s_is_monotonic, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_n_values, __pyx_n_s_result); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib__cutil_pyx, __pyx_n_s_unique_int_1d, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 50, __pyx_L1_error) + + /* "MDAnalysis/lib/_cutil.pyx":105 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def make_whole(atomgroup, reference_atom=None): # <<<<<<<<<<<<<< + * """Move all atoms in a single molecule so that bonds don't split over images + * + */ + __pyx_tuple__38 = PyTuple_Pack(23, __pyx_n_s_atomgroup, __pyx_n_s_reference_atom, __pyx_n_s_refpoints, __pyx_n_s_todo, __pyx_n_s_done, __pyx_n_s_i, __pyx_n_s_nloops, __pyx_n_s_ref, __pyx_n_s_atom, __pyx_n_s_other, __pyx_n_s_natoms, __pyx_n_s_ix_to_rel, __pyx_n_s_bonding, __pyx_n_s_bonds, __pyx_n_s_oldpos, __pyx_n_s_newpos, __pyx_n_s_ortho, __pyx_n_s_box, __pyx_n_s_tri_box, __pyx_n_s_inverse_box, __pyx_n_s_vec, __pyx_n_s_ix_view, __pyx_n_s_triclinic_vectors); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib__cutil_pyx, __pyx_n_s_make_whole, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 105, __pyx_L1_error) + + /* "MDAnalysis/lib/_cutil.pyx":322 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def find_fragments(atoms, bondlist): # <<<<<<<<<<<<<< + * """Calculate distinct fragments from nodes (atom indices) and edges (pairs + * of atom indices). + */ + __pyx_tuple__40 = PyTuple_Pack(13, __pyx_n_s_atoms, __pyx_n_s_bondlist, __pyx_n_s_bondmap, __pyx_n_s_todo, __pyx_n_s_frag_todo, __pyx_n_s_frag_done, __pyx_n_s_this_frag, __pyx_n_s_i, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_atoms_view, __pyx_n_s_bonds_view, __pyx_n_s_frags); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib__cutil_pyx, __pyx_n_s_find_fragments, 322, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 322, __pyx_L1_error) + + /* "View.MemoryView":285 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + + /* "View.MemoryView":286 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + + /* "View.MemoryView":287 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__44); + __Pyx_GIVEREF(__pyx_tuple__44); + + /* "View.MemoryView":290 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "View.MemoryView":291 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_modinit_global_init_code(void); /*proto*/ +static int __Pyx_modinit_variable_export_code(void); /*proto*/ +static int __Pyx_modinit_function_export_code(void); /*proto*/ +static int __Pyx_modinit_type_init_code(void); /*proto*/ +static int __Pyx_modinit_type_import_code(void); /*proto*/ +static int __Pyx_modinit_variable_import_code(void); /*proto*/ +static int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_dot", (void (*)(void))__pyx_f_10MDAnalysis_3lib_6_cutil__dot, "float (float *, float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_cross", (void (*)(void))__pyx_f_10MDAnalysis_3lib_6_cutil__cross, "void (float *, float *, float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_norm", (void (*)(void))__pyx_f_10MDAnalysis_3lib_6_cutil__norm, "float (float *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 278, __pyx_L1_error) + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 164, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 186, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 190, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 199, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 872, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_cutil(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_cutil(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__cutil(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__cutil(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + result = PyDict_SetItemString(moddict, to_name, value); + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static int __pyx_pymod_exec__cutil(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + static PyThread_type_lock __pyx_t_3[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__cutil(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_cutil", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_MDAnalysis__lib___cutil) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "MDAnalysis.lib._cutil")) { + if (unlikely(PyDict_SetItemString(modules, "MDAnalysis.lib._cutil", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "MDAnalysis/lib/_cutil.pyx":25 + * + * import cython + * import numpy as np # <<<<<<<<<<<<<< + * cimport numpy as np + * from libc.math cimport sqrt + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":29 + * from libc.math cimport sqrt + * + * from MDAnalysis import NoDataError # <<<<<<<<<<<<<< + * + * from libcpp.set cimport set as cset + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NoDataError); + __Pyx_GIVEREF(__pyx_n_s_NoDataError); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NoDataError); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_MDAnalysis, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NoDataError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoDataError, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":37 + * + * + * __all__ = ['unique_int_1d', 'make_whole', 'find_fragments'] # <<<<<<<<<<<<<< + * + * cdef extern from "calc_distances.h": + */ + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_unique_int_1d); + __Pyx_GIVEREF(__pyx_n_s_unique_int_1d); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_unique_int_1d); + __Pyx_INCREF(__pyx_n_s_make_whole); + __Pyx_GIVEREF(__pyx_n_s_make_whole); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_make_whole); + __Pyx_INCREF(__pyx_n_s_find_fragments); + __Pyx_GIVEREF(__pyx_n_s_find_fragments); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_find_fragments); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":50 + * @cython.boundscheck(False) # turn off bounds-checking for entire function + * @cython.wraparound(False) # turn off negative index wrapping for entire function + * def unique_int_1d(np.int64_t[:] values): # <<<<<<<<<<<<<< + * """Find the unique elements of a 1D array of integers. + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6_cutil_1unique_int_1d, NULL, __pyx_n_s_MDAnalysis_lib__cutil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique_int_1d, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":105 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def make_whole(atomgroup, reference_atom=None): # <<<<<<<<<<<<<< + * """Move all atoms in a single molecule so that bonds don't split over images + * + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6_cutil_3make_whole, NULL, __pyx_n_s_MDAnalysis_lib__cutil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_whole, __pyx_t_2) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":322 + * @cython.boundscheck(False) + * @cython.wraparound(False) + * def find_fragments(atoms, bondlist): # <<<<<<<<<<<<<< + * """Calculate distinct fragments from nodes (atom indices) and edges (pairs + * of atom indices). + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6_cutil_5find_fragments, NULL, __pyx_n_s_MDAnalysis_lib__cutil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_fragments, __pyx_t_2) < 0) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/_cutil.pyx":1 + * # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- # <<<<<<<<<<<<<< + * # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 + * # + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":208 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * def __dealloc__(array self): + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 208, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":285 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":286 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":287 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":290 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":291 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":315 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":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 = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_3[0] = PyThread_allocate_lock(); + __pyx_t_3[1] = PyThread_allocate_lock(); + __pyx_t_3[2] = PyThread_allocate_lock(); + __pyx_t_3[3] = PyThread_allocate_lock(); + __pyx_t_3[4] = PyThread_allocate_lock(); + __pyx_t_3[5] = PyThread_allocate_lock(); + __pyx_t_3[6] = PyThread_allocate_lock(); + __pyx_t_3[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":544 + * info.obj = self + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 544, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":990 + * return self.from_object + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 990, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init MDAnalysis.lib._cutil", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init MDAnalysis.lib._cutil"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* GetModuleGlobalName */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + if (likely(result)) { + Py_INCREF(result); + } else if (unlikely(PyErr_Occurred())) { + result = NULL; + } else { +#else + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* PyObjectCall */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* MemviewSliceInit */ + static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (!buf) { + PyErr_SetString(PyExc_ValueError, + "buf is NULL."); + goto fail; + } else if (memviewslice->memview || memviewslice->data) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +#ifndef Py_NO_RETURN +#define Py_NO_RETURN +#endif +static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + va_end(vargs); + Py_FatalError(msg); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* PyCFunctionFastCall */ + #if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ + #if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* WriteUnraisableException */ + static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* RaiseDoubleKeywords */ + static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ + static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ + static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* SliceObject */ + static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* RaiseException */ + #if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* PyObjectCallNoArg */ + #if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) { +#else + if (likely(PyCFunction_Check(func))) { +#endif + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if PY_VERSION_HEX >= 0x030700A3 + *type = tstate->exc_state.exc_type; + *value = tstate->exc_state.exc_value; + *tb = tstate->exc_state.exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = type; + tstate->exc_state.exc_value = value; + tstate->exc_state.exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = local_type; + tstate->exc_state.exc_value = local_value; + tstate->exc_state.exc_traceback = local_tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectSetAttrStr */ + #if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* DictGetItem */ + #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* ArgTypeTest */ + static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* BytesEquals */ + static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ + static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* None */ + static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) { + Py_ssize_t q = a / b; + Py_ssize_t r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* ObjectGetItem */ + #if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* decode_c_string */ + static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* GetAttr3 */ + static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = *type; + tstate->exc_state.exc_value = *value; + tstate->exc_state.exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyIntBinop */ + #if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long x; + long a = PyInt_AS_LONG(op1); + x = (long)((unsigned long)a + b); + if (likely((x^a) >= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* None */ + static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +/* HasAttr */ + static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* PyObject_GenericGetAttrNoDict */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* SetupReduce */ + static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto GOOD; +BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (PyObject_Not(use_cline) != 0) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* IsLittleEndian */ + static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ + static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_int64) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_int64) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_int64) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_int64), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) { + return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) { + __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj); + if ((value == ((npy_int64)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_5numpy_int64_t *) itemp = value; + return 1; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(float *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) { + float value = __pyx_PyFloat_AsFloat(obj); + if ((value == (float)-1) && PyErr_Occurred()) + return 0; + *(float *) itemp = value; + return 1; +} + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = 1.0 / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = 1.0 / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0, -1); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = 1.0 / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = 1.0 / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0, -1); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum NPY_TYPES) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum NPY_TYPES) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), + little, !is_unsigned); + } +} + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +/* CIntFromPy */ + static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) { + const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_int64) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_int64) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_int64) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0]) + case 2: + if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) { + return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) { + return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) { + return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_int64) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_int64) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_int64) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) { + return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) { + return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_int64) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_int64 val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_int64) -1; + } + } else { + npy_int64 val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_int64) -1; + val = __Pyx_PyInt_As_npy_int64(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_int64"); + return (npy_int64) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_int64"); + return (npy_int64) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = (char) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + } +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_Py_ssize_t(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_Py_ssize_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_float, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 2, + &__Pyx_TypeInfo_int, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 2, + &__Pyx_TypeInfo_float, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 2, + &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* FunctionExport */ + static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* ModuleImport */ + #ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(x); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/package/MDAnalysis/lib/_cutil.pxd b/package/MDAnalysis/lib/_cutil.pxd new file mode 100644 index 00000000000..5efc82f6d5d --- /dev/null +++ b/package/MDAnalysis/lib/_cutil.pxd @@ -0,0 +1,3 @@ +cdef float _dot(float *, float *) +cdef void _cross(float *, float *, float *) +cdef float _norm(float *) \ No newline at end of file diff --git a/package/MDAnalysis/lib/_cutil.pyx b/package/MDAnalysis/lib/_cutil.pyx new file mode 100644 index 00000000000..250abacbe73 --- /dev/null +++ b/package/MDAnalysis/lib/_cutil.pyx @@ -0,0 +1,393 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +# + +import cython +import numpy as np +cimport numpy as np +from libc.math cimport sqrt + +from MDAnalysis import NoDataError + +from libcpp.set cimport set as cset +from libcpp.map cimport map as cmap +from libcpp.vector cimport vector +from cython.operator cimport dereference as deref + + +__all__ = ['unique_int_1d', 'make_whole', 'find_fragments'] + +cdef extern from "calc_distances.h": + ctypedef float coordinate[3] + void minimum_image(double *x, float *box, float *inverse_box) + void minimum_image_triclinic(double *dx, coordinate *box) + +ctypedef cset[int] intset +ctypedef cmap[int, intset] intmap + + +@cython.boundscheck(False) # turn off bounds-checking for entire function +@cython.wraparound(False) # turn off negative index wrapping for entire function +def unique_int_1d(np.int64_t[:] values): + """Find the unique elements of a 1D array of integers. + + This function is optimal on sorted arrays. + + Parameters + ---------- + values: numpy.ndarray + 1D array of dtype ``numpy.int64`` in which to find the unique values. + + Returns + ------- + numpy.ndarray + A deduplicated copy of `values`. + + + .. versionadded:: 0.19.0 + """ + cdef bint is_monotonic = True + cdef int i = 0 + cdef int j = 0 + cdef int n_values = values.shape[0] + cdef np.int64_t[:] result = np.empty(n_values, dtype=np.int64) + + if n_values == 0: + return result + + result[0] = values[0] + for i in range(1, n_values): + if values[i] != result[j]: + j += 1 + result[j] = values[i] + if values[i] < values[i - 1]: + is_monotonic = False + result = result[:j + 1] + if not is_monotonic: + result = unique_int_1d(np.sort(result)) + + return np.array(result) + + +cdef intset difference(intset a, intset b): + """a.difference(b) + + Returns set of values in a which are not in b + """ + cdef intset output + for val in a: + if b.count(val) != 1: + output.insert(val) + return output + + +@cython.boundscheck(False) +@cython.wraparound(False) +def make_whole(atomgroup, reference_atom=None): + """Move all atoms in a single molecule so that bonds don't split over images + + Atom positions are modified in place. + + This function is most useful when atoms have been packed into the primary + unit cell, causing breaks mid molecule, with the molecule then appearing + on either side of the unit cell. This is problematic for operations + such as calculating the center of mass of the molecule. :: + + +-----------+ +-----------+ + | | | | + | 6 3 | | 3 | 6 + | ! ! | | ! | ! + |-5-8 1-2-| -> | 1-2-|-5-8 + | ! ! | | ! | ! + | 7 4 | | 4 | 7 + | | | | + +-----------+ +-----------+ + + + Parameters + ---------- + atomgroup : AtomGroup + The :class:`MDAnalysis.core.groups.AtomGroup` to work with. + The positions of this are modified in place. All these atoms + must belong in the same molecule or fragment. + reference_atom : :class:`~MDAnalysis.core.groups.Atom` + The atom around which all other atoms will be moved. + Defaults to atom 0 in the atomgroup. + + Raises + ------ + NoDataError + There are no bonds present. + (See :func:`~MDAnalysis.topology.core.guess_bonds`) + + ValueError + The algorithm fails to work. This is usually + caused by the atomgroup not being a single fragment. + (ie the molecule can't be traversed by following bonds) + + + Example + ------- + Make fragments whole:: + + from MDAnalysis.lib.mdamath import make_whole + + # This algorithm requires bonds, these can be guessed! + u = mda.Universe(......, guess_bonds=True) + + # MDAnalysis can split molecules into their fragments + # based on bonding information. + # Note that this function will only handle a single fragment + # at a time, necessitating a loop. + for frag in u.fragments: + make_whole(frag) + + Alternatively, to keep a single atom in place as the anchor:: + + # This will mean that atomgroup[10] will NOT get moved, + # and all other atoms will move (if necessary). + make_whole(atomgroup, reference_atom=atomgroup[10]) + + + .. versionadded:: 0.11.0 + """ + cdef intset refpoints, todo, done + cdef int i, nloops, ref, atom, other, natoms + cdef cmap[int, int] ix_to_rel + cdef intmap bonding + cdef int[:, :] bonds + cdef float[:, :] oldpos, newpos + cdef bint ortho + cdef float[:] box + cdef float tri_box[3][3] + cdef float inverse_box[3] + cdef double vec[3] + cdef ssize_t[:] ix_view + + # map of global indices to local indices + ix_view = atomgroup.ix[:] + natoms = atomgroup.ix.shape[0] + for i in range(natoms): + ix_to_rel[ix_view[i]] = i + + if reference_atom is None: + ref = 0 + else: + # Sanity check + if not reference_atom in atomgroup: + raise ValueError("Reference atom not in atomgroup") + ref = ix_to_rel[reference_atom.ix] + + box = atomgroup.dimensions + + for i in range(3): + if box[i] == 0.0: + raise ValueError("One or more dimensions was zero. " + "You can set dimensions using 'atomgroup.dimensions='") + + ortho = True + for i in range(3, 6): + if box[i] != 90.0: + ortho = False + + if ortho: + for i in range(3): + inverse_box[i] = 1.0 / box[i] + else: + from .mdamath import triclinic_vectors + tri_box = triclinic_vectors(box) + + # C++ dict of bonds + try: + bonds = atomgroup.bonds.to_indices() + except (AttributeError, NoDataError): + raise NoDataError("The atomgroup is required to have bonds") + for i in range(bonds.shape[0]): + atom = bonds[i, 0] + other = bonds[i, 1] + # only add bonds if both atoms are in atoms set + if ix_to_rel.count(atom) and ix_to_rel.count(other): + atom = ix_to_rel[atom] + other = ix_to_rel[other] + + bonding[atom].insert(other) + bonding[other].insert(atom) + + oldpos = atomgroup.positions + newpos = np.zeros((oldpos.shape[0], 3), dtype=np.float32) + + refpoints = intset() # Who is safe to use as reference point? + done = intset() # Who have I already searched around? + # initially we have one starting atom whose position is in correct image + refpoints.insert(ref) + for i in range(3): + newpos[ref, i] = oldpos[ref, i] + + nloops = 0 + while refpoints.size() < natoms and nloops < natoms: + # count iterations to prevent infinite loop here + nloops += 1 + + # We want to iterate over atoms that are good to use as reference + # points, but haven't been searched yet. + todo = difference(refpoints, done) + for atom in todo: + for other in bonding[atom]: + # If other is already a refpoint, leave alone + if refpoints.count(other): + continue + # Draw vector from atom to other + for i in range(3): + vec[i] = oldpos[other, i] - newpos[atom, i] + # Apply periodic boundary conditions to this vector + if ortho: + minimum_image(&vec[0], &box[0], &inverse_box[0]) + else: + minimum_image_triclinic(&vec[0], &tri_box[0]) + # Then define position of other based on this vector + for i in range(3): + newpos[other, i] = newpos[atom, i] + vec[i] + + # This other atom can now be used as a reference point + refpoints.insert(other) + done.insert(atom) + + if refpoints.size() < natoms: + raise ValueError("AtomGroup was not contiguous from bonds, process failed") + else: + atomgroup.positions = newpos + + +@cython.boundscheck(False) +@cython.wraparound(False) +cdef float _dot(float * a, float * b): + """Return dot product of two 3d vectors""" + cdef ssize_t n + cdef float sum1 + + sum1 = 0.0 + for n in range(3): + sum1 += a[n] * b[n] + return sum1 + + +@cython.boundscheck(False) +@cython.wraparound(False) +cdef void _cross(float * a, float * b, float * result): + """ + Calculates the cross product between 3d vectors + + Note + ---- + Modifies the result array + """ + + result[0] = a[1]*b[2] - a[2]*b[1] + result[1] = - a[0]*b[2] + a[2]*b[0] + result[2] = a[0]*b[1] - a[1]*b[0] + +cdef float _norm(float * a): + """ + Calculates the magnitude of the vector + """ + cdef float result + cdef ssize_t n + result = 0.0 + for n in range(3): + result += a[n]*a[n] + return sqrt(result) + + +@cython.boundscheck(False) +@cython.wraparound(False) +def find_fragments(atoms, bondlist): + """Calculate distinct fragments from nodes (atom indices) and edges (pairs + of atom indices). + + Parameters + ---------- + atoms : array_like + 1-D Array of atom indices (dtype will be converted to ``numpy.int64`` + internally) + bonds : array_like + 2-D array of bonds (dtype will be converted to ``numpy.int32`` + internally), where ``bonds[i, 0]`` and ``bonds[i, 1]`` are the + indices of atoms connected by the ``i``-th bond. Any bonds referring to + atom indices not in `atoms` will be ignored. + + Returns + ------- + fragments : list + List of arrays, each containing the atom indices of a fragment. + + .. versionaddded:: 0.19.0 + """ + cdef intmap bondmap + cdef intset todo, frag_todo, frag_done + cdef vector[int] this_frag + cdef int i, a, b + cdef np.int64_t[:] atoms_view + cdef np.int32_t[:, :] bonds_view + + atoms_view = np.asarray(atoms, dtype=np.int64) + bonds_view = np.asarray(bondlist, dtype=np.int32) + + # grab record of which atoms I have to process + # ie set of all nodes + for i in range(atoms_view.shape[0]): + todo.insert(atoms_view[i]) + # Process edges into map + for i in range(bonds_view.shape[0]): + a = bonds_view[i, 0] + b = bonds_view[i, 1] + # only include edges if both are known nodes + if todo.count(a) and todo.count(b): + bondmap[a].insert(b) + bondmap[b].insert(a) + + frags = [] + + while not todo.empty(): # While not all nodes have been done + # Start a new fragment + frag_todo.clear() + frag_done.clear() + this_frag.clear() + # Grab a start point for next fragment + frag_todo.insert(deref(todo.begin())) + + # Loop until fragment fully explored + while not frag_todo.empty(): + # Pop next in this frag todo + a = deref(frag_todo.begin()) + frag_todo.erase(a) + if not frag_done.count(a): + this_frag.push_back(a) + frag_done.insert(a) + todo.erase(a) + for b in bondmap[a]: + if not frag_done.count(b): + frag_todo.insert(b) + + # Add fragment to output + frags.append(np.asarray(this_frag)) + + return frags diff --git a/package/MDAnalysis/lib/c_distances.c b/package/MDAnalysis/lib/c_distances.c index bd1ee7124b7..2a2063cc501 100644 --- a/package/MDAnalysis/lib/c_distances.c +++ b/package/MDAnalysis/lib/c_distances.c @@ -1,11 +1,11 @@ -/* Generated by Cython 0.28.2 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", "MDAnalysis/lib/include/calc_distances.h" ], "extra_compile_args": [ @@ -15,7 +15,7 @@ "-funroll-loops" ], "include_dirs": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include", "MDAnalysis/lib/include" ], "libraries": [ @@ -37,7 +37,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_2" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -483,6 +483,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -684,7 +685,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -792,7 +793,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -939,7 +940,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -948,7 +949,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -957,7 +958,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -966,7 +967,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -975,7 +976,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -984,7 +985,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -993,7 +994,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1002,7 +1003,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1011,7 +1012,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1020,7 +1021,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1029,7 +1030,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1038,7 +1039,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1047,7 +1048,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1056,7 +1057,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1065,7 +1066,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1074,7 +1075,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1083,7 +1084,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1092,7 +1093,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1101,7 +1102,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1110,7 +1111,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1119,7 +1120,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1158,7 +1159,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1167,7 +1168,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1176,7 +1177,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1185,7 +1186,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1414,6 +1415,9 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam /* None.proto */ static CYTHON_INLINE long __Pyx_div_long(long, long); +/* BufferIndexError.proto */ +static void __Pyx_RaiseBufferIndexError(int axis); + /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d #define __Pyx_MEMVIEW_DIRECT 1 @@ -1827,6 +1831,36 @@ static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, /* Capsule.proto */ static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *, int writable_flag); + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); @@ -1950,29 +1984,6 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); -/* IsLittleEndian.proto */ -static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); - -/* BufferFormatCheck.proto */ -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); -static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type); - -/* TypeInfoCompare.proto */ -static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); - -/* MemviewSliceValidateAndInit.proto */ -static int __Pyx_ValidateAndInit_memviewslice( - int *axes_specs, - int c_or_f_flag, - int buf_flags, - int ndim, - __Pyx_TypeInfo *dtype, - __Pyx_BufFmt_StackElem stack[], - __Pyx_memviewslice *memviewslice, - PyObject *original_obj); - /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag); @@ -2404,7 +2415,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_4calc_distance_array_t static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_6calc_self_distance_array(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ref, PyArrayObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_8calc_self_distance_array_ortho(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ref, PyArrayObject *__pyx_v_box, PyArrayObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_10calc_self_distance_array_triclinic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_ref, PyArrayObject *__pyx_v_box, PyArrayObject *__pyx_v_result); /* proto */ -static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_12coord_transform(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_box); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_12coord_transform(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_box); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_14calc_bond_distance(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords1, PyArrayObject *__pyx_v_coords2, PyArrayObject *__pyx_v_results); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_16calc_bond_distance_ortho(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords1, PyArrayObject *__pyx_v_coords2, PyArrayObject *__pyx_v_box, PyArrayObject *__pyx_v_results); /* proto */ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_18calc_bond_distance_triclinic(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords1, PyArrayObject *__pyx_v_coords2, PyArrayObject *__pyx_v_box, PyArrayObject *__pyx_v_results); /* proto */ @@ -3388,17 +3399,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_10calc_self_distance_a /* "MDAnalysis/lib/c_distances.pyx":128 * result.data, distnum) * - * def coord_transform(numpy.ndarray coords, # <<<<<<<<<<<<<< - * numpy.ndarray box): - * cdef int numcoords + * def coord_transform(float[:,:] coords, # <<<<<<<<<<<<<< + * float[:,:] box): + * cdef int numcoords, size */ /* Python wrapper */ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_13coord_transform(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_11c_distances_13coord_transform = {"coord_transform", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_11c_distances_13coord_transform, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_13coord_transform(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_coords = 0; - PyArrayObject *__pyx_v_box = 0; + __Pyx_memviewslice __pyx_v_coords = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_box = { 0, 0, { 0 }, { 0 }, { 0 } }; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coord_transform (wrapper)", 0); @@ -3437,8 +3448,8 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_13coord_transform(PyOb values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_coords = ((PyArrayObject *)values[0]); - __pyx_v_box = ((PyArrayObject *)values[1]); + __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 128, __pyx_L3_error) + __pyx_v_box = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_box.memview)) __PYX_ERR(0, 129, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; @@ -3448,60 +3459,153 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_13coord_transform(PyOb __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 128, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_12coord_transform(__pyx_self, __pyx_v_coords, __pyx_v_box); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_12coord_transform(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_coords, PyArrayObject *__pyx_v_box) { +static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_12coord_transform(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_box) { int __pyx_v_numcoords; + int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; __Pyx_RefNannySetupContext("coord_transform", 0); /* "MDAnalysis/lib/c_distances.pyx":131 - * numpy.ndarray box): - * cdef int numcoords + * float[:,:] box): + * cdef int numcoords, size * numcoords = coords.shape[0] # <<<<<<<<<<<<<< + * size = coords.size * - * _coord_transform( coords.data, numcoords, */ - __pyx_v_numcoords = (__pyx_v_coords->dimensions[0]); + __pyx_v_numcoords = (__pyx_v_coords.shape[0]); - /* "MDAnalysis/lib/c_distances.pyx":133 + /* "MDAnalysis/lib/c_distances.pyx":132 + * cdef int numcoords, size * numcoords = coords.shape[0] + * size = coords.size # <<<<<<<<<<<<<< + * + * if size > 0: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_size = __pyx_t_3; + + /* "MDAnalysis/lib/c_distances.pyx":134 + * size = coords.size + * + * if size > 0: # <<<<<<<<<<<<<< + * _coord_transform( &coords[0,0], numcoords, + * &box[0,0]) + */ + __pyx_t_4 = ((__pyx_v_size > 0) != 0); + if (__pyx_t_4) { + + /* "MDAnalysis/lib/c_distances.pyx":135 * - * _coord_transform( coords.data, numcoords, # <<<<<<<<<<<<<< - * box.data) + * if size > 0: + * _coord_transform( &coords[0,0], numcoords, # <<<<<<<<<<<<<< + * &box[0,0]) * */ - _coord_transform(((coordinate *)__pyx_v_coords->data), __pyx_v_numcoords, ((coordinate *)__pyx_v_box->data)); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_3 = -1; + if (__pyx_t_5 < 0) { + __pyx_t_5 += __pyx_v_coords.shape[0]; + if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_5 >= __pyx_v_coords.shape[0])) __pyx_t_3 = 0; + if (__pyx_t_6 < 0) { + __pyx_t_6 += __pyx_v_coords.shape[1]; + if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_6 >= __pyx_v_coords.shape[1])) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + __PYX_ERR(0, 135, __pyx_L1_error) + } + + /* "MDAnalysis/lib/c_distances.pyx":136 + * if size > 0: + * _coord_transform( &coords[0,0], numcoords, + * &box[0,0]) # <<<<<<<<<<<<<< + * + * def calc_bond_distance(numpy.ndarray coords1, + */ + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_3 = -1; + if (__pyx_t_7 < 0) { + __pyx_t_7 += __pyx_v_box.shape[0]; + if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_v_box.shape[0])) __pyx_t_3 = 0; + if (__pyx_t_8 < 0) { + __pyx_t_8 += __pyx_v_box.shape[1]; + if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 1; + } else if (unlikely(__pyx_t_8 >= __pyx_v_box.shape[1])) __pyx_t_3 = 1; + if (unlikely(__pyx_t_3 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_3); + __PYX_ERR(0, 136, __pyx_L1_error) + } + + /* "MDAnalysis/lib/c_distances.pyx":135 + * + * if size > 0: + * _coord_transform( &coords[0,0], numcoords, # <<<<<<<<<<<<<< + * &box[0,0]) + * + */ + _coord_transform((&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_5 * __pyx_v_coords.strides[0]) ) + __pyx_t_6 * __pyx_v_coords.strides[1]) )))), __pyx_v_numcoords, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_box.data + __pyx_t_7 * __pyx_v_box.strides[0]) ) + __pyx_t_8 * __pyx_v_box.strides[1]) ))))); + + /* "MDAnalysis/lib/c_distances.pyx":134 + * size = coords.size + * + * if size > 0: # <<<<<<<<<<<<<< + * _coord_transform( &coords[0,0], numcoords, + * &box[0,0]) + */ + } /* "MDAnalysis/lib/c_distances.pyx":128 * result.data, distnum) * - * def coord_transform(numpy.ndarray coords, # <<<<<<<<<<<<<< - * numpy.ndarray box): - * cdef int numcoords + * def coord_transform(float[:,:] coords, # <<<<<<<<<<<<<< + * float[:,:] box): + * cdef int numcoords, size */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("MDAnalysis.lib.c_distances.coord_transform", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_coords, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_box, 1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":136 - * box.data) +/* "MDAnalysis/lib/c_distances.pyx":138 + * &box[0,0]) * * def calc_bond_distance(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, @@ -3543,17 +3647,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_15calc_bond_distance(P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance", 1, 3, 3, 1); __PYX_ERR(0, 136, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance", 1, 3, 3, 1); __PYX_ERR(0, 138, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance", 1, 3, 3, 2); __PYX_ERR(0, 136, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance", 1, 3, 3, 2); __PYX_ERR(0, 138, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_bond_distance") < 0)) __PYX_ERR(0, 136, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_bond_distance") < 0)) __PYX_ERR(0, 138, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -3568,15 +3672,15 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_15calc_bond_distance(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_bond_distance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 138, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_bond_distance", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 136, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 137, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_14calc_bond_distance(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_results); /* function exit code */ @@ -3594,7 +3698,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_14calc_bond_distance(C __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_bond_distance", 0); - /* "MDAnalysis/lib/c_distances.pyx":140 + /* "MDAnalysis/lib/c_distances.pyx":142 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -3603,7 +3707,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_14calc_bond_distance(C */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":142 + /* "MDAnalysis/lib/c_distances.pyx":144 * numcoords = coords1.shape[0] * * _calc_bond_distance( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -3612,8 +3716,8 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_14calc_bond_distance(C */ _calc_bond_distance(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), __pyx_v_numcoords, ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":136 - * box.data) + /* "MDAnalysis/lib/c_distances.pyx":138 + * &box[0,0]) * * def calc_bond_distance(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, @@ -3627,7 +3731,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_14calc_bond_distance(C return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":146 +/* "MDAnalysis/lib/c_distances.pyx":148 * results.data) * * def calc_bond_distance_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -3673,23 +3777,23 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_17calc_bond_distance_o case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, 1); __PYX_ERR(0, 146, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, 1); __PYX_ERR(0, 148, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, 2); __PYX_ERR(0, 146, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, 2); __PYX_ERR(0, 148, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, 3); __PYX_ERR(0, 146, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, 3); __PYX_ERR(0, 148, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_bond_distance_ortho") < 0)) __PYX_ERR(0, 146, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_bond_distance_ortho") < 0)) __PYX_ERR(0, 148, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3706,16 +3810,16 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_17calc_bond_distance_o } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_ortho", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 148, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_bond_distance_ortho", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 146, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 147, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 148, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 148, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_16calc_bond_distance_ortho(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_box, __pyx_v_results); /* function exit code */ @@ -3733,7 +3837,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_16calc_bond_distance_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_bond_distance_ortho", 0); - /* "MDAnalysis/lib/c_distances.pyx":151 + /* "MDAnalysis/lib/c_distances.pyx":153 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -3742,7 +3846,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_16calc_bond_distance_o */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":153 + /* "MDAnalysis/lib/c_distances.pyx":155 * numcoords = coords1.shape[0] * * _calc_bond_distance_ortho( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -3751,7 +3855,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_16calc_bond_distance_o */ _calc_bond_distance_ortho(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), __pyx_v_numcoords, ((float *)__pyx_v_box->data), ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":146 + /* "MDAnalysis/lib/c_distances.pyx":148 * results.data) * * def calc_bond_distance_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -3766,7 +3870,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_16calc_bond_distance_o return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":158 +/* "MDAnalysis/lib/c_distances.pyx":160 * results.data) * * def calc_bond_distance_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -3812,23 +3916,23 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_19calc_bond_distance_t case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, 1); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, 1); __PYX_ERR(0, 160, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, 2); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, 2); __PYX_ERR(0, 160, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, 3); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, 3); __PYX_ERR(0, 160, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_bond_distance_triclinic") < 0)) __PYX_ERR(0, 158, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_bond_distance_triclinic") < 0)) __PYX_ERR(0, 160, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3845,16 +3949,16 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_19calc_bond_distance_t } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_bond_distance_triclinic", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 160, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_bond_distance_triclinic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 158, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 159, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 160, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_18calc_bond_distance_triclinic(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_box, __pyx_v_results); /* function exit code */ @@ -3872,7 +3976,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_18calc_bond_distance_t __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_bond_distance_triclinic", 0); - /* "MDAnalysis/lib/c_distances.pyx":163 + /* "MDAnalysis/lib/c_distances.pyx":165 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -3881,7 +3985,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_18calc_bond_distance_t */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":165 + /* "MDAnalysis/lib/c_distances.pyx":167 * numcoords = coords1.shape[0] * * _calc_bond_distance_triclinic( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -3890,7 +3994,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_18calc_bond_distance_t */ _calc_bond_distance_triclinic(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), __pyx_v_numcoords, ((coordinate *)__pyx_v_box->data), ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":158 + /* "MDAnalysis/lib/c_distances.pyx":160 * results.data) * * def calc_bond_distance_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -3905,7 +4009,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_18calc_bond_distance_t return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":170 +/* "MDAnalysis/lib/c_distances.pyx":172 * results.data) * * def calc_angle(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -3951,23 +4055,23 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_21calc_angle(PyObject case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, 1); __PYX_ERR(0, 170, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, 1); __PYX_ERR(0, 172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords3)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, 2); __PYX_ERR(0, 170, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, 2); __PYX_ERR(0, 172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, 3); __PYX_ERR(0, 170, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, 3); __PYX_ERR(0, 172, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_angle") < 0)) __PYX_ERR(0, 170, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_angle") < 0)) __PYX_ERR(0, 172, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3984,16 +4088,16 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_21calc_angle(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_angle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 170, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 171, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 172, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 174, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 175, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_20calc_angle(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_coords3, __pyx_v_results); /* function exit code */ @@ -4011,7 +4115,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_20calc_angle(CYTHON_UN __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_angle", 0); - /* "MDAnalysis/lib/c_distances.pyx":175 + /* "MDAnalysis/lib/c_distances.pyx":177 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -4020,7 +4124,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_20calc_angle(CYTHON_UN */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":177 + /* "MDAnalysis/lib/c_distances.pyx":179 * numcoords = coords1.shape[0] * * _calc_angle( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -4029,7 +4133,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_20calc_angle(CYTHON_UN */ _calc_angle(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), ((coordinate *)__pyx_v_coords3->data), __pyx_v_numcoords, ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":170 + /* "MDAnalysis/lib/c_distances.pyx":172 * results.data) * * def calc_angle(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4044,7 +4148,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_20calc_angle(CYTHON_UN return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":182 +/* "MDAnalysis/lib/c_distances.pyx":184 * results.data) * * def calc_angle_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4093,29 +4197,29 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_23calc_angle_ortho(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 1); __PYX_ERR(0, 182, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 1); __PYX_ERR(0, 184, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords3)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 2); __PYX_ERR(0, 182, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 2); __PYX_ERR(0, 184, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 3); __PYX_ERR(0, 182, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 3); __PYX_ERR(0, 184, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 4); __PYX_ERR(0, 182, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, 4); __PYX_ERR(0, 184, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_angle_ortho") < 0)) __PYX_ERR(0, 182, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_angle_ortho") < 0)) __PYX_ERR(0, 184, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -4134,17 +4238,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_23calc_angle_ortho(PyO } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 182, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_ortho", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 184, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_angle_ortho", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 182, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 183, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 184, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 185, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 186, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 184, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 185, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 186, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 187, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 188, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_22calc_angle_ortho(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_coords3, __pyx_v_box, __pyx_v_results); /* function exit code */ @@ -4162,7 +4266,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_22calc_angle_ortho(CYT __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_angle_ortho", 0); - /* "MDAnalysis/lib/c_distances.pyx":188 + /* "MDAnalysis/lib/c_distances.pyx":190 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -4171,7 +4275,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_22calc_angle_ortho(CYT */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":190 + /* "MDAnalysis/lib/c_distances.pyx":192 * numcoords = coords1.shape[0] * * _calc_angle_ortho( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -4180,7 +4284,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_22calc_angle_ortho(CYT */ _calc_angle_ortho(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), ((coordinate *)__pyx_v_coords3->data), __pyx_v_numcoords, ((float *)__pyx_v_box->data), ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":182 + /* "MDAnalysis/lib/c_distances.pyx":184 * results.data) * * def calc_angle_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4195,7 +4299,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_22calc_angle_ortho(CYT return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":196 +/* "MDAnalysis/lib/c_distances.pyx":198 * results.data) * * def calc_angle_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4244,29 +4348,29 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_25calc_angle_triclinic case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 1); __PYX_ERR(0, 196, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 1); __PYX_ERR(0, 198, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords3)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 2); __PYX_ERR(0, 196, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 2); __PYX_ERR(0, 198, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 3); __PYX_ERR(0, 196, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 3); __PYX_ERR(0, 198, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 4); __PYX_ERR(0, 196, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, 4); __PYX_ERR(0, 198, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_angle_triclinic") < 0)) __PYX_ERR(0, 196, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_angle_triclinic") < 0)) __PYX_ERR(0, 198, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -4285,17 +4389,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_25calc_angle_triclinic } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 196, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_angle_triclinic", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 198, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_angle_triclinic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 196, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 197, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 198, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 199, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 200, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 198, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 199, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 200, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 201, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_24calc_angle_triclinic(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_coords3, __pyx_v_box, __pyx_v_results); /* function exit code */ @@ -4313,7 +4417,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_24calc_angle_triclinic __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_angle_triclinic", 0); - /* "MDAnalysis/lib/c_distances.pyx":202 + /* "MDAnalysis/lib/c_distances.pyx":204 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -4322,7 +4426,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_24calc_angle_triclinic */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":204 + /* "MDAnalysis/lib/c_distances.pyx":206 * numcoords = coords1.shape[0] * * _calc_angle_triclinic( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -4331,7 +4435,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_24calc_angle_triclinic */ _calc_angle_triclinic(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), ((coordinate *)__pyx_v_coords3->data), __pyx_v_numcoords, ((coordinate *)__pyx_v_box->data), ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":196 + /* "MDAnalysis/lib/c_distances.pyx":198 * results.data) * * def calc_angle_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4346,7 +4450,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_24calc_angle_triclinic return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":210 +/* "MDAnalysis/lib/c_distances.pyx":212 * results.data) * * def calc_dihedral(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4395,29 +4499,29 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_27calc_dihedral(PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 1); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 1); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords3)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 2); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 2); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords4)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 3); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 3); __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 4); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, 4); __PYX_ERR(0, 212, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_dihedral") < 0)) __PYX_ERR(0, 210, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_dihedral") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -4436,17 +4540,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_27calc_dihedral(PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 210, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_dihedral", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 210, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 211, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 212, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords4), __pyx_ptype_5numpy_ndarray, 1, "coords4", 0))) __PYX_ERR(0, 213, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 212, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 213, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords4), __pyx_ptype_5numpy_ndarray, 1, "coords4", 0))) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 216, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_26calc_dihedral(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_coords3, __pyx_v_coords4, __pyx_v_results); /* function exit code */ @@ -4464,7 +4568,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_26calc_dihedral(CYTHON __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_dihedral", 0); - /* "MDAnalysis/lib/c_distances.pyx":216 + /* "MDAnalysis/lib/c_distances.pyx":218 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -4473,7 +4577,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_26calc_dihedral(CYTHON */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":218 + /* "MDAnalysis/lib/c_distances.pyx":220 * numcoords = coords1.shape[0] * * _calc_dihedral( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -4482,7 +4586,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_26calc_dihedral(CYTHON */ _calc_dihedral(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), ((coordinate *)__pyx_v_coords3->data), ((coordinate *)__pyx_v_coords4->data), __pyx_v_numcoords, ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":210 + /* "MDAnalysis/lib/c_distances.pyx":212 * results.data) * * def calc_dihedral(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4497,7 +4601,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_26calc_dihedral(CYTHON return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":223 +/* "MDAnalysis/lib/c_distances.pyx":225 * results.data) * * def calc_dihedral_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4549,35 +4653,35 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_29calc_dihedral_ortho( case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 1); __PYX_ERR(0, 223, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 1); __PYX_ERR(0, 225, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords3)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 2); __PYX_ERR(0, 223, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 2); __PYX_ERR(0, 225, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords4)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 3); __PYX_ERR(0, 223, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 3); __PYX_ERR(0, 225, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 4); __PYX_ERR(0, 223, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 4); __PYX_ERR(0, 225, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 5); __PYX_ERR(0, 223, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, 5); __PYX_ERR(0, 225, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_dihedral_ortho") < 0)) __PYX_ERR(0, 223, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_dihedral_ortho") < 0)) __PYX_ERR(0, 225, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -4598,18 +4702,18 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_29calc_dihedral_ortho( } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 223, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_ortho", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 225, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_dihedral_ortho", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 223, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 224, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 225, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords4), __pyx_ptype_5numpy_ndarray, 1, "coords4", 0))) __PYX_ERR(0, 226, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 227, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 225, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 226, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 227, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords4), __pyx_ptype_5numpy_ndarray, 1, "coords4", 0))) __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_28calc_dihedral_ortho(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_coords3, __pyx_v_coords4, __pyx_v_box, __pyx_v_results); /* function exit code */ @@ -4627,7 +4731,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_28calc_dihedral_ortho( __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_dihedral_ortho", 0); - /* "MDAnalysis/lib/c_distances.pyx":230 + /* "MDAnalysis/lib/c_distances.pyx":232 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -4636,7 +4740,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_28calc_dihedral_ortho( */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":232 + /* "MDAnalysis/lib/c_distances.pyx":234 * numcoords = coords1.shape[0] * * _calc_dihedral_ortho( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -4645,7 +4749,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_28calc_dihedral_ortho( */ _calc_dihedral_ortho(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), ((coordinate *)__pyx_v_coords3->data), ((coordinate *)__pyx_v_coords4->data), __pyx_v_numcoords, ((float *)__pyx_v_box->data), ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":223 + /* "MDAnalysis/lib/c_distances.pyx":225 * results.data) * * def calc_dihedral_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4660,7 +4764,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_28calc_dihedral_ortho( return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":238 +/* "MDAnalysis/lib/c_distances.pyx":240 * results.data) * * def calc_dihedral_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4712,35 +4816,35 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_31calc_dihedral_tricli case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 1); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 1); __PYX_ERR(0, 240, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords3)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 2); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 2); __PYX_ERR(0, 240, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords4)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 3); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 3); __PYX_ERR(0, 240, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 4); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 4); __PYX_ERR(0, 240, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_results)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 5); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, 5); __PYX_ERR(0, 240, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_dihedral_triclinic") < 0)) __PYX_ERR(0, 238, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calc_dihedral_triclinic") < 0)) __PYX_ERR(0, 240, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -4761,18 +4865,18 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_31calc_dihedral_tricli } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 238, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calc_dihedral_triclinic", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 240, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.calc_dihedral_triclinic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 238, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 239, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 240, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords4), __pyx_ptype_5numpy_ndarray, 1, "coords4", 0))) __PYX_ERR(0, 241, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 242, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 240, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 241, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords3), __pyx_ptype_5numpy_ndarray, 1, "coords3", 0))) __PYX_ERR(0, 242, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords4), __pyx_ptype_5numpy_ndarray, 1, "coords4", 0))) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 244, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_results), __pyx_ptype_5numpy_ndarray, 1, "results", 0))) __PYX_ERR(0, 245, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_30calc_dihedral_triclinic(__pyx_self, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_coords3, __pyx_v_coords4, __pyx_v_box, __pyx_v_results); /* function exit code */ @@ -4790,7 +4894,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_30calc_dihedral_tricli __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("calc_dihedral_triclinic", 0); - /* "MDAnalysis/lib/c_distances.pyx":245 + /* "MDAnalysis/lib/c_distances.pyx":247 * numpy.ndarray results): * cdef int numcoords * numcoords = coords1.shape[0] # <<<<<<<<<<<<<< @@ -4799,7 +4903,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_30calc_dihedral_tricli */ __pyx_v_numcoords = (__pyx_v_coords1->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":247 + /* "MDAnalysis/lib/c_distances.pyx":249 * numcoords = coords1.shape[0] * * _calc_dihedral_triclinic( coords1.data, coords2.data, # <<<<<<<<<<<<<< @@ -4808,7 +4912,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_30calc_dihedral_tricli */ _calc_dihedral_triclinic(((coordinate *)__pyx_v_coords1->data), ((coordinate *)__pyx_v_coords2->data), ((coordinate *)__pyx_v_coords3->data), ((coordinate *)__pyx_v_coords4->data), __pyx_v_numcoords, ((coordinate *)__pyx_v_box->data), ((double *)__pyx_v_results->data)); - /* "MDAnalysis/lib/c_distances.pyx":238 + /* "MDAnalysis/lib/c_distances.pyx":240 * results.data) * * def calc_dihedral_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< @@ -4823,7 +4927,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_30calc_dihedral_tricli return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":253 +/* "MDAnalysis/lib/c_distances.pyx":255 * results.data) * * def ortho_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< @@ -4866,17 +4970,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_33ortho_pbc(PyObject * case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("ortho_pbc", 1, 3, 3, 1); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ortho_pbc", 1, 3, 3, 1); __PYX_ERR(0, 255, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box_inverse)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("ortho_pbc", 1, 3, 3, 2); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ortho_pbc", 1, 3, 3, 2); __PYX_ERR(0, 255, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ortho_pbc") < 0)) __PYX_ERR(0, 253, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ortho_pbc") < 0)) __PYX_ERR(0, 255, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -4891,15 +4995,15 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_33ortho_pbc(PyObject * } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ortho_pbc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ortho_pbc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 255, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.ortho_pbc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 253, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 254, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_inverse), __pyx_ptype_5numpy_ndarray, 1, "box_inverse", 0))) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 256, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_inverse), __pyx_ptype_5numpy_ndarray, 1, "box_inverse", 0))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_32ortho_pbc(__pyx_self, __pyx_v_coords, __pyx_v_box, __pyx_v_box_inverse); /* function exit code */ @@ -4917,7 +5021,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_32ortho_pbc(CYTHON_UNU __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ortho_pbc", 0); - /* "MDAnalysis/lib/c_distances.pyx":256 + /* "MDAnalysis/lib/c_distances.pyx":258 * numpy.ndarray box, numpy.ndarray box_inverse): * cdef int numcoords * numcoords = coords.shape[0] # <<<<<<<<<<<<<< @@ -4926,7 +5030,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_32ortho_pbc(CYTHON_UNU */ __pyx_v_numcoords = (__pyx_v_coords->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":258 + /* "MDAnalysis/lib/c_distances.pyx":260 * numcoords = coords.shape[0] * * _ortho_pbc( coords.data, numcoords, # <<<<<<<<<<<<<< @@ -4935,7 +5039,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_32ortho_pbc(CYTHON_UNU */ _ortho_pbc(((coordinate *)__pyx_v_coords->data), __pyx_v_numcoords, ((float *)__pyx_v_box->data), ((float *)__pyx_v_box_inverse->data)); - /* "MDAnalysis/lib/c_distances.pyx":253 + /* "MDAnalysis/lib/c_distances.pyx":255 * results.data) * * def ortho_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< @@ -4950,7 +5054,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_32ortho_pbc(CYTHON_UNU return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":261 +/* "MDAnalysis/lib/c_distances.pyx":263 * box.data, box_inverse.data) * * def triclinic_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< @@ -4993,17 +5097,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_35triclinic_pbc(PyObje case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("triclinic_pbc", 1, 3, 3, 1); __PYX_ERR(0, 261, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triclinic_pbc", 1, 3, 3, 1); __PYX_ERR(0, 263, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box_inverse)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("triclinic_pbc", 1, 3, 3, 2); __PYX_ERR(0, 261, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triclinic_pbc", 1, 3, 3, 2); __PYX_ERR(0, 263, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triclinic_pbc") < 0)) __PYX_ERR(0, 261, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triclinic_pbc") < 0)) __PYX_ERR(0, 263, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -5018,15 +5122,15 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_35triclinic_pbc(PyObje } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("triclinic_pbc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 261, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("triclinic_pbc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 263, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.triclinic_pbc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 261, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 262, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_inverse), __pyx_ptype_5numpy_ndarray, 1, "box_inverse", 0))) __PYX_ERR(0, 262, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) __PYX_ERR(0, 263, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_5numpy_ndarray, 1, "box", 0))) __PYX_ERR(0, 264, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box_inverse), __pyx_ptype_5numpy_ndarray, 1, "box_inverse", 0))) __PYX_ERR(0, 264, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_11c_distances_34triclinic_pbc(__pyx_self, __pyx_v_coords, __pyx_v_box, __pyx_v_box_inverse); /* function exit code */ @@ -5044,7 +5148,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_34triclinic_pbc(CYTHON __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("triclinic_pbc", 0); - /* "MDAnalysis/lib/c_distances.pyx":264 + /* "MDAnalysis/lib/c_distances.pyx":266 * numpy.ndarray box, numpy.ndarray box_inverse): * cdef int numcoords * numcoords = coords.shape[0] # <<<<<<<<<<<<<< @@ -5053,7 +5157,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_34triclinic_pbc(CYTHON */ __pyx_v_numcoords = (__pyx_v_coords->dimensions[0]); - /* "MDAnalysis/lib/c_distances.pyx":266 + /* "MDAnalysis/lib/c_distances.pyx":268 * numcoords = coords.shape[0] * * _triclinic_pbc( coords.data, numcoords, # <<<<<<<<<<<<<< @@ -5062,7 +5166,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_34triclinic_pbc(CYTHON */ _triclinic_pbc(((coordinate *)__pyx_v_coords->data), __pyx_v_numcoords, ((coordinate *)__pyx_v_box->data), ((float *)__pyx_v_box_inverse->data)); - /* "MDAnalysis/lib/c_distances.pyx":261 + /* "MDAnalysis/lib/c_distances.pyx":263 * box.data, box_inverse.data) * * def triclinic_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< @@ -5077,7 +5181,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_34triclinic_pbc(CYTHON return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":271 +/* "MDAnalysis/lib/c_distances.pyx":273 * * @cython.boundscheck(False) * def contact_matrix_no_pbc(coord, sparse_contacts, cutoff): # <<<<<<<<<<<<<< @@ -5120,17 +5224,17 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_37contact_matrix_no_pb case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_contacts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("contact_matrix_no_pbc", 1, 3, 3, 1); __PYX_ERR(0, 271, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("contact_matrix_no_pbc", 1, 3, 3, 1); __PYX_ERR(0, 273, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("contact_matrix_no_pbc", 1, 3, 3, 2); __PYX_ERR(0, 271, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("contact_matrix_no_pbc", 1, 3, 3, 2); __PYX_ERR(0, 273, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contact_matrix_no_pbc") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contact_matrix_no_pbc") < 0)) __PYX_ERR(0, 273, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -5145,7 +5249,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_37contact_matrix_no_pb } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("contact_matrix_no_pbc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("contact_matrix_no_pbc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 273, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.contact_matrix_no_pbc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5195,42 +5299,42 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb int __pyx_t_25; __Pyx_RefNannySetupContext("contact_matrix_no_pbc", 0); - /* "MDAnalysis/lib/c_distances.pyx":272 + /* "MDAnalysis/lib/c_distances.pyx":274 * @cython.boundscheck(False) * def contact_matrix_no_pbc(coord, sparse_contacts, cutoff): * cdef int rows = len(coord) # <<<<<<<<<<<<<< * cdef double cutoff2 = cutoff ** 2 * cdef float[:, ::1] coord_view = coord */ - __pyx_t_1 = PyObject_Length(__pyx_v_coord); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_coord); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) __pyx_v_rows = __pyx_t_1; - /* "MDAnalysis/lib/c_distances.pyx":273 + /* "MDAnalysis/lib/c_distances.pyx":275 * def contact_matrix_no_pbc(coord, sparse_contacts, cutoff): * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 # <<<<<<<<<<<<<< * cdef float[:, ::1] coord_view = coord * */ - __pyx_t_2 = PyNumber_Power(__pyx_v_cutoff, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_v_cutoff, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_cutoff2 = __pyx_t_3; - /* "MDAnalysis/lib/c_distances.pyx":274 + /* "MDAnalysis/lib/c_distances.pyx":276 * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 * cdef float[:, ::1] coord_view = coord # <<<<<<<<<<<<<< * * cdef int i, j */ - __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_coord, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_coord, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_v_coord_view = __pyx_t_4; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL; - /* "MDAnalysis/lib/c_distances.pyx":279 + /* "MDAnalysis/lib/c_distances.pyx":281 * cdef double[3] rr * cdef double dist * for i in range(rows): # <<<<<<<<<<<<<< @@ -5242,18 +5346,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "MDAnalysis/lib/c_distances.pyx":280 + /* "MDAnalysis/lib/c_distances.pyx":282 * cdef double dist * for i in range(rows): * sparse_contacts[i, i] = True # <<<<<<<<<<<<<< * for j in range(i+1, rows): * rr[0] = coord_view[i, 0] - coord_view[j, 0] */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); @@ -5261,10 +5365,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __pyx_t_2 = 0; __pyx_t_8 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_9, Py_True) < 0)) __PYX_ERR(0, 280, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_9, Py_True) < 0)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "MDAnalysis/lib/c_distances.pyx":281 + /* "MDAnalysis/lib/c_distances.pyx":283 * for i in range(rows): * sparse_contacts[i, i] = True * for j in range(i+1, rows): # <<<<<<<<<<<<<< @@ -5276,7 +5380,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb for (__pyx_t_12 = (__pyx_v_i + 1); __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { __pyx_v_j = __pyx_t_12; - /* "MDAnalysis/lib/c_distances.pyx":282 + /* "MDAnalysis/lib/c_distances.pyx":284 * sparse_contacts[i, i] = True * for j in range(i+1, rows): * rr[0] = coord_view[i, 0] - coord_view[j, 0] # <<<<<<<<<<<<<< @@ -5293,7 +5397,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_coord_view.shape[1]; (__pyx_v_rr[0]) = ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_13 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_14)) ))) - (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_15 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_16)) )))); - /* "MDAnalysis/lib/c_distances.pyx":283 + /* "MDAnalysis/lib/c_distances.pyx":285 * for j in range(i+1, rows): * rr[0] = coord_view[i, 0] - coord_view[j, 0] * rr[1] = coord_view[i, 1] - coord_view[j, 1] # <<<<<<<<<<<<<< @@ -5310,7 +5414,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_coord_view.shape[1]; (__pyx_v_rr[1]) = ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_17 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_18)) ))) - (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_19 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_20)) )))); - /* "MDAnalysis/lib/c_distances.pyx":284 + /* "MDAnalysis/lib/c_distances.pyx":286 * rr[0] = coord_view[i, 0] - coord_view[j, 0] * rr[1] = coord_view[i, 1] - coord_view[j, 1] * rr[2] = coord_view[i, 2] - coord_view[j, 2] # <<<<<<<<<<<<<< @@ -5327,7 +5431,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_coord_view.shape[1]; (__pyx_v_rr[2]) = ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_21 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_22)) ))) - (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_23 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_24)) )))); - /* "MDAnalysis/lib/c_distances.pyx":285 + /* "MDAnalysis/lib/c_distances.pyx":287 * rr[1] = coord_view[i, 1] - coord_view[j, 1] * rr[2] = coord_view[i, 2] - coord_view[j, 2] * dist = rr[0]*rr[0] + rr[1]*rr[1] + rr[2]*rr[2] # <<<<<<<<<<<<<< @@ -5336,7 +5440,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb */ __pyx_v_dist = ((((__pyx_v_rr[0]) * (__pyx_v_rr[0])) + ((__pyx_v_rr[1]) * (__pyx_v_rr[1]))) + ((__pyx_v_rr[2]) * (__pyx_v_rr[2]))); - /* "MDAnalysis/lib/c_distances.pyx":286 + /* "MDAnalysis/lib/c_distances.pyx":288 * rr[2] = coord_view[i, 2] - coord_view[j, 2] * dist = rr[0]*rr[0] + rr[1]*rr[1] + rr[2]*rr[2] * if dist < cutoff2: # <<<<<<<<<<<<<< @@ -5346,18 +5450,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb __pyx_t_25 = ((__pyx_v_dist < __pyx_v_cutoff2) != 0); if (__pyx_t_25) { - /* "MDAnalysis/lib/c_distances.pyx":287 + /* "MDAnalysis/lib/c_distances.pyx":289 * dist = rr[0]*rr[0] + rr[1]*rr[1] + rr[2]*rr[2] * if dist < cutoff2: * sparse_contacts[i, j] = True # <<<<<<<<<<<<<< * sparse_contacts[j, i] = True * */ - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); @@ -5365,21 +5469,21 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8); __pyx_t_9 = 0; __pyx_t_8 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_2, Py_True) < 0)) __PYX_ERR(0, 287, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_2, Py_True) < 0)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/c_distances.pyx":288 + /* "MDAnalysis/lib/c_distances.pyx":290 * if dist < cutoff2: * sparse_contacts[i, j] = True * sparse_contacts[j, i] = True # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); @@ -5387,10 +5491,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __pyx_t_2 = 0; __pyx_t_8 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_9, Py_True) < 0)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_9, Py_True) < 0)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "MDAnalysis/lib/c_distances.pyx":286 + /* "MDAnalysis/lib/c_distances.pyx":288 * rr[2] = coord_view[i, 2] - coord_view[j, 2] * dist = rr[0]*rr[0] + rr[1]*rr[1] + rr[2]*rr[2] * if dist < cutoff2: # <<<<<<<<<<<<<< @@ -5401,7 +5505,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb } } - /* "MDAnalysis/lib/c_distances.pyx":271 + /* "MDAnalysis/lib/c_distances.pyx":273 * * @cython.boundscheck(False) * def contact_matrix_no_pbc(coord, sparse_contacts, cutoff): # <<<<<<<<<<<<<< @@ -5426,7 +5530,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_36contact_matrix_no_pb return __pyx_r; } -/* "MDAnalysis/lib/c_distances.pyx":292 +/* "MDAnalysis/lib/c_distances.pyx":294 * * @cython.boundscheck(False) * def contact_matrix_pbc(coord, sparse_contacts, box, cutoff): # <<<<<<<<<<<<<< @@ -5472,23 +5576,23 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_39contact_matrix_pbc(P case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparse_contacts)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, 1); __PYX_ERR(0, 292, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, 1); __PYX_ERR(0, 294, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, 2); __PYX_ERR(0, 292, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, 2); __PYX_ERR(0, 294, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, 3); __PYX_ERR(0, 292, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, 3); __PYX_ERR(0, 294, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contact_matrix_pbc") < 0)) __PYX_ERR(0, 292, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "contact_matrix_pbc") < 0)) __PYX_ERR(0, 294, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -5505,7 +5609,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_11c_distances_39contact_matrix_pbc(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 292, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("contact_matrix_pbc", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 294, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.c_distances.contact_matrix_pbc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5560,69 +5664,69 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C int __pyx_t_28; __Pyx_RefNannySetupContext("contact_matrix_pbc", 0); - /* "MDAnalysis/lib/c_distances.pyx":293 + /* "MDAnalysis/lib/c_distances.pyx":295 * @cython.boundscheck(False) * def contact_matrix_pbc(coord, sparse_contacts, box, cutoff): * cdef int rows = len(coord) # <<<<<<<<<<<<<< * cdef double cutoff2 = cutoff ** 2 * cdef float[:, ::1] coord_view = coord */ - __pyx_t_1 = PyObject_Length(__pyx_v_coord); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_coord); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_v_rows = __pyx_t_1; - /* "MDAnalysis/lib/c_distances.pyx":294 + /* "MDAnalysis/lib/c_distances.pyx":296 * def contact_matrix_pbc(coord, sparse_contacts, box, cutoff): * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 # <<<<<<<<<<<<<< * cdef float[:, ::1] coord_view = coord * cdef float[::1] box_view = box */ - __pyx_t_2 = PyNumber_Power(__pyx_v_cutoff, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_v_cutoff, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_cutoff2 = __pyx_t_3; - /* "MDAnalysis/lib/c_distances.pyx":295 + /* "MDAnalysis/lib/c_distances.pyx":297 * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 * cdef float[:, ::1] coord_view = coord # <<<<<<<<<<<<<< * cdef float[::1] box_view = box * cdef float[::1] box_inv = 1. / box */ - __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_coord, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_coord, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_v_coord_view = __pyx_t_4; __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL; - /* "MDAnalysis/lib/c_distances.pyx":296 + /* "MDAnalysis/lib/c_distances.pyx":298 * cdef double cutoff2 = cutoff ** 2 * cdef float[:, ::1] coord_view = coord * cdef float[::1] box_view = box # <<<<<<<<<<<<<< * cdef float[::1] box_inv = 1. / box * */ - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_v_box, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_v_box, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v_box_view = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "MDAnalysis/lib/c_distances.pyx":297 + /* "MDAnalysis/lib/c_distances.pyx":299 * cdef float[:, ::1] coord_view = coord * cdef float[::1] box_view = box * cdef float[::1] box_inv = 1. / box # <<<<<<<<<<<<<< * * cdef int i, j */ - __pyx_t_2 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_, __pyx_v_box, 1., 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_, __pyx_v_box, 1., 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_box_inv = __pyx_t_5; __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "MDAnalysis/lib/c_distances.pyx":302 + /* "MDAnalysis/lib/c_distances.pyx":304 * cdef double[3] rr * cdef double dist * for i in range(rows): # <<<<<<<<<<<<<< @@ -5634,18 +5738,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "MDAnalysis/lib/c_distances.pyx":303 + /* "MDAnalysis/lib/c_distances.pyx":305 * cdef double dist * for i in range(rows): * sparse_contacts[i, i] = True # <<<<<<<<<<<<<< * for j in range(i+1, rows): * rr[0] = coord_view[i, 0] - coord_view[j, 0] */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); @@ -5653,10 +5757,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __pyx_t_2 = 0; __pyx_t_9 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_10, Py_True) < 0)) __PYX_ERR(0, 303, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_10, Py_True) < 0)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "MDAnalysis/lib/c_distances.pyx":304 + /* "MDAnalysis/lib/c_distances.pyx":306 * for i in range(rows): * sparse_contacts[i, i] = True * for j in range(i+1, rows): # <<<<<<<<<<<<<< @@ -5668,7 +5772,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C for (__pyx_t_13 = (__pyx_v_i + 1); __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_j = __pyx_t_13; - /* "MDAnalysis/lib/c_distances.pyx":305 + /* "MDAnalysis/lib/c_distances.pyx":307 * sparse_contacts[i, i] = True * for j in range(i+1, rows): * rr[0] = coord_view[i, 0] - coord_view[j, 0] # <<<<<<<<<<<<<< @@ -5685,7 +5789,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_coord_view.shape[1]; (__pyx_v_rr[0]) = ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_14 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_15)) ))) - (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_16 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_17)) )))); - /* "MDAnalysis/lib/c_distances.pyx":306 + /* "MDAnalysis/lib/c_distances.pyx":308 * for j in range(i+1, rows): * rr[0] = coord_view[i, 0] - coord_view[j, 0] * rr[1] = coord_view[i, 1] - coord_view[j, 1] # <<<<<<<<<<<<<< @@ -5702,7 +5806,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_coord_view.shape[1]; (__pyx_v_rr[1]) = ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_18 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_19)) ))) - (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_20 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_21)) )))); - /* "MDAnalysis/lib/c_distances.pyx":307 + /* "MDAnalysis/lib/c_distances.pyx":309 * rr[0] = coord_view[i, 0] - coord_view[j, 0] * rr[1] = coord_view[i, 1] - coord_view[j, 1] * rr[2] = coord_view[i, 2] - coord_view[j, 2] # <<<<<<<<<<<<<< @@ -5719,7 +5823,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_coord_view.shape[1]; (__pyx_v_rr[2]) = ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_22 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_23)) ))) - (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_coord_view.data + __pyx_t_24 * __pyx_v_coord_view.strides[0]) )) + __pyx_t_25)) )))); - /* "MDAnalysis/lib/c_distances.pyx":309 + /* "MDAnalysis/lib/c_distances.pyx":311 * rr[2] = coord_view[i, 2] - coord_view[j, 2] * * minimum_image(rr, &box_view[0], &box_inv[0]) # <<<<<<<<<<<<<< @@ -5732,7 +5836,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_box_inv.shape[0]; minimum_image(__pyx_v_rr, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_box_view.data) + __pyx_t_26)) )))), (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_box_inv.data) + __pyx_t_27)) ))))); - /* "MDAnalysis/lib/c_distances.pyx":311 + /* "MDAnalysis/lib/c_distances.pyx":313 * minimum_image(rr, &box_view[0], &box_inv[0]) * * dist = rr[0]*rr[0] + rr[1]*rr[1] + rr[2]*rr[2] # <<<<<<<<<<<<<< @@ -5741,7 +5845,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C */ __pyx_v_dist = ((((__pyx_v_rr[0]) * (__pyx_v_rr[0])) + ((__pyx_v_rr[1]) * (__pyx_v_rr[1]))) + ((__pyx_v_rr[2]) * (__pyx_v_rr[2]))); - /* "MDAnalysis/lib/c_distances.pyx":313 + /* "MDAnalysis/lib/c_distances.pyx":315 * dist = rr[0]*rr[0] + rr[1]*rr[1] + rr[2]*rr[2] * * if dist < cutoff2: # <<<<<<<<<<<<<< @@ -5751,17 +5855,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C __pyx_t_28 = ((__pyx_v_dist < __pyx_v_cutoff2) != 0); if (__pyx_t_28) { - /* "MDAnalysis/lib/c_distances.pyx":314 + /* "MDAnalysis/lib/c_distances.pyx":316 * * if dist < cutoff2: * sparse_contacts[i, j] = True # <<<<<<<<<<<<<< * sparse_contacts[j, i] = True */ - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); @@ -5769,19 +5873,19 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9); __pyx_t_10 = 0; __pyx_t_9 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_2, Py_True) < 0)) __PYX_ERR(0, 314, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_2, Py_True) < 0)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/c_distances.pyx":315 + /* "MDAnalysis/lib/c_distances.pyx":317 * if dist < cutoff2: * sparse_contacts[i, j] = True * sparse_contacts[j, i] = True # <<<<<<<<<<<<<< */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); @@ -5789,10 +5893,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __pyx_t_2 = 0; __pyx_t_9 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_10, Py_True) < 0)) __PYX_ERR(0, 315, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_sparse_contacts, __pyx_t_10, Py_True) < 0)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "MDAnalysis/lib/c_distances.pyx":313 + /* "MDAnalysis/lib/c_distances.pyx":315 * dist = rr[0]*rr[0] + rr[1]*rr[1] + rr[2]*rr[2] * * if dist < cutoff2: # <<<<<<<<<<<<<< @@ -5803,7 +5907,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C } } - /* "MDAnalysis/lib/c_distances.pyx":292 + /* "MDAnalysis/lib/c_distances.pyx":294 * * @cython.boundscheck(False) * def contact_matrix_pbc(coord, sparse_contacts, box, cutoff): # <<<<<<<<<<<<<< @@ -5831,7 +5935,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_11c_distances_38contact_matrix_pbc(C return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -5879,7 +5983,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5888,7 +5992,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5897,7 +6001,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -5906,7 +6010,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5920,7 +6024,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -5931,7 +6035,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5940,7 +6044,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -5953,7 +6057,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5962,7 +6066,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5976,7 +6080,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -5987,7 +6091,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5996,7 +6100,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -6009,7 +6113,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -6018,7 +6122,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -6027,7 +6131,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -6036,7 +6140,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6046,7 +6150,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -6055,7 +6159,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -6064,7 +6168,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -6076,7 +6180,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -6085,7 +6189,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -6095,7 +6199,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6105,7 +6209,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -6115,7 +6219,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -6126,7 +6230,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -6135,7 +6239,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -6144,7 +6248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -6153,7 +6257,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6162,7 +6266,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -6174,7 +6278,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -6187,7 +6291,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -6197,7 +6301,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -6207,7 +6311,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6227,7 +6331,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -6244,7 +6348,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6253,7 +6357,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6266,7 +6370,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6275,7 +6379,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -6287,7 +6391,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -6298,7 +6402,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -6309,7 +6413,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -6320,7 +6424,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -6331,7 +6435,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -6342,7 +6446,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -6353,7 +6457,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -6364,7 +6468,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -6375,7 +6479,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -6386,7 +6490,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -6397,7 +6501,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -6408,7 +6512,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -6419,7 +6523,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -6430,7 +6534,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -6441,7 +6545,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -6452,7 +6556,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -6464,7 +6568,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -6485,7 +6589,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -6494,7 +6598,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -6504,7 +6608,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -6513,7 +6617,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -6523,7 +6627,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -6532,7 +6636,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -6541,7 +6645,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -6551,7 +6655,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -6561,7 +6665,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -6593,7 +6697,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -6617,7 +6721,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -6627,7 +6731,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -6636,7 +6740,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -6645,7 +6749,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6655,7 +6759,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -6664,7 +6768,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6673,7 +6777,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -6685,7 +6789,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6699,7 +6803,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -6713,7 +6817,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6732,7 +6836,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6746,7 +6850,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -6760,7 +6864,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6779,7 +6883,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6793,7 +6897,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -6807,7 +6911,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6826,7 +6930,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6840,7 +6944,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -6854,7 +6958,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6873,7 +6977,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -6887,7 +6991,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -6901,7 +7005,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -6920,7 +7024,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -6934,7 +7038,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -6944,7 +7048,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -6956,7 +7060,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -6965,7 +7069,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -6979,7 +7083,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -6994,7 +7098,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -7023,7 +7127,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -7032,7 +7136,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -7041,7 +7145,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -7064,7 +7168,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -7081,7 +7185,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -7116,7 +7220,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -7133,7 +7237,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -7146,7 +7250,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -7155,7 +7259,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -7175,7 +7279,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7192,7 +7296,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -7201,7 +7305,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -7214,7 +7318,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -7223,7 +7327,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7239,7 +7343,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -7248,7 +7352,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -7257,7 +7361,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -7268,7 +7372,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -7278,7 +7382,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7288,7 +7392,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -7300,7 +7404,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7310,7 +7414,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -7323,7 +7427,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7332,7 +7436,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -7350,7 +7454,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -7368,7 +7472,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -7386,7 +7490,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -7404,7 +7508,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -7422,7 +7526,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -7440,7 +7544,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -7458,7 +7562,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -7476,7 +7580,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -7494,7 +7598,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -7512,7 +7616,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -7530,7 +7634,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -7548,7 +7652,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -7566,7 +7670,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -7586,7 +7690,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -7606,7 +7710,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -7626,7 +7730,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -7644,7 +7748,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -7663,7 +7767,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -7672,7 +7776,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7682,7 +7786,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -7695,7 +7799,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -7705,7 +7809,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -7715,7 +7819,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -7740,7 +7844,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -7755,7 +7859,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -7766,7 +7870,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -7775,7 +7879,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -7785,7 +7889,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -7795,7 +7899,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -7806,7 +7910,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -7815,7 +7919,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -7824,7 +7928,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -7836,7 +7940,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7850,7 +7954,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -7860,7 +7964,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -7871,7 +7975,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -7880,7 +7984,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -7894,7 +7998,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7909,7 +8013,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -7930,7 +8034,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7946,7 +8050,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -7955,7 +8059,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7969,7 +8073,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -7984,7 +8088,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -8000,7 +8104,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -8015,7 +8119,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -8038,7 +8142,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -8059,7 +8163,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -8075,7 +8179,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -8084,7 +8188,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -8098,7 +8202,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -8113,7 +8217,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -8129,7 +8233,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -8144,7 +8248,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -8167,7 +8271,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -8188,7 +8292,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -8204,7 +8308,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -8213,7 +8317,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -8227,7 +8331,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -8241,7 +8345,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -8255,7 +8359,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -8270,7 +8374,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -22067,7 +22171,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 281, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 229, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error) @@ -22086,7 +22190,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -22097,7 +22201,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -22108,7 +22212,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -22119,7 +22223,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -22130,7 +22234,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -22141,7 +22245,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -22152,7 +22256,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -22163,7 +22267,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -22174,7 +22278,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -22483,170 +22587,170 @@ static int __Pyx_InitCachedConstants(void) { /* "MDAnalysis/lib/c_distances.pyx":128 * result.data, distnum) * - * def coord_transform(numpy.ndarray coords, # <<<<<<<<<<<<<< - * numpy.ndarray box): - * cdef int numcoords + * def coord_transform(float[:,:] coords, # <<<<<<<<<<<<<< + * float[:,:] box): + * cdef int numcoords, size */ - __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_coords, __pyx_n_s_box, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_s_coords, __pyx_n_s_box, __pyx_n_s_numcoords, __pyx_n_s_size); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 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_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_coord_transform, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 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_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_coord_transform, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 128, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":136 - * box.data) + /* "MDAnalysis/lib/c_distances.pyx":138 + * &box[0,0]) * * def calc_bond_distance(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray results): */ - __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 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_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_bond_distance, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 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_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_bond_distance, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 138, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":146 + /* "MDAnalysis/lib/c_distances.pyx":148 * results.data) * * def calc_bond_distance_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray box, */ - __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_bond_distance_ortho, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_bond_distance_ortho, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 148, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":158 + /* "MDAnalysis/lib/c_distances.pyx":160 * results.data) * * def calc_bond_distance_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray box, */ - __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_bond_distance_triclinic, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_bond_distance_triclinic, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 160, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":170 + /* "MDAnalysis/lib/c_distances.pyx":172 * results.data) * * def calc_angle(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_angle, 170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_angle, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 172, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":182 + /* "MDAnalysis/lib/c_distances.pyx":184 * results.data) * * def calc_angle_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_tuple__53 = PyTuple_Pack(6, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_tuple__53 = PyTuple_Pack(6, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_angle_ortho, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_angle_ortho, 184, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 184, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":196 + /* "MDAnalysis/lib/c_distances.pyx":198 * results.data) * * def calc_angle_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_tuple__55 = PyTuple_Pack(6, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_tuple__55 = PyTuple_Pack(6, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_angle_triclinic, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_angle_triclinic, 198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 198, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":210 + /* "MDAnalysis/lib/c_distances.pyx":212 * results.data) * * def calc_dihedral(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_tuple__57 = PyTuple_Pack(6, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_coords4, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_tuple__57 = PyTuple_Pack(6, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_coords4, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_dihedral, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_dihedral, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 212, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":223 + /* "MDAnalysis/lib/c_distances.pyx":225 * results.data) * * def calc_dihedral_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_tuple__59 = PyTuple_Pack(7, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_coords4, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_tuple__59 = PyTuple_Pack(7, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_coords4, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_dihedral_ortho, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_dihedral_ortho, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 225, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":238 + /* "MDAnalysis/lib/c_distances.pyx":240 * results.data) * * def calc_dihedral_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_tuple__61 = PyTuple_Pack(7, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_coords4, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_tuple__61 = PyTuple_Pack(7, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_coords3, __pyx_n_s_coords4, __pyx_n_s_box, __pyx_n_s_results, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_dihedral_triclinic, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_calc_dihedral_triclinic, 240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 240, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":253 + /* "MDAnalysis/lib/c_distances.pyx":255 * results.data) * * def ortho_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< * numpy.ndarray box, numpy.ndarray box_inverse): * cdef int numcoords */ - __pyx_tuple__63 = PyTuple_Pack(4, __pyx_n_s_coords, __pyx_n_s_box, __pyx_n_s_box_inverse, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_tuple__63 = PyTuple_Pack(4, __pyx_n_s_coords, __pyx_n_s_box, __pyx_n_s_box_inverse, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_ortho_pbc, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_ortho_pbc, 255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 255, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":261 + /* "MDAnalysis/lib/c_distances.pyx":263 * box.data, box_inverse.data) * * def triclinic_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< * numpy.ndarray box, numpy.ndarray box_inverse): * cdef int numcoords */ - __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_coords, __pyx_n_s_box, __pyx_n_s_box_inverse, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_coords, __pyx_n_s_box, __pyx_n_s_box_inverse, __pyx_n_s_numcoords); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_triclinic_pbc, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_triclinic_pbc, 263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 263, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":271 + /* "MDAnalysis/lib/c_distances.pyx":273 * * @cython.boundscheck(False) * def contact_matrix_no_pbc(coord, sparse_contacts, cutoff): # <<<<<<<<<<<<<< * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 */ - __pyx_tuple__67 = PyTuple_Pack(10, __pyx_n_s_coord, __pyx_n_s_sparse_contacts, __pyx_n_s_cutoff, __pyx_n_s_rows, __pyx_n_s_cutoff2, __pyx_n_s_coord_view, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_rr, __pyx_n_s_dist); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_tuple__67 = PyTuple_Pack(10, __pyx_n_s_coord, __pyx_n_s_sparse_contacts, __pyx_n_s_cutoff, __pyx_n_s_rows, __pyx_n_s_cutoff2, __pyx_n_s_coord_view, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_rr, __pyx_n_s_dist); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); - __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_contact_matrix_no_pbc, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_contact_matrix_no_pbc, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 273, __pyx_L1_error) - /* "MDAnalysis/lib/c_distances.pyx":292 + /* "MDAnalysis/lib/c_distances.pyx":294 * * @cython.boundscheck(False) * def contact_matrix_pbc(coord, sparse_contacts, box, cutoff): # <<<<<<<<<<<<<< * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 */ - __pyx_tuple__69 = PyTuple_Pack(13, __pyx_n_s_coord, __pyx_n_s_sparse_contacts, __pyx_n_s_box, __pyx_n_s_cutoff, __pyx_n_s_rows, __pyx_n_s_cutoff2, __pyx_n_s_coord_view, __pyx_n_s_box_view, __pyx_n_s_box_inv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_rr, __pyx_n_s_dist); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_tuple__69 = PyTuple_Pack(13, __pyx_n_s_coord, __pyx_n_s_sparse_contacts, __pyx_n_s_box, __pyx_n_s_cutoff, __pyx_n_s_rows, __pyx_n_s_cutoff2, __pyx_n_s_coord_view, __pyx_n_s_box_view, __pyx_n_s_box_inv, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_rr, __pyx_n_s_dist); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); - __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_contact_matrix_pbc, 292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(4, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_c_distances_pyx, __pyx_n_s_contact_matrix_pbc, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 294, __pyx_L1_error) /* "View.MemoryView":285 * return self.name @@ -22879,8 +22983,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -23140,169 +23244,169 @@ if (!__Pyx_RefNanny) { /* "MDAnalysis/lib/c_distances.pyx":128 * result.data, distnum) * - * def coord_transform(numpy.ndarray coords, # <<<<<<<<<<<<<< - * numpy.ndarray box): - * cdef int numcoords + * def coord_transform(float[:,:] coords, # <<<<<<<<<<<<<< + * float[:,:] box): + * cdef int numcoords, size */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_13coord_transform, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_coord_transform, __pyx_t_1) < 0) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":136 - * box.data) + /* "MDAnalysis/lib/c_distances.pyx":138 + * &box[0,0]) * * def calc_bond_distance(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray results): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_15calc_bond_distance, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_15calc_bond_distance, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_bond_distance, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_bond_distance, __pyx_t_1) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":146 + /* "MDAnalysis/lib/c_distances.pyx":148 * results.data) * * def calc_bond_distance_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray box, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_17calc_bond_distance_ortho, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_17calc_bond_distance_ortho, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_bond_distance_ortho, __pyx_t_1) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_bond_distance_ortho, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":158 + /* "MDAnalysis/lib/c_distances.pyx":160 * results.data) * * def calc_bond_distance_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray box, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_19calc_bond_distance_triclinic, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_19calc_bond_distance_triclinic, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_bond_distance_triclinic, __pyx_t_1) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_bond_distance_triclinic, __pyx_t_1) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":170 + /* "MDAnalysis/lib/c_distances.pyx":172 * results.data) * * def calc_angle(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_21calc_angle, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_21calc_angle, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_angle, __pyx_t_1) < 0) __PYX_ERR(0, 170, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_angle, __pyx_t_1) < 0) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":182 + /* "MDAnalysis/lib/c_distances.pyx":184 * results.data) * * def calc_angle_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_23calc_angle_ortho, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_23calc_angle_ortho, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_angle_ortho, __pyx_t_1) < 0) __PYX_ERR(0, 182, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_angle_ortho, __pyx_t_1) < 0) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":196 + /* "MDAnalysis/lib/c_distances.pyx":198 * results.data) * * def calc_angle_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_25calc_angle_triclinic, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_25calc_angle_triclinic, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_angle_triclinic, __pyx_t_1) < 0) __PYX_ERR(0, 196, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_angle_triclinic, __pyx_t_1) < 0) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":210 + /* "MDAnalysis/lib/c_distances.pyx":212 * results.data) * * def calc_dihedral(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_27calc_dihedral, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_27calc_dihedral, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_dihedral, __pyx_t_1) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_dihedral, __pyx_t_1) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":223 + /* "MDAnalysis/lib/c_distances.pyx":225 * results.data) * * def calc_dihedral_ortho(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_29calc_dihedral_ortho, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_29calc_dihedral_ortho, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_dihedral_ortho, __pyx_t_1) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_dihedral_ortho, __pyx_t_1) < 0) __PYX_ERR(0, 225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":238 + /* "MDAnalysis/lib/c_distances.pyx":240 * results.data) * * def calc_dihedral_triclinic(numpy.ndarray coords1, # <<<<<<<<<<<<<< * numpy.ndarray coords2, * numpy.ndarray coords3, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_31calc_dihedral_triclinic, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_31calc_dihedral_triclinic, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_dihedral_triclinic, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_calc_dihedral_triclinic, __pyx_t_1) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":253 + /* "MDAnalysis/lib/c_distances.pyx":255 * results.data) * * def ortho_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< * numpy.ndarray box, numpy.ndarray box_inverse): * cdef int numcoords */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_33ortho_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_33ortho_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ortho_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ortho_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":261 + /* "MDAnalysis/lib/c_distances.pyx":263 * box.data, box_inverse.data) * * def triclinic_pbc(numpy.ndarray coords, # <<<<<<<<<<<<<< * numpy.ndarray box, numpy.ndarray box_inverse): * cdef int numcoords */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_35triclinic_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_35triclinic_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_triclinic_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 261, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_triclinic_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":271 + /* "MDAnalysis/lib/c_distances.pyx":273 * * @cython.boundscheck(False) * def contact_matrix_no_pbc(coord, sparse_contacts, cutoff): # <<<<<<<<<<<<<< * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_37contact_matrix_no_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_37contact_matrix_no_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact_matrix_no_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact_matrix_no_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/c_distances.pyx":292 + /* "MDAnalysis/lib/c_distances.pyx":294 * * @cython.boundscheck(False) * def contact_matrix_pbc(coord, sparse_contacts, box, cutoff): # <<<<<<<<<<<<<< * cdef int rows = len(coord) * cdef double cutoff2 = cutoff ** 2 */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_39contact_matrix_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_11c_distances_39contact_matrix_pbc, NULL, __pyx_n_s_MDAnalysis_lib_c_distances); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact_matrix_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 292, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_contact_matrix_pbc, __pyx_t_1) < 0) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "MDAnalysis/lib/c_distances.pyx":1 @@ -23709,6 +23813,12 @@ static CYTHON_INLINE long __Pyx_div_long(long a, long b) { return q; } +/* BufferIndexError */ +static void __Pyx_RaiseBufferIndexError(int axis) { + PyErr_Format(PyExc_IndexError, + "Out of bounds on buffer access (axis %d)", axis); +} + /* MemviewSliceInit */ static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, @@ -24377,7 +24487,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -24392,7 +24502,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -24476,7 +24586,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -24635,6 +24745,9 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -24870,7 +24983,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -25021,14 +25134,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } +/* IsLittleEndian */ + static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ + static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; } } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } + *ts = t; + return count; } - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; #ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; #endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); #ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); #endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; } } - -/* Declarations */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; } -#endif - -/* Arithmetic */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabsf(b.real) >= fabsf(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - float r = b.imag / b.real; - float s = 1.0 / (b.real + b.imag * r); - return __pyx_t_float_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - float r = b.real / b.imag; - float s = 1.0 / (b.imag + b.real * r); - return __pyx_t_float_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); - } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; } - #else - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - if (b.imag == 0) { - return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); - } else { - float denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_float_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); - } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); } - #endif - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); } - static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; } - #if 1 - static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(a, a); - case 3: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, a); - case 4: - z = __Pyx_c_prod_float(a, a); - return __Pyx_c_prod_float(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if (b.imag == 0) { - z.real = powf(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2f(0, -1); - } - } else { - r = __Pyx_c_abs_float(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; } - #endif -#endif - -/* Declarations */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; } -#endif - -/* Arithmetic */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - #if 1 - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); - } else if (fabs(b.real) >= fabs(b.imag)) { - if (b.real == 0 && b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); - } else { - double r = b.imag / b.real; - double s = 1.0 / (b.real + b.imag * r); - return __pyx_t_double_complex_from_parts( - (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); - } - } else { - double r = b.real / b.imag; - double s = 1.0 / (b.imag + b.real * r); - return __pyx_t_double_complex_from_parts( - (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; } } - #else - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - if (b.imag == 0) { - return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } +} + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; } else { - double denom = b.real * b.real + b.imag * b.imag; - return __pyx_t_double_complex_from_parts( - (a.real * b.real + a.imag * b.imag) / denom, - (a.imag * b.real - a.real * b.imag) / denom); + return 0; } } - #endif - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(a, a); - case 3: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, a); - case 4: - z = __Pyx_c_prod_double(a, a); - return __Pyx_c_prod_double(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } else if (b.imag == 0) { - z.real = pow(a.real, b.real); - z.imag = 0; - return z; - } else if (a.real > 0) { - r = a.real; - theta = 0; - } else { - r = -a.real; - theta = atan2(0, -1); - } - } else { - r = __Pyx_c_abs_double(a); - theta = atan2(a.imag, a.real); + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; } - #endif -#endif - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } } } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; } } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } + return 1; +fail: + return 0; } - -/* MemviewSliceCopyTemplate */ - static __Pyx_memviewslice -__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, - const char *mode, int ndim, - size_t sizeof_dtype, int contig_flag, - int dtype_is_object) +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) { - __Pyx_RefNannyDeclarations - int i; - __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; - struct __pyx_memoryview_obj *from_memview = from_mvs->memview; - Py_buffer *buf = &from_memview->view; - PyObject *shape_tuple = NULL; - PyObject *temp_int = NULL; - struct __pyx_array_obj *array_obj = NULL; - struct __pyx_memoryview_obj *memview_obj = NULL; - __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); - for (i = 0; i < ndim; i++) { - if (from_mvs->suboffsets[i] >= 0) { - PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " - "indirect dimensions (axis %d)", i); + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); goto fail; } } - shape_tuple = PyTuple_New(ndim); - if (unlikely(!shape_tuple)) { - goto fail; - } - __Pyx_GOTREF(shape_tuple); - for(i = 0; i < ndim; i++) { - temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); - if(unlikely(!temp_int)) { + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); goto fail; - } else { - PyTuple_SET_ITEM(shape_tuple, i, temp_int); - temp_int = NULL; } } - array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); - if (unlikely(!array_obj)) { + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); goto fail; } - __Pyx_GOTREF(array_obj); - memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( - (PyObject *) array_obj, contig_flag, - dtype_is_object, - from_mvs->memview->typeinfo); - if (unlikely(!memview_obj)) + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); goto fail; - if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) goto fail; - if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, - dtype_is_object) < 0)) + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { goto fail; + } + retval = 0; goto no_fail; fail: - __Pyx_XDECREF(new_mvs.memview); - new_mvs.memview = NULL; - new_mvs.data = NULL; + Py_XDECREF(new_memview); + retval = -1; no_fail: - __Pyx_XDECREF(shape_tuple); - __Pyx_XDECREF(temp_int); - __Pyx_XDECREF(array_obj); __Pyx_RefNannyFinishContext(); - return new_mvs; + return retval; } -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 2, + &__Pyx_TypeInfo_float, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(float *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) { + float value = __pyx_PyFloat_AsFloat(obj); + if ((value == (float)-1) && PyErr_Occurred()) + return 0; + *(float *) itemp = value; + return 1; +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { + if (is_unsigned) { if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif - } } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); #endif - return (int) -1; } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } } -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { + if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif - } } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); #endif - return (long) -1; } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } } -/* CIntFromPy */ - static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { - const char neg_one = (char) -1, const_zero = (char) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = 1.0 / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); } - return (char) val; + } else { + float r = b.real / b.imag; + float s = 1.0 / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (char) 0; - case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) - case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { - return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { - return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { - return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (char) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(char) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (char) 0; - case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) - case -2: - if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { - return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - } -#endif - if (sizeof(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - char val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0, -1); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); } -#endif - return (char) -1; + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; } - } else { - char val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; -} + #endif +#endif -/* IsLittleEndian */ - static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) -{ - union { - uint32_t u32; - uint8_t u8[4]; - } S; - S.u32 = 0x01020304; - return S.u8[0] == 4; -} - -/* BufferFormatCheck */ - static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, - __Pyx_BufFmt_StackElem* stack, - __Pyx_TypeInfo* type) { - stack[0].field = &ctx->root; - stack[0].parent_offset = 0; - ctx->root.type = type; - ctx->root.name = "buffer dtype"; - ctx->root.offset = 0; - ctx->head = stack; - ctx->head->field = &ctx->root; - ctx->fmt_offset = 0; - ctx->head->parent_offset = 0; - ctx->new_packmode = '@'; - ctx->enc_packmode = '@'; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->is_complex = 0; - ctx->is_valid_array = 0; - ctx->struct_alignment = 0; - while (type->typegroup == 'S') { - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = 0; - type = type->fields->type; - } -} -static int __Pyx_BufFmt_ParseNumber(const char** ts) { - int count; - const char* t = *ts; - if (*t < '0' || *t > '9') { - return -1; - } else { - count = *t++ - '0'; - while (*t >= '0' && *t < '9') { - count *= 10; - count += *t++ - '0'; - } - } - *ts = t; - return count; -} -static int __Pyx_BufFmt_ExpectNumber(const char **ts) { - int number = __Pyx_BufFmt_ParseNumber(ts); - if (number == -1) - PyErr_Format(PyExc_ValueError,\ - "Does not understand character buffer dtype format string ('%c')", **ts); - return number; -} -static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { - PyErr_Format(PyExc_ValueError, - "Unexpected format string character: '%c'", ch); -} -static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { - switch (ch) { - case 'c': return "'char'"; - case 'b': return "'signed char'"; - case 'B': return "'unsigned char'"; - case 'h': return "'short'"; - case 'H': return "'unsigned short'"; - case 'i': return "'int'"; - case 'I': return "'unsigned int'"; - case 'l': return "'long'"; - case 'L': return "'unsigned long'"; - case 'q': return "'long long'"; - case 'Q': return "'unsigned long long'"; - case 'f': return (is_complex ? "'complex float'" : "'float'"); - case 'd': return (is_complex ? "'complex double'" : "'double'"); - case 'g': return (is_complex ? "'complex long double'" : "'long double'"); - case 'T': return "a struct"; - case 'O': return "Python object"; - case 'P': return "a pointer"; - case 's': case 'p': return "a string"; - case 0: return "end"; - default: return "unparseable format string"; - } -} -static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return 2; - case 'i': case 'I': case 'l': case 'L': return 4; - case 'q': case 'Q': return 8; - case 'f': return (is_complex ? 8 : 4); - case 'd': return (is_complex ? 16 : 8); - case 'g': { - PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); - return 0; +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); } - case 'O': case 'P': return sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; } -} -static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { - switch (ch) { - case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(short); - case 'i': case 'I': return sizeof(int); - case 'l': case 'L': return sizeof(long); - #ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(PY_LONG_LONG); - #endif - case 'f': return sizeof(float) * (is_complex ? 2 : 1); - case 'd': return sizeof(double) * (is_complex ? 2 : 1); - case 'g': return sizeof(long double) * (is_complex ? 2 : 1); - case 'O': case 'P': return sizeof(void*); - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; } - } -} -typedef struct { char c; short x; } __Pyx_st_short; -typedef struct { char c; int x; } __Pyx_st_int; -typedef struct { char c; long x; } __Pyx_st_long; -typedef struct { char c; float x; } __Pyx_st_float; -typedef struct { char c; double x; } __Pyx_st_double; -typedef struct { char c; long double x; } __Pyx_st_longdouble; -typedef struct { char c; void *x; } __Pyx_st_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); #endif - case 'f': return sizeof(__Pyx_st_float) - sizeof(float); - case 'd': return sizeof(__Pyx_st_double) - sizeof(double); - case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); } -} -/* These are for computing the padding at the end of the struct to align - on the first member of the struct. This will probably the same as above, - but we don't have any guarantees. - */ -typedef struct { short x; char c; } __Pyx_pad_short; -typedef struct { int x; char c; } __Pyx_pad_int; -typedef struct { long x; char c; } __Pyx_pad_long; -typedef struct { float x; char c; } __Pyx_pad_float; -typedef struct { double x; char c; } __Pyx_pad_double; -typedef struct { long double x; char c; } __Pyx_pad_longdouble; -typedef struct { void *x; char c; } __Pyx_pad_void_p; -#ifdef HAVE_LONG_LONG -typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; -#endif -static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { - switch (ch) { - case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; - case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); - case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); - case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); -#ifdef HAVE_LONG_LONG - case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); -#endif - case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); - case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); - case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); - case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); - default: - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; } -} -static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { - switch (ch) { - case 'c': - return 'H'; - case 'b': case 'h': case 'i': - case 'l': case 'q': case 's': case 'p': - return 'I'; - case 'B': case 'H': case 'I': case 'L': case 'Q': - return 'U'; - case 'f': case 'd': case 'g': - return (is_complex ? 'C' : 'R'); - case 'O': - return 'O'; - case 'P': - return 'P'; - default: { - __Pyx_BufFmt_RaiseUnexpectedChar(ch); - return 0; + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; } - } -} -static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { - if (ctx->head == NULL || ctx->head->field == &ctx->root) { - const char* expected; - const char* quote; - if (ctx->head == NULL) { - expected = "end"; - quote = ""; - } else { - expected = ctx->head->field->type->name; - quote = "'"; + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; } - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected %s%s%s but got %s", - quote, expected, quote, - __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); - } else { - __Pyx_StructField* field = ctx->head->field; - __Pyx_StructField* parent = (ctx->head - 1)->field; - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", - field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), - parent->type->name, field->name); - } -} -static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { - char group; - size_t size, offset, arraysize = 1; - if (ctx->enc_type == 0) return 0; - if (ctx->head->field->type->arraysize[0]) { - int i, ndim = 0; - if (ctx->enc_type == 's' || ctx->enc_type == 'p') { - ctx->is_valid_array = ctx->head->field->type->ndim == 1; - ndim = 1; - if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { - PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %zu", - ctx->head->field->type->arraysize[0], ctx->enc_count); - return -1; + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = 1.0 / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = 1.0 / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); } } - if (!ctx->is_valid_array) { - PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", - ctx->head->field->type->ndim, ndim); - return -1; - } - for (i = 0; i < ctx->head->field->type->ndim; i++) { - arraysize *= ctx->head->field->type->arraysize[i]; - } - ctx->is_valid_array = 0; - ctx->enc_count = 1; - } - group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); - do { - __Pyx_StructField* field = ctx->head->field; - __Pyx_TypeInfo* type = field->type; - if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { - size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); - } else { - size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } } - if (ctx->enc_packmode == '@') { - size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); - size_t align_mod_offset; - if (align_at == 0) return -1; - align_mod_offset = ctx->fmt_offset % align_at; - if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; - if (ctx->struct_alignment == 0) - ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, - ctx->is_complex); + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; } - if (type->size != size || type->typegroup != group) { - if (type->typegroup == 'C' && type->fields != NULL) { - size_t parent_offset = ctx->head->parent_offset + field->offset; - ++ctx->head; - ctx->head->field = type->fields; - ctx->head->parent_offset = parent_offset; - continue; - } - if ((type->typegroup == 'H' || group == 'H') && type->size == size) { - } else { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; - } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); } - offset = ctx->head->parent_offset + field->offset; - if (ctx->fmt_offset != offset) { - PyErr_Format(PyExc_ValueError, - "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", - (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); - return -1; + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; } - ctx->fmt_offset += size; - if (arraysize) - ctx->fmt_offset += (arraysize - 1) * size; - --ctx->enc_count; - while (1) { - if (field == &ctx->root) { - ctx->head = NULL; - if (ctx->enc_count != 0) { - __Pyx_BufFmt_RaiseExpected(ctx); - return -1; + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0, -1); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum NPY_TYPES) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum NPY_TYPES) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif } - break; - } - ctx->head->field = ++field; - if (field->type == NULL) { - --ctx->head; - field = ctx->head->field; - continue; - } else if (field->type->typegroup == 'S') { - size_t parent_offset = ctx->head->parent_offset + field->offset; - if (field->type->fields->type == NULL) continue; - field = field->type->fields; - ++ctx->head; - ctx->head->field = field; - ctx->head->parent_offset = parent_offset; - break; - } else { - break; - } } - } while (ctx->enc_count); - ctx->enc_type = 0; - ctx->is_complex = 0; - return 0; + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), + little, !is_unsigned); + } } -static PyObject * -__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) { - const char *ts = *tsp; - int i = 0, number; - int ndim = ctx->head->field->type->ndim; -; - ++ts; - if (ctx->new_count != 1) { - PyErr_SetString(PyExc_ValueError, - "Cannot handle repeated arrays in format string"); - return NULL; + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - while (*ts && *ts != ')') { - switch (*ts) { - case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; - default: break; + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; } - number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) - return PyErr_Format(PyExc_ValueError, - "Expected a dimension of size %zu, got %d", - ctx->head->field->type->arraysize[i], number); - if (*ts != ',' && *ts != ')') - return PyErr_Format(PyExc_ValueError, - "Expected a comma in format string, got '%c'", *ts); - if (*ts == ',') ts++; - i++; } - if (i != ndim) - return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", - ctx->head->field->type->ndim, i); - if (!*ts) { - PyErr_SetString(PyExc_ValueError, - "Unexpected end of format string, expected ')'"); - return NULL; + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; } - ctx->is_valid_array = 1; - ctx->new_count = 1; - *tsp = ++ts; - return Py_None; + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; } -static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { - int got_Z = 0; - while (1) { - switch(*ts) { - case 0: - if (ctx->enc_type != 0 && ctx->head == NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - if (ctx->head != NULL) { - __Pyx_BufFmt_RaiseExpected(ctx); - return NULL; - } - return ts; - case ' ': - case '\r': - case '\n': - ++ts; - break; - case '<': - if (!__Pyx_Is_Little_Endian()) { - PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); - return NULL; - } - ctx->new_packmode = '='; - ++ts; - break; - case '>': - case '!': - if (__Pyx_Is_Little_Endian()) { - PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); - return NULL; + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; } - ctx->new_packmode = '='; - ++ts; - break; - case '=': - case '@': - case '^': - ctx->new_packmode = *ts++; - break; - case 'T': - { - const char* ts_after_sub; - size_t i, struct_count = ctx->new_count; - size_t struct_alignment = ctx->struct_alignment; - ctx->new_count = 1; - ++ts; - if (*ts != '{') { - PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); - return NULL; - } - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - ctx->enc_count = 0; - ctx->struct_alignment = 0; - ++ts; - ts_after_sub = ts; - for (i = 0; i != struct_count; ++i) { - ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); - if (!ts_after_sub) return NULL; - } - ts = ts_after_sub; - if (struct_alignment) ctx->struct_alignment = struct_alignment; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } } - break; - case '}': { - size_t alignment = ctx->struct_alignment; - ++ts; - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_type = 0; - if (alignment && ctx->fmt_offset % alignment) { - ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); - } +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; } - return ts; - case 'x': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->fmt_offset += ctx->new_count; - ctx->new_count = 1; - ctx->enc_count = 0; - ctx->enc_type = 0; - ctx->enc_packmode = ctx->new_packmode; - ++ts; - break; - case 'Z': - got_Z = 1; - ++ts; - if (*ts != 'f' && *ts != 'd' && *ts != 'g') { - __Pyx_BufFmt_RaiseUnexpectedChar('Z'); - return NULL; + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; } - CYTHON_FALLTHROUGH; - case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': - case 'l': case 'L': case 'q': case 'Q': - case 'f': case 'd': case 'g': - case 'O': case 'p': - if (ctx->enc_type == *ts && got_Z == ctx->is_complex && - ctx->enc_packmode == ctx->new_packmode) { - ctx->enc_count += ctx->new_count; - ctx->new_count = 1; - got_Z = 0; - ++ts; - break; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } } - CYTHON_FALLTHROUGH; - case 's': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_count = ctx->new_count; - ctx->enc_packmode = ctx->new_packmode; - ctx->enc_type = *ts; - ctx->is_complex = got_Z; - ++ts; - ctx->new_count = 1; - got_Z = 0; - break; - case ':': - ++ts; - while(*ts != ':') ++ts; - ++ts; - break; - case '(': - if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; - break; - default: { - int number = __Pyx_BufFmt_ExpectNumber(&ts); - if (number == -1) return NULL; - ctx->new_count = (size_t)number; +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; } - } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; } -/* TypeInfoCompare */ - static int -__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) -{ - int i; - if (!a || !b) - return 0; - if (a == b) - return 1; - if (a->size != b->size || a->typegroup != b->typegroup || - a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { - if (a->typegroup == 'H' || b->typegroup == 'H') { - return a->size == b->size; +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = (char) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { - return 0; - } - } - if (a->ndim) { - for (i = 0; i < a->ndim; i++) - if (a->arraysize[i] != b->arraysize[i]) - return 0; - } - if (a->typegroup == 'S') { - if (a->flags != b->flags) - return 0; - if (a->fields || b->fields) { - if (!(a->fields && b->fields)) - return 0; - for (i = 0; a->fields[i].type && b->fields[i].type; i++) { - __Pyx_StructField *field_a = a->fields + i; - __Pyx_StructField *field_b = b->fields + i; - if (field_a->offset != field_b->offset || - !__pyx_typeinfo_cmp(field_a->type, field_b->type)) - return 0; + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; } - return !a->fields[i].type && !b->fields[i].type; + return (char) val; } - } - return 1; -} - -/* MemviewSliceValidateAndInit */ - static int -__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) -{ - if (buf->shape[dim] <= 1) - return 1; - if (buf->strides) { - if (spec & __Pyx_MEMVIEW_CONTIG) { - if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { - if (buf->strides[dim] != sizeof(void *)) { - PyErr_Format(PyExc_ValueError, - "Buffer is not indirectly contiguous " - "in dimension %d.", dim); - goto fail; - } - } else if (buf->strides[dim] != buf->itemsize) { - PyErr_SetString(PyExc_ValueError, - "Buffer and memoryview are not contiguous " - "in the same dimension."); - goto fail; + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; } - } - if (spec & __Pyx_MEMVIEW_FOLLOW) { - Py_ssize_t stride = buf->strides[dim]; - if (stride < 0) - stride = -stride; - if (stride < buf->itemsize) { - PyErr_SetString(PyExc_ValueError, - "Buffer and memoryview are not contiguous " - "in the same dimension."); - goto fail; +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif } } - } else { - if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { - PyErr_Format(PyExc_ValueError, - "C-contiguous buffer is not contiguous in " - "dimension %d", dim); - goto fail; - } else if (spec & (__Pyx_MEMVIEW_PTR)) { - PyErr_Format(PyExc_ValueError, - "C-contiguous buffer is not indirect in " - "dimension %d", dim); - goto fail; - } else if (buf->suboffsets) { - PyErr_SetString(PyExc_ValueError, - "Buffer exposes suboffsets but no strides"); - goto fail; - } - } - return 1; -fail: - return 0; -} -static int -__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) -{ - if (spec & __Pyx_MEMVIEW_DIRECT) { - if (buf->suboffsets && buf->suboffsets[dim] >= 0) { - PyErr_Format(PyExc_ValueError, - "Buffer not compatible with direct access " - "in dimension %d.", dim); - goto fail; - } - } - if (spec & __Pyx_MEMVIEW_PTR) { - if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { - PyErr_Format(PyExc_ValueError, - "Buffer is not indirectly accessible " - "in dimension %d.", dim); - goto fail; - } - } - return 1; -fail: - return 0; -} -static int -__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) -{ - int i; - if (c_or_f_flag & __Pyx_IS_F_CONTIG) { - Py_ssize_t stride = 1; - for (i = 0; i < ndim; i++) { - if (stride * buf->itemsize != buf->strides[i] && - buf->shape[i] > 1) - { - PyErr_SetString(PyExc_ValueError, - "Buffer not fortran contiguous."); - goto fail; + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); } - stride = stride * buf->shape[i]; - } - } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { - Py_ssize_t stride = 1; - for (i = ndim - 1; i >- 1; i--) { - if (stride * buf->itemsize != buf->strides[i] && - buf->shape[i] > 1) { - PyErr_SetString(PyExc_ValueError, - "Buffer not C contiguous."); - goto fail; + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; } - stride = stride * buf->shape[i]; +#endif + return (char) -1; } - } - return 1; -fail: - return 0; -} -static int __Pyx_ValidateAndInit_memviewslice( - int *axes_specs, - int c_or_f_flag, - int buf_flags, - int ndim, - __Pyx_TypeInfo *dtype, - __Pyx_BufFmt_StackElem stack[], - __Pyx_memviewslice *memviewslice, - PyObject *original_obj) -{ - struct __pyx_memoryview_obj *memview, *new_memview; - __Pyx_RefNannyDeclarations - Py_buffer *buf; - int i, spec = 0, retval = -1; - __Pyx_BufFmt_Context ctx; - int from_memoryview = __pyx_memoryview_check(original_obj); - __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); - if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) - original_obj)->typeinfo)) { - memview = (struct __pyx_memoryview_obj *) original_obj; - new_memview = NULL; } else { - memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( - original_obj, buf_flags, 0, dtype); - new_memview = memview; - if (unlikely(!memview)) - goto fail; - } - buf = &memview->view; - if (buf->ndim != ndim) { - PyErr_Format(PyExc_ValueError, - "Buffer has wrong number of dimensions (expected %d, got %d)", - ndim, buf->ndim); - goto fail; - } - if (new_memview) { - __Pyx_BufFmt_Init(&ctx, stack, dtype); - if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; - } - if ((unsigned) buf->itemsize != dtype->size) { - PyErr_Format(PyExc_ValueError, - "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " - "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", - buf->itemsize, - (buf->itemsize > 1) ? "s" : "", - dtype->name, - dtype->size, - (dtype->size > 1) ? "s" : ""); - goto fail; - } - for (i = 0; i < ndim; i++) { - spec = axes_specs[i]; - if (!__pyx_check_strides(buf, i, ndim, spec)) - goto fail; - if (!__pyx_check_suboffsets(buf, i, ndim, spec)) - goto fail; - } - if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) - goto fail; - if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, - new_memview != NULL) == -1)) { - goto fail; + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; } - retval = 0; - goto no_fail; -fail: - Py_XDECREF(new_memview); - retval = -1; -no_fail: - __Pyx_RefNannyFinishContext(); - return retval; +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; } /* ObjectToMemviewSlice */ @@ -27860,6 +28039,9 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_DECREF(x); return ival; } +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } diff --git a/package/MDAnalysis/lib/c_distances.pyx b/package/MDAnalysis/lib/c_distances.pyx index 17cd22d5260..b5c8dcd6ad1 100644 --- a/package/MDAnalysis/lib/c_distances.pyx +++ b/package/MDAnalysis/lib/c_distances.pyx @@ -44,7 +44,7 @@ cdef extern from "calc_distances.h": void _calc_self_distance_array(coordinate* ref, int numref, double* distances, int distnum) void _calc_self_distance_array_ortho(coordinate* ref, int numref, float* box, double* distances, int distnum) void _calc_self_distance_array_triclinic(coordinate* ref, int numref, coordinate* box, double* distances, int distnum) - void _coord_transform(coordinate* coords, int numCoords, coordinate* box) + void _coord_transform(float* coords, int numCoords, float* box) void _calc_bond_distance(coordinate* atom1, coordinate* atom2, int numatom, double* distances) void _calc_bond_distance_ortho(coordinate* atom1, coordinate* atom2, int numatom, float*box, double* distances) void _calc_bond_distance_triclinic(coordinate* atom1, coordinate* atom2, int numatom, coordinate* box, double* distances) @@ -125,13 +125,15 @@ def calc_self_distance_array_triclinic(numpy.ndarray ref, box.data, result.data, distnum) -def coord_transform(numpy.ndarray coords, - numpy.ndarray box): - cdef int numcoords +def coord_transform(float[:,:] coords, + float[:,:] box): + cdef int numcoords, size numcoords = coords.shape[0] + size = coords.size - _coord_transform( coords.data, numcoords, - box.data) + if size > 0: + _coord_transform( &coords[0,0], numcoords, + &box[0,0]) def calc_bond_distance(numpy.ndarray coords1, numpy.ndarray coords2, diff --git a/package/MDAnalysis/lib/c_distances_openmp.c b/package/MDAnalysis/lib/c_distances_openmp.c index b1f7ae73411..beaf56097dc 100644 --- a/package/MDAnalysis/lib/c_distances_openmp.c +++ b/package/MDAnalysis/lib/c_distances_openmp.c @@ -1,36 +1,25 @@ -/* Generated by Cython 0.28.2 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { "distutils": { - "define_macros": [ - [ - "PARALLEL", - null - ] - ], "depends": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h", "MDAnalysis/lib/include/calc_distances.h" ], "extra_compile_args": [ - "-fopenmp", "-std=c99", "-ffast-math", "-O3", "-funroll-loops" ], - "extra_link_args": [ - "-fopenmp" - ], "include_dirs": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include", "MDAnalysis/lib/include" ], "libraries": [ - "m", - "gomp" + "m" ], "name": "MDAnalysis.lib.c_distances_openmp", "sources": [ @@ -48,7 +37,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_2" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -494,6 +483,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -692,7 +682,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -800,7 +790,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -838,7 +828,7 @@ static const char *__pyx_f[] = { "type.pxd", }; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -847,7 +837,7 @@ static const char *__pyx_f[] = { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -856,7 +846,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -865,7 +855,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -874,7 +864,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -883,7 +873,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -892,7 +882,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -901,7 +891,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -910,7 +900,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -919,7 +909,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -928,7 +918,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -937,7 +927,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -946,7 +936,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -955,7 +945,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -964,7 +954,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -973,7 +963,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -982,7 +972,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -991,7 +981,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1000,7 +990,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1009,7 +999,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1018,7 +1008,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1053,7 +1043,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1062,7 +1052,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1071,7 +1061,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1080,7 +1070,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -4221,7 +4211,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_18c_distances_openmp_34triclinic_pbc return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -4269,7 +4259,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4278,7 +4268,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4287,7 +4277,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -4296,7 +4286,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4310,7 +4300,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4321,7 +4311,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4330,7 +4320,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -4343,7 +4333,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4352,7 +4342,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4366,7 +4356,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -4377,7 +4367,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4386,7 +4376,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -4399,7 +4389,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4408,7 +4398,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -4417,7 +4407,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -4426,7 +4416,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4436,7 +4426,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -4445,7 +4435,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -4454,7 +4444,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -4466,7 +4456,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -4475,7 +4465,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -4485,7 +4475,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4495,7 +4485,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -4505,7 +4495,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -4516,7 +4506,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -4525,7 +4515,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -4534,7 +4524,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -4543,7 +4533,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -4552,7 +4542,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -4564,7 +4554,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -4577,7 +4567,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -4587,7 +4577,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -4597,7 +4587,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4617,7 +4607,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4634,7 +4624,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4643,7 +4633,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4656,7 +4646,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4665,7 +4655,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -4677,7 +4667,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -4688,7 +4678,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -4699,7 +4689,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -4710,7 +4700,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -4721,7 +4711,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -4732,7 +4722,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -4743,7 +4733,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -4754,7 +4744,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -4765,7 +4755,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -4776,7 +4766,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -4787,7 +4777,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -4798,7 +4788,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -4809,7 +4799,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -4820,7 +4810,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -4831,7 +4821,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -4842,7 +4832,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -4854,7 +4844,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -4875,7 +4865,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -4884,7 +4874,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -4894,7 +4884,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -4903,7 +4893,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -4913,7 +4903,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -4922,7 +4912,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -4931,7 +4921,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -4941,7 +4931,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -4951,7 +4941,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -4983,7 +4973,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5007,7 +4997,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5017,7 +5007,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -5026,7 +5016,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5035,7 +5025,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5045,7 +5035,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -5054,7 +5044,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5063,7 +5053,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5075,7 +5065,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5089,7 +5079,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -5103,7 +5093,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5122,7 +5112,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5136,7 +5126,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -5150,7 +5140,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5169,7 +5159,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5183,7 +5173,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -5197,7 +5187,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5216,7 +5206,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5230,7 +5220,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -5244,7 +5234,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5263,7 +5253,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -5277,7 +5267,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -5291,7 +5281,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -5310,7 +5300,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -5324,7 +5314,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -5334,7 +5324,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -5346,7 +5336,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -5355,7 +5345,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -5369,7 +5359,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -5384,7 +5374,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -5413,7 +5403,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5422,7 +5412,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5431,7 +5421,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5454,7 +5444,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -5471,7 +5461,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -5506,7 +5496,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -5523,7 +5513,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -5536,7 +5526,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -5545,7 +5535,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5565,7 +5555,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5582,7 +5572,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5591,7 +5581,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -5604,7 +5594,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5613,7 +5603,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -5629,7 +5619,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -5638,7 +5628,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -5647,7 +5637,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -5658,7 +5648,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -5668,7 +5658,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5678,7 +5668,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -5690,7 +5680,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5700,7 +5690,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -5713,7 +5703,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5722,7 +5712,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -5740,7 +5730,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -5758,7 +5748,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -5776,7 +5766,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -5794,7 +5784,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -5812,7 +5802,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -5830,7 +5820,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -5848,7 +5838,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -5866,7 +5856,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -5884,7 +5874,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -5902,7 +5892,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -5920,7 +5910,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -5938,7 +5928,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -5956,7 +5946,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -5976,7 +5966,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -5996,7 +5986,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -6016,7 +6006,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -6034,7 +6024,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -6053,7 +6043,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -6062,7 +6052,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -6072,7 +6062,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -6085,7 +6075,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -6095,7 +6085,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -6105,7 +6095,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -6130,7 +6120,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6145,7 +6135,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6156,7 +6146,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -6165,7 +6155,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6175,7 +6165,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -6185,7 +6175,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -6196,7 +6186,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -6205,7 +6195,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -6214,7 +6204,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6226,7 +6216,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6240,7 +6230,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6250,7 +6240,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -6261,7 +6251,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6270,7 +6260,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -6284,7 +6274,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6299,7 +6289,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -6320,7 +6310,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -6336,7 +6326,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -6345,7 +6335,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -6359,7 +6349,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -6374,7 +6364,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -6390,7 +6380,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -6405,7 +6395,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -6428,7 +6418,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -6449,7 +6439,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -6465,7 +6455,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -6474,7 +6464,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -6488,7 +6478,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -6503,7 +6493,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -6519,7 +6509,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -6534,7 +6524,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -6557,7 +6547,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6578,7 +6568,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -6594,7 +6584,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -6603,7 +6593,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -6617,7 +6607,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -6631,7 +6621,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -6645,7 +6635,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -6660,7 +6650,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -6789,7 +6779,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -6800,7 +6790,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -6811,7 +6801,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6822,7 +6812,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -6833,7 +6823,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6844,7 +6834,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -6855,7 +6845,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -6866,7 +6856,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -6877,7 +6867,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -7211,8 +7201,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -7622,7 +7612,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -8330,7 +8320,7 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -8345,7 +8335,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -8429,7 +8419,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -8534,6 +8524,9 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); @@ -9587,14 +9580,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i kwarg. Note that # the cython parallel code (prange) in parallel.distances is @@ -87,15 +91,15 @@ del importlib def _run(funcname, args=None, kwargs=None, backend="serial"): - """Helper function to select a backend function *funcname*.""" + """Helper function to select a backend function `funcname`.""" args = args if args is not None else tuple() kwargs = kwargs if kwargs is not None else dict() backend = backend.lower() try: func = getattr(_distances[backend], funcname) except KeyError: - raise ValueError("Function {0} not available with backend {1}; try one of: {2}".format( - funcname, backend, ", ".join(_distances.keys()))) + raise ValueError("Function {0} not available with backend {1}; try one " + "of: {2}".format(funcname, backend, _distances.keys())) return func(*args, **kwargs) # serial versions are always available (and are typically used within @@ -122,731 +126,1416 @@ def _run(funcname, args=None, kwargs=None, backend="serial"): from .c_distances_openmp import OPENMP_ENABLED as USED_OPENMP -def _box_check(box): - """Take a box input and deduce what type of system it represents based - on the shape of the array and whether all angles are 90. +def _check_box(box): + """Take a box input and deduce what type of system it represents based on + the shape of the array and whether all angles are 90 degrees. Parameters ---------- - box : array - Box information of unknown format. + box : array_like + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. Returns ------- boxtype : str - * ``ortho`` orthogonal box - * ``tri_vecs`` triclinic box vectors - * ``tri_box`` triclinic box lengths and angles + * ``'ortho'`` orthogonal box + * ``'tri_vecs'`` triclinic box vectors + + checked_box : numpy.ndarray (``dtype=numpy.float32``) + Array containing box information: + * If `boxtype` is ``'ortho'``, `cecked_box` will have the shape ``(3,)`` + containing the x-, y-, and z-dimensions of the orthogonal box. + * If `boxtype` is ``'tri_vecs'``, `cecked_box` will have the shape + ``(3, 3)`` containing the triclinic box vectors in a lower triangular + matrix as returned by + :meth:`~MDAnalysis.lib.mdamath.triclinic_vectors`. Raises ------ - TypeError - If box is not float32. ValueError - If box type not detected. - """ - if box.dtype != np.float32: - raise TypeError("Box must be of type float32") - - boxtype = 'unknown' - - if box.shape == (3,): - boxtype = 'ortho' - elif box.shape == (3, 3): - if np.all([box[0][1] == 0.0, # Checks that tri box is properly formatted - box[0][2] == 0.0, - box[1][2] == 0.0]): - boxtype = 'tri_vecs' - else: - boxtype = 'tri_vecs_bad' - elif box.shape == (6,): - if np.all(box[3:] == 90.): - boxtype = 'ortho' - else: - boxtype = 'tri_box' + If `box` is not of the form ``[lx, ly, lz, alpha, beta, gamma]`` + or contains data that is not convertible to ``numpy.float32``. - if boxtype == 'unknown': - raise ValueError("box input not recognised" - ", must be an array of box dimensions") + See Also + -------- + MDAnalysis.lib.mdamath.triclinic_vectors - return boxtype - -def _check_array(coords, desc): - """Check an array is a valid array of coordinates - - Must be: - (n,3) in shape - float32 data + .. versionchanged: 0.19.0 + * Enforced correspondence of `box` with specified format. + * Added automatic conversion of input to :class:`numpy.ndarray` with + dtype ``numpy.float32``. + * Now also returns the box in the format expected by low-level functions + in :mod:`~MDAnalysis.lib.c_distances`. + * Removed obsolete box types ``tri_box`` and ``tri_vecs_bad``. """ - if (coords.ndim != 2 or coords.shape[1] != 3): - raise ValueError("{0} must be a sequence of 3 dimensional coordinates" - "".format(desc)) - _check_array_dtype(coords, desc) + box = np.asarray(box, dtype=np.float32, order='C') + if box.shape != (6,): + raise ValueError("Invalid box information. Must be of the form " + "[lx, ly, lz, alpha, beta, gamma].") + if np.all(box[3:] == 90.): + return 'ortho', box[:3] + return 'tri_vecs', triclinic_vectors(box) -def _check_array_dtype(coords, desc): - """Check whether an array contains values of dtype: np.float32 or not""" - if coords.dtype != np.float32: - raise TypeError("{0} must be of type float32".format(desc)) +def _check_result_array(result, shape): + """Check if the result array is ok to use. + The `result` array must meet the following requirements: + * Must have a shape equal to `shape`. + * Its dtype must be ``numpy.float64``. -def _check_results_array(results, size): - """Check the results array is ok to use - - Must be: - same shape as size - float64 - """ - if results.shape != size: - raise ValueError("Result array has incorrect size," - "should be {0}, got {1}".format(size, results.shape)) - if results.dtype != np.float64: - raise TypeError("Results array must be of type float64") - + Paramaters + ---------- + result : numpy.ndarray or None + The result array to check. If `result` is `None``, a newly created + array of correct shape and dtype ``numpy.float64`` will be returned. + shape : tuple + The shape expected for the `result` array. -def _check_lengths_match(*arrays): - """Check all arrays are same shape""" - ref = arrays[0].shape + Returns + ------- + result : numpy.ndarray (``dtype=numpy.float64``, ``shape=shape``) + The input array or a newly created array if the input was ``None``. - if not all( a.shape == ref for a in arrays): - raise ValueError("Input arrays must all be same shape" - "Got {0}".format([a.shape for a in arrays])) + Raises + ------ + ValueError + If `result` is of incorrect shape. + TypeError + If the dtype of `result` is not ``numpy.float64``. + """ + if result is None: + return np.zeros(shape, dtype=np.float64) + if result.shape != shape: + raise ValueError("Result array has incorrect shape, should be {0}, got " + "{1}.".format(shape, result.shape)) + if result.dtype != np.float64: + raise TypeError("Result array must be of type numpy.float64, got {}." + "".format(result.dtype)) +# The following two lines would break a lot of tests. WHY?! +# if not coords.flags['C_CONTIGUOUS']: +# raise ValueError("{0} is not C-contiguous.".format(desc)) + return result + + +@check_coords('reference', 'configuration', reduce_result_if_single=False, + check_lengths_match=False) +def distance_array(reference, configuration, box=None, result=None, + backend="serial"): + """Calculate all possible distances between a reference set and another + configuration. -def distance_array(reference, configuration, box=None, result=None, backend="serial"): - """Calculate all distances between a reference set and another configuration. + If there are ``n`` positions in `reference` and ``m`` positions in + `configuration`, a distance array of shape ``(n, m)`` will be computed. - If there are *i* positions in reference, and *j* positions in configuration, - will calculate a *i* x *j* array of distances - If an *box* is supplied then a minimum image convention is used when - calculating distances. + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. - If a 2D numpy array of dtype ``numpy.float64`` with the shape ``(len(reference), - len(configuration))`` is provided in *result* then this preallocated array is - filled. This can speed up calculations. + If a 2D numpy array of dtype ``numpy.float64`` with the shape ``(n, m)`` + is provided in `result`, then this preallocated array is filled. This can + speed up calculations. Parameters ---------- - reference : numpy.array of numpy.float32 - Reference coordinate array. - configuration : numpy.array of numpy.float32 - Configuration coordinate array. - box : numpy.array or None - Dimensions of the cell; if provided, the minimum image convention is - applied. The dimensions must be provided in the same format as returned - by by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, - ly, lz, alpha, beta, gamma]``. - result : numpy.array of numpy.float64, optional - Preallocated result array which must have the - shape ``(len(ref), len(conf))`` and ``dtype=numpy.float64``. + reference : numpy.ndarray + Reference coordinate array of shape ``(3,)`` or ``(n, 3)`` (dtype is + arbitrary, will be converted to ``numpy.float32`` internally). + configuration : numpy.ndarray + Configuration coordinate array of shape ``(3,)`` or ``(m, 3)`` (dtype is + arbitrary, will be converted to ``numpy.float32`` internally). + box : array_like, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + result : numpy.ndarray, optional + Preallocated result array which must have the shape ``(n, m)`` and dtype + ``numpy.float64``. Avoids creating the array which saves time when the function - is called repeatedly. [``None``] - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + is called repeatedly. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. Returns ------- - d : numpy.array - ``(len(reference),len(configuration))`` numpy array with the distances - ``d[i,j]`` between reference coordinates `i` and configuration - coordinates `j`. - - Note - ---- - This method is slower than it could be because internally we need to make - copies of the ref and conf arrays. + d : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n, m)``) + Array containing the distances ``d[i,j]`` between reference coordinates + ``i`` and configuration coordinates ``j``. .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. + Now also accepts single coordinates as input. """ - ref = reference.copy('C') - conf = configuration.copy('C') + confnum = configuration.shape[0] + refnum = reference.shape[0] - _check_array(conf, 'conf') - _check_array(ref, 'ref') - - if box is not None: - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if (boxtype == 'tri_box'): - box = triclinic_vectors(box) - if (boxtype == 'tri_vecs_bad'): - box = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - - confnum = conf.shape[0] - refnum = ref.shape[0] - - if result is not None: - _check_results_array(result, (refnum, confnum)) - distances = np.asarray(result) - else: - distances = np.zeros((refnum, confnum), np.float64) + distances = _check_result_array(result, (refnum, confnum)) + if len(distances) == 0: + return distances if box is not None: + boxtype, box = _check_box(box) if boxtype == 'ortho': _run("calc_distance_array_ortho", - args=(ref, conf, box, distances), - backend=backend) + args=(reference, configuration, box, distances), + backend=backend) else: _run("calc_distance_array_triclinic", - args=(ref, conf, box, distances), - backend=backend) + args=(reference, configuration, box, distances), + backend=backend) else: _run("calc_distance_array", - args=(ref, conf, distances), - backend=backend) + args=(reference, configuration, distances), + backend=backend) return distances +@check_coords('reference', reduce_result_if_single=False) def self_distance_array(reference, box=None, result=None, backend="serial"): - """Calculate all distances within a configuration *reference*. + """Calculate all possible distances within a configuration `reference`. - If a *box* is supplied then a minimum image convention is used before - calculating distances. + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. If a 1D numpy array of dtype ``numpy.float64`` with the shape - ``(N*(N-1)/2)`` is provided in *result* then this preallocated array - is filled. This can speed up calculations. + ``(n*(n-1)/2,)`` is provided in `result`, then this preallocated array is + filled. This can speed up calculations. Parameters ---------- - reference : array - Reference coordinate array with ``N=len(ref)`` coordinates. - box : array or None - Dimensions of the cell; if provided, the minimum image convention is - applied. The dimensions must be provided in the same format as returned - by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, - ly, lz, alpha, beta, gamma]``. - result : array, optional - Preallocated result array which must have the shape - ``(N*(N-1)/2,)`` and dtype ``numpy.float64``. Avoids creating - the array which saves time when the function is called - repeatedly. [``None``] - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + reference : numpy.ndarray + Reference coordinate array of shape ``(3,)`` or ``(n, 3)`` (dtype is + arbitrary, will be converted to ``numpy.float32`` internally). + box : array_like, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + result : numpy.ndarray, optional + Preallocated result array which must have the shape ``(n*(n-1)/2,)`` and + dtype ``numpy.float64``. Avoids creating the array which saves time when + the function is called repeatedly. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. Returns ------- - d : array - ``N*(N-1)/2`` numpy 1D array with the distances dist[i,j] between ref - coordinates i and j at position d[k]. Loop through d: + d : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n*(n-1)/2,)``) + Array containing the distances ``dist[i,j]`` between reference + coordinates ``i`` and ``j`` at position ``d[k]``. Loop through ``d``: .. code-block:: python - for i in range(N): - for j in range(i+1, N): + for i in range(n): + for j in range(i + 1, n): k += 1 - dist[i,j] = d[k] - - Note - ---- - This method is slower than it could be because internally we need to make - copies of the coordinate arrays. + dist[i, j] = d[k] .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. """ - ref = reference.copy('C') - - _check_array(ref, 'ref') - - with_PBC = (box is not None) - if box is not None: - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if (boxtype == 'tri_box'): - box = triclinic_vectors(box) - if (boxtype == 'tri_vecs_bad'): - box = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - - refnum = ref.shape[0] + refnum = reference.shape[0] distnum = refnum * (refnum - 1) // 2 - if result is not None: - _check_results_array(result, (distnum,)) - distances = np.asarray(result) - else: - distances = np.zeros((distnum,), np.float64) + distances = _check_result_array(result, (distnum,)) + if len(distances) == 0: + return distances if box is not None: + boxtype, box = _check_box(box) if boxtype == 'ortho': _run("calc_self_distance_array_ortho", - args=(ref, box, distances), - backend=backend) + args=(reference, box, distances), + backend=backend) else: _run("calc_self_distance_array_triclinic", - args=(ref, box, distances), - backend=backend) + args=(reference, box, distances), + backend=backend) else: _run("calc_self_distance_array", - args=(ref, distances), - backend=backend) + args=(reference, distances), + backend=backend) return distances -def transform_RtoS(inputcoords, box, backend="serial"): - """Transform an array of coordinates from real space to S space (aka lambda space) +def capped_distance(reference, configuration, max_cutoff, min_cutoff=None, + box=None, method=None, return_distances=True): + """Calculates pairs of indices corresponding to entries in the `reference` + and `configuration` arrays which are separated by a distance lying within + the specified cutoff(s). Optionally, these distances can be returned as + well. + + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. + + An automatic guessing of the optimal method to calculate the distances is + included in the function. An optional keyword for the method is also + provided. Users can enforce a particular method with this functionality. + Currently brute force, grid search, and periodic KDtree methods are + implemented. + + Parameters + ----------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)``. + configuration : numpy.ndarray + Configuration coordinate array with shape ``(3,)`` or ``(m, 3)``. + max_cutoff : float + Maximum cutoff distance between the reference and configuration. + min_cutoff : float, optional + Minimum cutoff distance between reference and configuration. + box : array_like, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + method : {'bruteforce', 'nsgrid', 'pkdtree'}, optional + Keyword to override the automatic guessing of the employed search + method. + return_distances : bool, optional + If set to ``True``, distances will also be returned. + + Returns + ------- + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` and + `configuration` arrays such that the distance between them lies within + the interval (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th coordinate in `reference` and the ``j``-th coordinate in + `configuration`. + distances : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``), optional + Distances corresponding to each pair of indices. Only returned if + `return_distances` is ``True``. ``distances[k]`` corresponds to the + ``k``-th pair returned in `pairs` and gives the distance between the + coordinates ``reference[pairs[k, 0]]`` and + ``configuration[pairs[k, 1]]``. + + .. code-block:: python + + pairs, distances = capped_distances(reference, configuration, + max_cutoff, return_distances=True) + for k, [i, j] in enumerate(pairs): + coord1 = reference[i] + coord2 = configuration[j] + distance = distances[k] + + Note + ----- + Currently supports brute force, grid-based, and periodic KDtree search + methods. + + See Also + -------- + distance_array + MDAnalysis.lib.pkdtree.PeriodicKDTree.search + MDAnalysis.lib.nsgrid.FastNS.search + """ + if box is not None: + box = np.asarray(box, dtype=np.float32) + if box.shape[0] != 6: + raise ValueError("Box Argument is of incompatible type. The " + "dimension should be either None or of the form " + "[lx, ly, lz, alpha, beta, gamma]") + method = _determine_method(reference, configuration, max_cutoff, + min_cutoff=min_cutoff, box=box, method=method) + return method(reference, configuration, max_cutoff, min_cutoff=min_cutoff, + box=box, return_distances=return_distances) + + +def _determine_method(reference, configuration, max_cutoff, min_cutoff=None, + box=None, method=None): + """Guesses the fastest method for capped distance calculations based on the + size of the coordinate sets and the relative size of the target volume. + + Parameters + ---------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)``. + configuration : numpy.ndarray + Configuration coordinate array with shape ``(3,)`` or ``(m, 3)``. + max_cutoff : float + Maximum cutoff distance between `reference` and `configuration` + coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` and `configuration` + coordinates. + box : numpy.ndarray + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + method : {'bruteforce', 'nsgrid', 'pkdtree'}, optional + Keyword to override the automatic guessing of the employed search + method. + + Returns + ------- + function : callable + The function implementing the guessed (or deliberatly chosen) method. + """ + methods = {'bruteforce': _bruteforce_capped, + 'pkdtree': _pkdtree_capped, + 'nsgrid': _nsgrid_capped} + + if method is not None: + return methods[method.lower()] + + if len(reference) < 10 or len(configuration) < 10: + return methods['bruteforce'] + elif len(reference) * len(configuration) >= 1e8: + # CAUTION : for large datasets, shouldnt go into 'bruteforce' + # in any case. Arbitrary number, but can be characterized + return methods['nsgrid'] + else: + if box is None: + min_dim = np.array([reference.min(axis=0), + configuration.min(axis=0)]) + max_dim = np.array([reference.max(axis=0), + configuration.max(axis=0)]) + size = max_dim.max(axis=0) - min_dim.min(axis=0) + elif np.allclose(box[3:], 90): + size = box[:3] + else: + tribox = triclinic_vectors(box) + size = tribox.max(axis=0) - tribox.min(axis=0) + if np.any(max_cutoff > 0.3*size): + return methods['bruteforce'] + else: + return methods['nsgrid'] + + +@check_coords('reference', 'configuration', enforce_copy=False, + reduce_result_if_single=False, check_lengths_match=False) +def _bruteforce_capped(reference, configuration, max_cutoff, min_cutoff=None, + box=None, return_distances=True): + """Capped distance evaluations using a brute force method. + + Computes and returns an array containing pairs of indices corresponding to + entries in the `reference` and `configuration` arrays which are separated by + a distance lying within the specified cutoff(s). Employs naive distance + computations (brute force) to find relevant distances. + + Optionally, these distances can be returned as well. + + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. + + Parameters + ---------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)`` (dtype will + be converted to ``numpy.float32`` internally). + configuration : array + Configuration coordinate array with shape ``(3,)`` or ``(m, 3)`` (dtype + will be converted to ``numpy.float32`` internally). + max_cutoff : float + Maximum cutoff distance between `reference` and `configuration` + coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` and `configuration` + coordinates. + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + return_distances : bool, optional + If set to ``True``, distances will also be returned. + + Returns + ------- + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` and + `configuration` arrays such that the distance between them lies within + the interval (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th coordinate in `reference` and the ``j``-th coordinate in + `configuration`. + distances : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``), optional + Distances corresponding to each pair of indices. Only returned if + `return_distances` is ``True``. ``distances[k]`` corresponds to the + ``k``-th pair returned in `pairs` and gives the distance between the + coordinates ``reference[pairs[k, 0]]`` and + ``configuration[pairs[k, 1]]``. + """ + # Default return values (will be overwritten only if pairs are found): + pairs = np.empty((0, 2), dtype=np.int64) + distances = np.empty((0,), dtype=np.float64) + + if len(reference) > 0 and len(configuration) > 0: + _distances = distance_array(reference, configuration, box=box) + if min_cutoff is not None: + mask = np.where((_distances <= max_cutoff) & \ + (_distances > min_cutoff)) + else: + mask = np.where((_distances < max_cutoff)) + if mask[0].size > 0: + pairs = np.c_[mask[0], mask[1]] + if return_distances: + distances = _distances[mask] + + if return_distances: + return pairs, distances + else: + return pairs + + +@check_coords('reference', 'configuration', enforce_copy=False, + reduce_result_if_single=False, check_lengths_match=False) +def _pkdtree_capped(reference, configuration, max_cutoff, min_cutoff=None, + box=None, return_distances=True): + """Capped distance evaluations using a KDtree method. + + Computes and returns an array containing pairs of indices corresponding to + entries in the `reference` and `configuration` arrays which are separated by + a distance lying within the specified cutoff(s). Employs a (periodic) KDtree + algorithm to find relevant distances. + + Optionally, these distances can be returned as well. + + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. + + Parameters + ---------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)`` (dtype will + be converted to ``numpy.float32`` internally). + configuration : array + Configuration coordinate array with shape ``(3,)`` or ``(m, 3)`` (dtype + will be converted to ``numpy.float32`` internally). + max_cutoff : float + Maximum cutoff distance between `reference` and `configuration` + coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` and `configuration` + coordinates. + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + return_distances : bool, optional + If set to ``True``, distances will also be returned. + + Returns + ------- + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` and + `configuration` arrays such that the distance between them lies within + the interval (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th coordinate in `reference` and the ``j``-th coordinate in + `configuration`. + distances : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``), optional + Distances corresponding to each pair of indices. Only returned if + `return_distances` is ``True``. ``distances[k]`` corresponds to the + ``k``-th pair returned in `pairs` and gives the distance between the + coordinates ``reference[pairs[k, 0]]`` and + ``configuration[pairs[k, 1]]``. + """ + from .pkdtree import PeriodicKDTree # must be here to avoid circular import + + # Default return values (will be overwritten only if pairs are found): + pairs = np.empty((0, 2), dtype=np.int64) + distances = np.empty((0,), dtype=np.float64) + + if len(reference) > 0 and len(configuration) > 0: + kdtree = PeriodicKDTree(box=box) + cut = max_cutoff if box is not None else None + kdtree.set_coords(configuration, cutoff=cut) + _pairs = kdtree.search_tree(reference, max_cutoff) + if _pairs.size > 0: + pairs = _pairs + if (return_distances or (min_cutoff is not None)): + refA, refB = pairs[:, 0], pairs[:, 1] + distances = calc_bonds(reference[refA], configuration[refB], + box=box) + if min_cutoff is not None: + mask = np.where(distances > min_cutoff) + pairs, distances = pairs[mask], distances[mask] + + if return_distances: + return pairs, distances + else: + return pairs + + +@check_coords('reference', 'configuration', enforce_copy=False, + reduce_result_if_single=False, check_lengths_match=False) +def _nsgrid_capped(reference, configuration, max_cutoff, min_cutoff=None, + box=None, return_distances=True): + """Capped distance evaluations using a grid-based search method. + + Computes and returns an array containing pairs of indices corresponding to + entries in the `reference` and `configuration` arrays which are separated by + a distance lying within the specified cutoff(s). Employs a grid-based search + algorithm to find relevant distances. + + Optionally, these distances can be returned as well. + + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. + + Parameters + ---------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)`` (dtype will + be converted to ``numpy.float32`` internally). + configuration : array + Configuration coordinate array with shape ``(3,)`` or ``(m, 3)`` (dtype + will be converted to ``numpy.float32`` internally). + max_cutoff : float + Maximum cutoff distance between `reference` and `configuration` + coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` and `configuration` + coordinates. + box : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``), optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + return_distances : bool, optional + If set to ``True``, distances will also be returned. + + Returns + ------- + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` and + `configuration` arrays such that the distance between them lies within + the interval (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th coordinate in `reference` and the ``j``-th coordinate in + `configuration`. + distances : numpy.ndarray, optional + Distances corresponding to each pair of indices. Only returned if + `return_distances` is ``True``. ``distances[k]`` corresponds to the + ``k``-th pair returned in `pairs` and gives the distance between the + coordinates ``reference[pairs[k, 0]]`` and + ``configuration[pairs[k, 1]]``. + """ + # Default return values (will be overwritten only if pairs are found): + pairs = np.empty((0, 2), dtype=np.int64) + distances = np.empty((0,), dtype=np.float64) + + if len(reference) > 0 and len(configuration) > 0: + if box is None: + # create a pseudobox + # define the max range + # and supply the pseudobox + # along with only one set of coordinates + pseudobox = np.zeros(6, dtype=np.float32) + all_coords = np.concatenate([reference, configuration]) + lmax = all_coords.max(axis=0) + lmin = all_coords.min(axis=0) + # Using maximum dimension as the box size + boxsize = (lmax-lmin).max() + # to avoid failures for very close particles but with + # larger cutoff + boxsize = np.maximum(boxsize, 2 * max_cutoff) + pseudobox[:3] = 1.2 * boxsize + pseudobox[3:] = 90. + shiftref, shiftconf = reference.copy(), configuration.copy() + # Extra padding near the origin + shiftref -= lmin - 0.1*boxsize + shiftconf -= lmin - 0.1*boxsize + gridsearch = FastNS(max_cutoff, shiftconf, box=pseudobox, pbc=False) + results = gridsearch.search(shiftref) + else: + gridsearch = FastNS(max_cutoff, configuration, box=box) + results = gridsearch.search(reference) + + pairs = results.get_pairs() + if return_distances or (min_cutoff is not None): + distances = results.get_pair_distances() + if min_cutoff is not None: + idx = distances > min_cutoff + pairs, distances = pairs[idx], distances[idx] + + if return_distances: + return pairs, distances + else: + return pairs + + +def self_capped_distance(reference, max_cutoff, min_cutoff=None, box=None, + method=None): + """Calculates pairs of indices corresponding to entries in the `reference` + array which are separated by a distance lying within the specified + cutoff(s). The respective distances are returned as well. + + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. + + An automatic guessing of the optimal method to calculate the distances is + included in the function. An optional keyword for the method is also + provided. Users can enforce a particular method with this functionality. + Currently brute force, grid search, and periodic KDtree methods are + implemented. - S space represents fractional space within the unit cell for this system + Parameters + ----------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)``. + max_cutoff : float + Maximum cutoff distance between `reference` coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` coordinates. + box : array_like, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + method : {'bruteforce', 'nsgrid', 'pkdtree'}, optional + Keyword to override the automatic guessing of the employed search + method. + + Returns + ------- + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` array + such that the distance between them lies within the interval + (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th and the ``j``-th coordinate in `reference`. + distances : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``) + Distances corresponding to each pair of indices. ``distances[k]`` + corresponds to the ``k``-th pair returned in `pairs` and gives the + distance between the coordinates ``reference[pairs[k, 0]]`` and + ``reference[pairs[k, 1]]``. + + .. code-block:: python + + pairs, distances = self_capped_distances(reference, max_cutoff) + for k, [i, j] in enumerate(pairs): + coord1 = reference[i] + coord2 = reference[j] + distance = distances[k] + + + Note + ----- + Currently supports brute force, grid-based, and periodic KDtree search + methods. + + See Also + -------- + self_distance_array + MDAnalysis.lib.pkdtree.PeriodicKDTree.search + MDAnalysis.lib.nsgrid.FastNS.self_search + """ + if box is not None: + box = np.asarray(box, dtype=np.float32) + if box.shape[0] != 6: + raise ValueError("Box Argument is of incompatible type. The " + "dimension should be either None or of the form " + "[lx, ly, lz, alpha, beta, gamma]") + method = _determine_method_self(reference, max_cutoff, + min_cutoff=min_cutoff, + box=box, method=method) + return method(reference, max_cutoff, min_cutoff=min_cutoff, box=box) + + +def _determine_method_self(reference, max_cutoff, min_cutoff=None, box=None, + method=None): + """Guesses the fastest method for capped distance calculations based on the + size of the `reference` coordinate set and the relative size of the target + volume. + + Parameters + ---------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)``. + max_cutoff : float + Maximum cutoff distance between `reference` coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` coordinates. + box : numpy.ndarray + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + method : {'bruteforce', 'nsgrid', 'pkdtree'}, optional + Keyword to override the automatic guessing of the employed search + method. + + Returns + ------- + function : callable + The function implementing the guessed (or deliberatly chosen) method. + """ + methods = {'bruteforce': _bruteforce_capped_self, + 'pkdtree': _pkdtree_capped_self, + 'nsgrid': _nsgrid_capped_self} + + if method is not None: + return methods[method.lower()] + + if len(reference) < 100: + return methods['bruteforce'] + + if box is None: + min_dim = np.array([reference.min(axis=0)]) + max_dim = np.array([reference.max(axis=0)]) + size = max_dim.max(axis=0) - min_dim.min(axis=0) + elif np.allclose(box[3:], 90): + size = box[:3] + else: + tribox = triclinic_vectors(box) + size = tribox.max(axis=0) - tribox.min(axis=0) + + if max_cutoff < 0.03*size.min(): + return methods['pkdtree'] + else: + return methods['nsgrid'] + + +@check_coords('reference', enforce_copy=False, reduce_result_if_single=False) +def _bruteforce_capped_self(reference, max_cutoff, min_cutoff=None, box=None): + """Capped distance evaluations using a brute force method. + + Computes and returns an array containing pairs of indices corresponding to + entries in the `reference` array which are separated by a distance lying + within the specified cutoff(s). Employs naive distance computations (brute + force) to find relevant distances. These distances are returned as well. - Reciprocal operation to :meth:`transform_StoR` + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. Parameters ---------- - inputcoords : array - A (3,) coordinate or (n x 3) array of coordinates, type ``np.float32``. - box : array - The unitcell dimesions for this system. - The dimensions must be provided in the same format as returned - by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, - ly, lz, alpha, beta, gamma]``. - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)`` (dtype will + be converted to ``numpy.float32`` internally). + max_cutoff : float + Maximum cutoff distance between `reference` coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` coordinates. + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. Returns ------- - outcoords : array - A n x 3 array of fractional coordiantes. + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` array + such that the distance between them lies within the interval + (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th and the ``j``-th coordinate in `reference`. + distances : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``) + Distances corresponding to each pair of indices. ``distances[k]`` + corresponds to the ``k``-th pair returned in `pairs` and gives the + distance between the coordinates ``reference[pairs[k, 0]]`` and + ``reference[pairs[k, 1]]``. + """ + # Default return values (will be overwritten only if pairs are found): + pairs = np.empty((0, 2), dtype=np.int64) + distances = np.empty((0,), dtype=np.float64) + + N = len(reference) + # We're searching within a single coordinate set, so we need at least two + # coordinates to find distances between them. + if N > 1: + distvec = self_distance_array(reference, box=box) + dist = np.full((N, N), max_cutoff, dtype=np.float64) + dist[np.triu_indices(N, 1)] = distvec + + if min_cutoff is not None: + mask = np.where((dist < max_cutoff) & (dist > min_cutoff)) + else: + mask = np.where((dist < max_cutoff)) + + if mask[0].size > 0: + pairs = np.c_[mask[0], mask[1]] + distances = dist[mask] + return pairs, distances + + +@check_coords('reference', enforce_copy=False, reduce_result_if_single=False) +def _pkdtree_capped_self(reference, max_cutoff, min_cutoff=None, box=None): + """Capped distance evaluations using a KDtree method. + + Computes and returns an array containing pairs of indices corresponding to + entries in the `reference` array which are separated by a distance lying + within the specified cutoff(s). Employs a (periodic) KDtree algorithm to + find relevant distances. These distances are returned as well. + + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. + + Parameters + ---------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)`` (dtype will + be converted to ``numpy.float32`` internally). + max_cutoff : float + Maximum cutoff distance between `reference` coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` coordinates. + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + + Returns + ------- + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` array + such that the distance between them lies within the interval + (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th and the ``j``-th coordinate in `reference`. + distances : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``) + Distances corresponding to each pair of indices. ``distances[k]`` + corresponds to the ``k``-th pair returned in `pairs` and gives the + distance between the coordinates ``reference[pairs[k, 0]]`` and + ``reference[pairs[k, 1]]``. + """ + from .pkdtree import PeriodicKDTree # must be here to avoid circular import + + # Default return values (will be overwritten only if pairs are found): + pairs = np.empty((0, 2), dtype=np.int64) + distances = np.empty((0,), dtype=np.float64) + + # We're searching within a single coordinate set, so we need at least two + # coordinates to find distances between them. + if len(reference) > 1: + kdtree = PeriodicKDTree(box=box) + cut = max_cutoff if box is not None else None + kdtree.set_coords(reference, cutoff=cut) + _pairs = kdtree.search_pairs(max_cutoff) + if _pairs.size > 0: + pairs = _pairs + refA, refB = pairs[:, 0], pairs[:, 1] + distances = calc_bonds(reference[refA], reference[refB], box=box) + if min_cutoff is not None: + idx = distances > min_cutoff + pairs, distances = pairs[idx], distances[idx] + return pairs, distances + +@check_coords('reference', enforce_copy=False, reduce_result_if_single=False) +def _nsgrid_capped_self(reference, max_cutoff, min_cutoff=None, box=None): + """Capped distance evaluations using a grid-based search method. + + Computes and returns an array containing pairs of indices corresponding to + entries in the `reference` array which are separated by a distance lying + within the specified cutoff(s). Employs a grid-based search algorithm to + find relevant distances. These distances are returned as well. + + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. + + Parameters + ---------- + reference : numpy.ndarray + Reference coordinate array with shape ``(3,)`` or ``(n, 3)`` (dtype will + be converted to ``numpy.float32`` internally). + max_cutoff : float + Maximum cutoff distance between `reference` coordinates. + min_cutoff : float, optional + Minimum cutoff distance between `reference` coordinates. + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + + Returns + ------- + pairs : numpy.ndarray (``dtype=numpy.int64``, ``shape=(n_pairs, 2)``) + Pairs of indices, corresponding to coordinates in the `reference` array + such that the distance between them lies within the interval + (`min_cutoff`, `max_cutoff`]. + Each row in `pairs` is an index pair ``[i, j]`` corresponding to the + ``i``-th and the ``j``-th coordinate in `reference`. + distances : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n_pairs,)``) + Distances corresponding to each pair of indices. ``distances[k]`` + corresponds to the ``k``-th pair returned in `pairs` and gives the + distance between the coordinates ``reference[pairs[k, 0]]`` and + ``reference[pairs[k, 1]]``. + """ + # Default return values (will be overwritten only if pairs are found): + pairs = np.empty((0, 2), dtype=np.int64) + distances = np.empty((0,), dtype=np.float64) + + # We're searching within a single coordinate set, so we need at least two + # coordinates to find distances between them. + if len(reference) > 1: + if box is None: + # create a pseudobox + # define the max range + # and supply the pseudobox + # along with only one set of coordinates + pseudobox = np.zeros(6, dtype=np.float32) + lmax = reference.max(axis=0) + lmin = reference.min(axis=0) + # Using maximum dimension as the box size + boxsize = (lmax-lmin).max() + # to avoid failures of very close particles + # but with larger cutoff + if boxsize < 2*max_cutoff: + # just enough box size so that NSGrid doesnot fails + sizefactor = 2.2*max_cutoff/boxsize + else: + sizefactor = 1.2 + pseudobox[:3] = sizefactor*boxsize + pseudobox[3:] = 90. + shiftref = reference.copy() + # Extra padding near the origin + shiftref -= lmin - 0.1*boxsize + gridsearch = FastNS(max_cutoff, shiftref, box=pseudobox, pbc=False) + results = gridsearch.self_search() + else: + gridsearch = FastNS(max_cutoff, reference, box=box) + results = gridsearch.self_search() + + pairs = results.get_pairs()[::2, :] + distances = results.get_pair_distances()[::2] + if min_cutoff is not None: + idx = distances > min_cutoff + pairs, distances = pairs[idx], distances[idx] + + return pairs, distances + + +@check_coords('coords') +def transform_RtoS(coords, box, backend="serial"): + """Transform an array of coordinates from real space to S space (a.k.a. + lambda space) + + S space represents fractional space within the unit cell for this system. + + Reciprocal operation to :meth:`transform_StoR`. + + Parameters + ---------- + coords : numpy.ndarray + A ``(3,)`` or ``(n, 3)`` array of coordinates (dtype is arbitrary, will + be converted to ``numpy.float32`` internally). + box : numpy.ndarray + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. + + Returns + ------- + newcoords : numpy.ndarray (``dtype=numpy.float32``, ``shape=coords.shape``) + An array containing fractional coordiantes. + .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. + Now also accepts (and, likewise, returns) a single coordinate. """ - coords = inputcoords.copy('C') - - is_1d = False # True if only one vector coordinate - if len(coords.shape) == 1: - coords = coords.reshape(1, len(coords)) - is_1d = True - - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if (boxtype == 'tri_box'): - box = triclinic_vectors(box) - if (boxtype == 'tri_vecs_bad'): - box = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - elif (boxtype == 'ortho'): - box = np.array([[box[0], 0.0, 0.0], - [0.0, box[1], 0.0], - [0.0, 0.0, box[2]]], dtype=np.float32) + if len(coords) == 0: + return coords + boxtype, box = _check_box(box) + if boxtype == 'ortho': + box = np.diag(box) # Create inverse matrix of box # need order C here - inv = np.array(np.matrix(box).I, dtype=np.float32, order='C') + inv = np.array(np.linalg.inv(box), dtype=np.float32, order='C') - _run("coord_transform", - args=(coords, inv), - backend=backend) + _run("coord_transform", args=(coords, inv), backend=backend) - if is_1d: - coords = coords.reshape(len(coords[0]), ) return coords -def transform_StoR(inputcoords, box, backend="serial"): +@check_coords('coords') +def transform_StoR(coords, box, backend="serial"): """Transform an array of coordinates from S space into real space. - S space represents fractional space within the unit cell for this system + S space represents fractional space within the unit cell for this system. Reciprocal operation to :meth:`transform_RtoS` Parameters ---------- - inputcoords : array - A (3,) coordinate or (n x 3) array of coordinates, type ``np.float32``. - box : array - The unitcell dimesions for this system. - The dimensions must be provided in the same format as returned - by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, - ly, lz, alpha, beta, gamma]``. - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + coords : numpy.ndarray + A ``(3,)`` or ``(n, 3)`` array of coordinates (dtype is arbitrary, will + be converted to ``numpy.float32`` internally). + box : numpy.ndarray + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. Returns ------- - outcoords : array - A n x 3 array of fracional coordiantes. + newcoords : numpy.ndarray (``dtype=numpy.float32``, ``shape=coords.shape``) + An array containing real space coordiantes. .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. + Now also accepts (and, likewise, returns) a single coordinate. """ - _check_array_dtype(inputcoords, 'S') - coords = inputcoords.copy('C') - - is_1d = False # True if only one vector coordinate - if len(coords.shape) == 1: - coords = coords.reshape(1, len(coords)) - is_1d = True - - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if (boxtype == 'tri_box'): - box = triclinic_vectors(box) - elif (boxtype == 'ortho'): - box = np.array([[box[0], 0.0, 0.0], - [0.0, box[1], 0.0], - [0.0, 0.0, box[2]]], dtype=np.float32) - - _run("coord_transform", - args=(coords, box), - backend=backend) - - if is_1d: - coords = coords.reshape(len(coords[0]),) + if len(coords) == 0: + return coords + boxtype, box = _check_box(box) + if boxtype == 'ortho': + box = np.diag(box) + + _run("coord_transform", args=(coords, box), backend=backend) return coords +@check_coords('coords1', 'coords2') def calc_bonds(coords1, coords2, box=None, result=None, backend="serial"): - """ - Calculate all distances between a pair of atoms. *atom1* and *atom2* are both - arrays of coordinates, where atom1[i] and atom2[i] represent a bond. + """Calculates the bond lengths between pairs of atom positions from the two + coordinate arrays `coords1` and `coords2`, which must contain the same + number of coordinates. ``coords1[i]`` and ``coords2[i]`` represent the + positions of atoms connected by the ``i``-th bond. If single coordinates are + supplied, a single distance will be returned. - In comparison to distance_array and self_distance_array which calculate distances - between all combinations of coordinates, calc_bonds can be used to calculate distance - between pairs of objects, similar to:: + In comparison to :meth:`distance_array` and :meth:`self_distance_array`, + which calculate distances between all possible combinations of coordinates, + :meth:`calc_bonds` only calculates distances between pairs of coordinates, + similar to:: numpy.linalg.norm(a - b) for a, b in zip(coords1, coords2) - The optional argument *box* applies minimum image convention if supplied. - *box* can be either orthogonal or triclinic + If the optional argument `box` is supplied, the minimum image convention is + applied when calculating distances. Either orthogonal or triclinic boxes are + supported. - If a 1D numpy array of dtype ``numpy.float64`` with ``len(atom1)`` elements is - provided in *result* then this preallocated array is filled. This can speed - up calculations. - - bondlengths = calc_bonds(coords1, coords2 [, box [,result=bondlengths]]) + If a numpy array of dtype ``numpy.float64`` with shape ``(n,)`` (for ``n`` + coordinate pairs) is provided in `result`, then this preallocated array is + filled. This can speed up calculations. Parameters ---------- - coords1 : array - An array of coordinates for one half of the bond. - coords2 : array - An array of coordinates for the other half of bond - box : array - The unitcell dimesions for this system. - The dimensions must be provided in the same format as returned - by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, - ly, lz, alpha, beta, gamma]``. - result : array, optional - Preallocated result array which must be same length as coord - arrays and ``dtype=numpy.float64``. Avoids creating the - array which saves time when the function is called repeatedly. [None] - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + coords1 : numpy.ndarray + Coordinate array of shape ``(3,)`` or ``(n, 3)`` for one half of a + single or ``n`` bonds, respectively (dtype is arbitrary, will be + converted to ``numpy.float32`` internally). + coords2 : numpy.ndarray + Coordinate array of shape ``(3,)`` or ``(n, 3)`` for the other half of + a single or ``n`` bonds, respectively (dtype is arbitrary, will be + converted to ``numpy.float32`` internally). + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + result : numpy.ndarray, optional + Preallocated result array of dtype ``numpy.float64`` and shape ``(n,)`` + (for ``n`` coordinate pairs). Avoids recreating the array in repeated + function calls. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. Returns ------- - bondlengths : array - The length between each pair in coords1 and coords2 + bondlengths : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n,)``) or numpy.float64 + Array containing the bond lengths between each pair of coordinates. If + two single coordinates were supplied, their distance is returned as a + single number instead of an array. .. versionadded:: 0.8 .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. + Now also accepts single coordinates as input. """ - atom1 = coords1.copy('C') - atom2 = coords2.copy('C') + numatom = coords1.shape[0] + bondlengths = _check_result_array(result, (numatom,)) + + if numatom > 0: + if box is not None: + boxtype, box = _check_box(box) + if boxtype == 'ortho': + _run("calc_bond_distance_ortho", + args=(coords1, coords2, box, bondlengths), + backend=backend) + else: + _run("calc_bond_distance_triclinic", + args=(coords1, coords2, box, bondlengths), + backend=backend) + else: + _run("calc_bond_distance", + args=(coords1, coords2, bondlengths), + backend=backend) - _check_array(atom1, 'atom1') - _check_array(atom2, 'atom2') - _check_lengths_match(atom1, atom2) + return bondlengths - if box is not None: - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if (boxtype == 'tri_box'): - box = triclinic_vectors(box) - if (boxtype == 'tri_vecs_bad'): - box = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - - numatom = atom1.shape[0] - - if result is not None: - _check_results_array(result, (numatom,)) - distances = np.asarray(result) - else: - distances = np.zeros((numatom,), np.float64) - if box is not None: - if boxtype == 'ortho': - _run("calc_bond_distance_ortho", - args=(atom1, atom2, box, distances), - backend=backend) - else: - _run("calc_bond_distance_triclinic", - args=(atom1, atom2, box, distances), - backend=backend) - else: - _run("calc_bond_distance", - args=(atom1, atom2, distances), - backend=backend) +@check_coords('coords1', 'coords2', 'coords3') +def calc_angles(coords1, coords2, coords3, box=None, result=None, + backend="serial"): + """Calculates the angles formed between triplets of atom positions from the + three coordinate arrays `coords1`, `coords2`, and `coords3`. All coordinate + arrays must contain the same number of coordinates. - return distances + The coordinates in `coords2` represent the apices of the angles:: + 2---3 + / + 1 -def calc_angles(coords1, coords2, coords3, box=None, result=None, backend="serial"): - """ - Calculates the angle formed between three atoms, over a list of coordinates. - All *atom* inputs are lists of coordinates of equal length, with *atom2* - representing the apex of the angle. - - If a 1D numpy array of dtype ``numpy.float64`` with ``len(atom1)`` elements is - provided in *result* then this preallocated array is filled. This can speed - up calculations. + Configurations where the angle is undefined (e.g., when coordinates 1 or 3 + of a triplet coincide with coordinate 2) result in a value of **zero** for + that angle. - The optional argument ``box`` ensures that periodic boundaries are taken into account when - constructing the connecting vectors between atoms, ie that the vector between atoms 1 & 2 - goes between coordinates in the same image. + If the optional argument `box` is supplied, periodic boundaries are taken + into account when constructing the connecting vectors between coordinates, + i.e., the minimum image convention is applied for the vectors forming the + angles. Either orthogonal or triclinic boxes are supported. - angles = calc_angles(coords1, coords2, coords3, [[box=None],result=angles]) + If a numpy array of dtype ``numpy.float64`` with shape ``(n,)`` (for ``n`` + coordinate triplets) is provided in `result`, then this preallocated array + is filled. This can speed up calculations. Parameters ---------- - coords1 : array - Coordinate array of one side of angles. - coords2 : array - Coordinate array of apex of angles. - coords3 : array - Coordinate array of other side of angles. - box : array - The unitcell dimesions for this system. - The dimensions must be provided in the same format as returned - by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, - ly, lz, alpha, beta, gamma]``. - result : array, optional - Preallocated result array which must be same length as coord - arrays and ``dtype=numpy.float64``. Avoids creating the - array which saves time when the function is called repeatedly. [None] - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + coords1 : numpy.ndarray + Array of shape ``(3,)`` or ``(n, 3)`` containing the coordinates of one + side of a single or ``n`` angles, respectively (dtype is arbitrary, will + be converted to ``numpy.float32`` internally) + coords2 : numpy.ndarray + Array of shape ``(3,)`` or ``(n, 3)`` containing the coordinates of the + apices of a single or ``n`` angles, respectively (dtype is arbitrary, + will be converted to ``numpy.float32`` internally) + coords3 : numpy.ndarray + Array of shape ``(3,)`` or ``(n, 3)`` containing the coordinates of the + other side of a single or ``n`` angles, respectively (dtype is + arbitrary, will be converted to ``numpy.float32`` internally) + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + result : numpy.ndarray, optional + Preallocated result array of dtype ``numpy.float64`` and shape ``(n,)`` + (for ``n`` coordinate triplets). Avoids recreating the array in repeated + function calls. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. Returns ------- - angles : array - A numpy.array of angles in radians. + angles : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n,)``) or numpy.float64 + Array containing the angles between each triplet of coordinates. Values + are returned in radians (rad). If three single coordinates were + supplied, the angle is returned as a single number instead of an array. .. versionadded:: 0.8 .. versionchanged:: 0.9.0 - Added optional box argument to account for periodic boundaries in calculation + Added optional box argument to account for periodic boundaries in + calculation .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. + Now also accepts single coordinates as input. """ - atom1 = coords1.copy('C') - atom2 = coords2.copy('C') - atom3 = coords3.copy('C') - numatom = atom1.shape[0] - - _check_array(atom1, 'coords1') - _check_array(atom2, 'coords2') - _check_array(atom3, 'coords3') - _check_lengths_match(atom1, atom2, atom3) - - if box is not None: - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if (boxtype == 'tri_box'): - box = triclinic_vectors(box) - if (boxtype == 'tri_vecs_bad'): - box = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - - if result is not None: - _check_results_array(result, (numatom,)) - angles = np.asarray(result) - else: - angles = np.zeros((numatom,), np.float64) - - if box is not None: - if boxtype == 'ortho': - _run("calc_angle_ortho", - args=(atom1, atom2, atom3, box, angles), - backend=backend) + numatom = coords1.shape[0] + angles = _check_result_array(result, (numatom,)) + + if numatom > 0: + if box is not None: + boxtype, box = _check_box(box) + if boxtype == 'ortho': + _run("calc_angle_ortho", + args=(coords1, coords2, coords3, box, angles), + backend=backend) + else: + _run("calc_angle_triclinic", + args=(coords1, coords2, coords3, box, angles), + backend=backend) else: - _run("calc_angle_triclinic", - args=(atom1, atom2, atom3, box, angles), + _run("calc_angle", + args=(coords1, coords2, coords3, angles), backend=backend) - else: - _run("calc_angle", - args=(atom1, atom2, atom3, angles), - backend=backend) return angles +@check_coords('coords1', 'coords2', 'coords3', 'coords4') def calc_dihedrals(coords1, coords2, coords3, coords4, box=None, result=None, backend="serial"): - """ - Calculate the dihedral angle formed by four atoms, over a list of coordinates. + """Calculates the dihedral angles formed between quadruplets of positions + from the four coordinate arrays `coords1`, `coords2`, `coords3`, and + `coords4`, which must contain the same number of coordinates. - Dihedral angle around axis connecting atoms 1 and 2 (i.e. the angle - between the planes spanned by atoms (0,1,2) and (1,2,3)):: + The dihedral angle formed by a quadruplet of positions (1,2,3,4) is + calculated around the axis connecting positions 2 and 3 (i.e., the angle + between the planes spanned by positions (1,2,3) and (2,3,4)):: - 3 + 4 | - 1-----2 + 2-----3 / - 0 + 1 - If a 1D numpy array of dtype ``numpy.float64`` with ``len(atom1)`` elements - is provided in *result* then this preallocated array is filled. This can - speed up calculations. + If all coordinates lie in the same plane, the cis configuration corresponds + to a dihedral angle of zero, and the trans configuration to :math:`\pi` + radians (180 degrees). Configurations where the dihedral angle is undefined + (e.g., when all coordinates lie on the same straight line) result in a value + of ``nan`` (not a number) for that dihedral. - The optional argument ``box`` ensures that periodic boundaries are taken - into account when constructing the connecting vectors between atoms, ie - that the vector between atoms 1 & 2 goes between coordinates in the same - image:: + If the optional argument `box` is supplied, periodic boundaries are taken + into account when constructing the connecting vectors between coordinates, + i.e., the minimum image convention is applied for the vectors forming the + dihedral angles. Either orthogonal or triclinic boxes are supported. - angles = calc_dihedrals(coords1, coords2, coords3, coords4 [,box=box, result=angles]) + If a numpy array of dtype ``numpy.float64`` with shape ``(n,)`` (for ``n`` + coordinate quadruplets) is provided in `result` then this preallocated array + is filled. This can speed up calculations. Parameters ---------- - coords1 : array - Coordinate array of 1st atom in dihedrals. - coords2 : array - Coordinate array of 2nd atom in dihedrals. - coords3 : array - Coordinate array of 3rd atom in dihedrals. - coords4 : array - Coordinate array of 4th atom in dihedrals. - box : array - The unitcell dimesions for this system. - The dimensions must be provided in the same format as returned - by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, - ly, lz, alpha, beta, gamma]``. - result : array, optional - Preallocated result array which must be same length as coord - arrays and ``dtype=numpy.float64``. Avoids creating the - array which saves time when the function is called repeatedly. [None] - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + coords1 : numpy.ndarray + Coordinate array of shape ``(3,)`` or ``(n, 3)`` containing the 1st + positions in dihedrals (dtype is arbitrary, will be converted to + ``numpy.float32`` internally) + coords2 : numpy.ndarray + Coordinate array of shape ``(3,)`` or ``(n, 3)`` containing the 2nd + positions in dihedrals (dtype is arbitrary, will be converted to + ``numpy.float32`` internally) + coords3 : numpy.ndarray + Coordinate array of shape ``(3,)`` or ``(n, 3)`` containing the 3rd + positions in dihedrals (dtype is arbitrary, will be converted to + ``numpy.float32`` internally) + coords4 : numpy.ndarray + Coordinate array of shape ``(3,)`` or ``(n, 3)`` containing the 4th + positions in dihedrals (dtype is arbitrary, will be converted to + ``numpy.float32`` internally) + box : numpy.ndarray, optional + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + result : numpy.ndarray, optional + Preallocated result array of dtype ``numpy.float64`` and shape ``(n,)`` + (for ``n`` coordinate quadruplets). Avoids recreating the array in + repeated function calls. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. Returns ------- - angles : array - A numpy.array of angles in radians. + dihedrals : numpy.ndarray (``dtype=numpy.float64``, ``shape=(n,)``) or numpy.float64 + Array containing the dihedral angles formed by each quadruplet of + coordinates. Values are returned in radians (rad). If four single + coordinates were supplied, the dihedral angle is returned as a single + number instead of an array. .. versionadded:: 0.8 .. versionchanged:: 0.9.0 - Added optional box argument to account for periodic boundaries in calculation + Added optional box argument to account for periodic boundaries in + calculation .. versionchanged:: 0.11.0 Renamed from calc_torsions to calc_dihedrals .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. + Now also accepts single coordinates as input. """ - atom1 = coords1.copy('C') - atom2 = coords2.copy('C') - atom3 = coords3.copy('C') - atom4 = coords4.copy('C') - - _check_array(atom1, 'atom1') - _check_array(atom2, 'atom2') - _check_array(atom3, 'atom3') - _check_array(atom4, 'atom4') - _check_lengths_match(atom1, atom2, atom3, atom4) - - numatom = atom1.shape[0] - - if box is not None: - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if (boxtype == 'tri_box'): - box = triclinic_vectors(box) - if (boxtype == 'tri_vecs_bad'): - box = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - - if result is not None: - _check_results_array(result, (numatom,)) - angles = np.asarray(result) - else: - angles = np.zeros((numatom,), np.float64) - - if box is not None: - if boxtype == 'ortho': - _run("calc_dihedral_ortho", - args=(atom1, atom2, atom3, atom4, box, angles), - backend=backend) + numatom = coords1.shape[0] + dihedrals = _check_result_array(result, (numatom,)) + + if numatom > 0: + if box is not None: + boxtype, box = _check_box(box) + if boxtype == 'ortho': + _run("calc_dihedral_ortho", + args=(coords1, coords2, coords3, coords4, box, dihedrals), + backend=backend) + else: + _run("calc_dihedral_triclinic", + args=(coords1, coords2, coords3, coords4, box, dihedrals), + backend=backend) else: - _run("calc_dihedral_triclinic", - args=(atom1, atom2, atom3, atom4, box, angles), - backend=backend) - else: - _run("calc_dihedral", - args=(atom1, atom2, atom3, atom4, angles), - backend=backend) - - return angles + _run("calc_dihedral", + args=(coords1, coords2, coords3, coords4, dihedrals), + backend=backend) + return dihedrals -def apply_PBC(incoords, box, backend="serial"): - """Moves a set of coordinates to all be within the primary unit cell - newcoords = apply_PBC(coords, box) +@check_coords('coords') +def apply_PBC(coords, box, backend="serial"): + """Moves coordinates into the primary unit cell. Parameters ---------- - coords : array - Coordinate array (of type numpy.float32). - box : array - The unitcell dimesions for this system; can be either orthogonal or - triclinic information. The dimensions must be provided in the same - format as returned by - :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: ``[lx, ly, lz, - alpha, beta, gamma]``. - backend - Select the type of acceleration; "serial" is always available. Other - possibilities are "OpenMP" (OpenMP). + coords : numpy.ndarray + Coordinate array of shape ``(3,)`` or ``(n, 3)`` (dtype is arbitrary, + will be converted to ``numpy.float32`` internally). + box : numpy.ndarray + The unitcell dimensions of the system, which can be orthogonal or + triclinic and must be provided in the same format as returned by + :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n + ``[lx, ly, lz, alpha, beta, gamma]``. + backend : {'serial', 'OpenMP'}, optional + Keyword selecting the type of acceleration. Returns ------- - newcoords : array - Coordinates that are now all within the primary unit cell, as defined - by box. + newcoords : numpy.ndarray (``dtype=numpy.float32``, ``shape=coords.shape``) + Array containing coordinates that all lie within the primary unit cell + as defined by `box`. .. versionadded:: 0.8 .. versionchanged:: 0.13.0 Added *backend* keyword. + .. versionchanged:: 0.19.0 + Internal dtype conversion of input coordinates to ``numpy.float32``. + Now also accepts (and, likewise, returns) single coordinates. """ - coords = incoords.copy('C') - - _check_array(coords, 'coords') - - coordnum = coords.shape[0] - - # determine boxtype - boxtype = _box_check(box) - # Convert [A,B,C,alpha,beta,gamma] to [[A],[B],[C]] - if boxtype == 'tri_box': - box = triclinic_vectors(box) - if boxtype == 'tri_vecs_bad': - box = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - - box_inv = np.zeros((3), dtype=np.float32) + if len(coords) == 0: + return coords + boxtype, box = _check_box(box) if boxtype == 'ortho': - box_inv[0] = 1.0 / box[0] - box_inv[1] = 1.0 / box[1] - box_inv[2] = 1.0 / box[2] - _run("ortho_pbc", - args=(coords, box, box_inv), - backend=backend) + box_inv = box ** (-1) + _run("ortho_pbc", args=(coords, box, box_inv), backend=backend) else: - box_inv[0] = 1.0 / box[0][0] - box_inv[1] = 1.0 / box[1][1] - box_inv[2] = 1.0 / box[2][2] - _run("triclinic_pbc", - args=(coords, box, box_inv), - backend=backend) + box_inv = np.diagonal(box) ** (-1) + _run("triclinic_pbc", args=(coords, box, box_inv), backend=backend) return coords diff --git a/package/MDAnalysis/lib/formats/cython_util.c b/package/MDAnalysis/lib/formats/cython_util.c index 023f22dba1a..9c832c0fc3c 100644 --- a/package/MDAnalysis/lib/formats/cython_util.c +++ b/package/MDAnalysis/lib/formats/cython_util.c @@ -1,11 +1,11 @@ -/* Generated by Cython 0.28.2 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h" + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h" ], "extra_compile_args": [ "-std=c99", @@ -14,7 +14,7 @@ "-funroll-loops" ], "include_dirs": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include" + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include" ], "name": "MDAnalysis.lib.formats.cython_util", "sources": [ @@ -32,7 +32,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_2" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -478,6 +478,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -677,7 +678,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -785,7 +786,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -934,7 +935,7 @@ typedef struct { #define __Pyx_MemoryView_Len(m) (m.shape[0]) -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -943,7 +944,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -952,7 +953,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -961,7 +962,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -970,7 +971,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -979,7 +980,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -988,7 +989,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -997,7 +998,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1006,7 +1007,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1015,7 +1016,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1024,7 +1025,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1033,7 +1034,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1042,7 +1043,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1051,7 +1052,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1060,7 +1061,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1069,7 +1070,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1078,7 +1079,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1087,7 +1088,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1096,7 +1097,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1105,7 +1106,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1114,7 +1115,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1154,7 +1155,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1163,7 +1164,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1172,7 +1173,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1181,7 +1182,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -2910,7 +2911,7 @@ static PyArrayObject *__pyx_f_10MDAnalysis_3lib_7formats_11cython_util_ptr_to_nd return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -2958,7 +2959,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -2967,7 +2968,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -2976,7 +2977,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -2985,7 +2986,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2999,7 +3000,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3010,7 +3011,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3019,7 +3020,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -3032,7 +3033,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3041,7 +3042,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3055,7 +3056,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -3066,7 +3067,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3075,7 +3076,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -3088,7 +3089,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -3097,7 +3098,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -3106,7 +3107,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -3115,7 +3116,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3125,7 +3126,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -3134,7 +3135,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -3143,7 +3144,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -3155,7 +3156,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -3164,7 +3165,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -3174,7 +3175,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3184,7 +3185,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3194,7 +3195,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3205,7 +3206,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3214,7 +3215,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -3223,7 +3224,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -3232,7 +3233,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -3241,7 +3242,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -3253,7 +3254,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -3266,7 +3267,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -3276,7 +3277,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -3286,7 +3287,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3306,7 +3307,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -3323,7 +3324,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3332,7 +3333,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -3345,7 +3346,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3354,7 +3355,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -3366,7 +3367,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -3377,7 +3378,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -3388,7 +3389,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -3399,7 +3400,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -3410,7 +3411,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -3421,7 +3422,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -3432,7 +3433,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -3443,7 +3444,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -3454,7 +3455,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -3465,7 +3466,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -3476,7 +3477,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -3487,7 +3488,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -3498,7 +3499,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -3509,7 +3510,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -3520,7 +3521,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -3531,7 +3532,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -3543,7 +3544,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -3564,7 +3565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -3573,7 +3574,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -3583,7 +3584,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -3592,7 +3593,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -3602,7 +3603,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -3611,7 +3612,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -3620,7 +3621,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -3630,7 +3631,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(2, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -3640,7 +3641,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -3672,7 +3673,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3696,7 +3697,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3706,7 +3707,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -3715,7 +3716,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3724,7 +3725,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3734,7 +3735,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -3743,7 +3744,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3752,7 +3753,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3764,7 +3765,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3778,7 +3779,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3792,7 +3793,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3811,7 +3812,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3825,7 +3826,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3839,7 +3840,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3858,7 +3859,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3872,7 +3873,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3886,7 +3887,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3905,7 +3906,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3919,7 +3920,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -3933,7 +3934,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3952,7 +3953,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3966,7 +3967,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -3980,7 +3981,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -3999,7 +4000,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4013,7 +4014,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4023,7 +4024,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -4035,7 +4036,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -4044,7 +4045,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -4058,7 +4059,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -4073,7 +4074,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4102,7 +4103,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4111,7 +4112,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4120,7 +4121,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4143,7 +4144,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -4160,7 +4161,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -4195,7 +4196,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -4212,7 +4213,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -4225,7 +4226,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -4234,7 +4235,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4254,7 +4255,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4271,7 +4272,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4280,7 +4281,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -4293,7 +4294,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(2, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4302,7 +4303,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -4318,7 +4319,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -4327,7 +4328,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -4336,7 +4337,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -4347,7 +4348,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -4357,7 +4358,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4367,7 +4368,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -4379,7 +4380,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4389,7 +4390,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -4402,7 +4403,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4411,7 +4412,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -4429,7 +4430,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -4447,7 +4448,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -4465,7 +4466,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -4483,7 +4484,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -4501,7 +4502,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -4519,7 +4520,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -4537,7 +4538,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -4555,7 +4556,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -4573,7 +4574,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -4591,7 +4592,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -4609,7 +4610,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -4627,7 +4628,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -4645,7 +4646,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -4665,7 +4666,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -4685,7 +4686,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -4705,7 +4706,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -4723,7 +4724,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -4742,7 +4743,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -4751,7 +4752,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4761,7 +4762,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -4774,7 +4775,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4784,7 +4785,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -4794,7 +4795,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -4819,7 +4820,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4834,7 +4835,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4845,7 +4846,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -4854,7 +4855,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4864,7 +4865,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -4874,7 +4875,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -4885,7 +4886,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -4894,7 +4895,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -4903,7 +4904,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4915,7 +4916,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4929,7 +4930,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4939,7 +4940,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -4950,7 +4951,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4959,7 +4960,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -4973,7 +4974,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4988,7 +4989,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -5009,7 +5010,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5025,7 +5026,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -5034,7 +5035,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(2, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5048,7 +5049,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -5063,7 +5064,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -5079,7 +5080,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -5094,7 +5095,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -5117,7 +5118,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -5138,7 +5139,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5154,7 +5155,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -5163,7 +5164,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(2, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5177,7 +5178,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -5192,7 +5193,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -5208,7 +5209,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -5223,7 +5224,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -5246,7 +5247,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -5267,7 +5268,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5283,7 +5284,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -5292,7 +5293,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(2, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5306,7 +5307,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -5320,7 +5321,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -5334,7 +5335,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -5349,7 +5350,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -19235,7 +19236,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -19246,7 +19247,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -19257,7 +19258,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -19268,7 +19269,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -19279,7 +19280,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -19290,7 +19291,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -19301,7 +19302,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -19312,7 +19313,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -19323,7 +19324,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -19803,8 +19804,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -20728,7 +20729,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -20743,7 +20744,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -20827,7 +20828,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -21149,6 +21150,9 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -21357,7 +21361,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -21508,14 +21512,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i #ifndef offsetof @@ -482,6 +482,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -685,7 +686,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -793,7 +794,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -940,7 +941,7 @@ typedef struct { #define __Pyx_FastGilFuncInit() -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -949,7 +950,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -958,7 +959,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -967,7 +968,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -976,7 +977,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -985,7 +986,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -994,7 +995,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1003,7 +1004,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1012,7 +1013,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1021,7 +1022,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1030,7 +1031,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1039,7 +1040,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1048,7 +1049,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1057,7 +1058,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1066,7 +1067,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1075,7 +1076,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1084,7 +1085,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1093,7 +1094,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1102,7 +1103,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1111,7 +1112,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1120,7 +1121,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1198,7 +1199,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1207,7 +1208,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1216,7 +1217,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1225,7 +1226,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1283,7 +1284,7 @@ struct __pyx_obj_10MDAnalysis_3lib_7formats_6libdcd_DCDFile { }; -/* "MDAnalysis/lib/formats/libdcd.pyx":332 +/* "MDAnalysis/lib/formats/libdcd.pyx":334 * * * cdef void _read_header(self): # <<<<<<<<<<<<<< @@ -1296,7 +1297,7 @@ struct __pyx_obj_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_he }; -/* "MDAnalysis/lib/formats/libdcd.pyx":377 +/* "MDAnalysis/lib/formats/libdcd.pyx":379 * py_remarks = py_remarks.decode('ascii', 'ignore') * * py_remarks = "".join(s for s in py_remarks if s in string.printable) # <<<<<<<<<<<<<< @@ -2410,7 +2411,7 @@ static const char __pyx_k_O[] = "O"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_w[] = "w"; -static const char __pyx_k__4[] = ""; +static const char __pyx_k__5[] = ""; static const char __pyx_k_id[] = "id"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_os[] = "os"; @@ -2473,6 +2474,7 @@ static const char __pyx_k_exc_tb[] = "exc_tb"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_ignore[] = "ignore"; static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_isfile[] = "isfile"; static const char __pyx_k_istart[] = "istart"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_natoms[] = "natoms"; @@ -2673,7 +2675,7 @@ static PyObject *__pyx_n_s_UnicodeDecodeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_kp_s_Writing_DCD_header_failed; -static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__5; static PyObject *__pyx_n_s_acf; static PyObject *__pyx_n_s_afc; static PyObject *__pyx_n_s_allocate_buffer; @@ -2728,6 +2730,7 @@ static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_indices; static PyObject *__pyx_n_s_int64; static PyObject *__pyx_n_s_is_periodic; +static PyObject *__pyx_n_s_isfile; static PyObject *__pyx_n_s_istart; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; @@ -2915,26 +2918,26 @@ static PyObject *__pyx_int_neg_8; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_slice__17; -static PyObject *__pyx_slice__19; -static PyObject *__pyx_slice__21; -static PyObject *__pyx_slice__28; -static PyObject *__pyx_slice__30; -static PyObject *__pyx_slice__32; -static PyObject *__pyx_slice__39; -static PyObject *__pyx_slice__41; -static PyObject *__pyx_slice__43; -static PyObject *__pyx_slice__45; -static PyObject *__pyx_slice__47; -static PyObject *__pyx_slice__49; -static PyObject *__pyx_slice__75; +static PyObject *__pyx_slice__18; +static PyObject *__pyx_slice__20; +static PyObject *__pyx_slice__22; +static PyObject *__pyx_slice__29; +static PyObject *__pyx_slice__31; +static PyObject *__pyx_slice__33; +static PyObject *__pyx_slice__40; +static PyObject *__pyx_slice__42; +static PyObject *__pyx_slice__44; +static PyObject *__pyx_slice__46; +static PyObject *__pyx_slice__48; +static PyObject *__pyx_slice__50; static PyObject *__pyx_slice__76; static PyObject *__pyx_slice__77; +static PyObject *__pyx_slice__78; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; @@ -2942,28 +2945,28 @@ static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; -static PyObject *__pyx_tuple__18; -static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; -static PyObject *__pyx_tuple__29; -static PyObject *__pyx_tuple__31; -static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; -static PyObject *__pyx_tuple__40; -static PyObject *__pyx_tuple__42; -static PyObject *__pyx_tuple__44; -static PyObject *__pyx_tuple__46; -static PyObject *__pyx_tuple__48; -static PyObject *__pyx_tuple__50; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__53; @@ -2988,7 +2991,7 @@ static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__72; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__74; -static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__80; static PyObject *__pyx_tuple__81; @@ -2998,7 +3001,8 @@ static PyObject *__pyx_tuple__84; static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__87; -static PyObject *__pyx_codeobj__88; +static PyObject *__pyx_tuple__88; +static PyObject *__pyx_codeobj__89; /* Late includes */ /* "MDAnalysis/lib/formats/libdcd.pyx":216 @@ -4467,10 +4471,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - char const *__pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; + int __pyx_t_6; + char const *__pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("open", 0); /* "MDAnalysis/lib/formats/libdcd.pyx":291 @@ -4525,8 +4529,8 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str * self.close() * * if mode == 'r': # <<<<<<<<<<<<<< - * fio_mode = FIO_READ - * elif mode == 'w': + * if not path.isfile(self.fname): + * raise IOError("DCD file does not exist") */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 294, __pyx_L1_error) if (__pyx_t_1) { @@ -4534,6 +4538,88 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str /* "MDAnalysis/lib/formats/libdcd.pyx":295 * * if mode == 'r': + * if not path.isfile(self.fname): # <<<<<<<<<<<<<< + * raise IOError("DCD file does not exist") + * fio_mode = FIO_READ + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_3) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->fname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->fname}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_self->fname}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + __Pyx_INCREF(__pyx_v_self->fname); + __Pyx_GIVEREF(__pyx_v_self->fname); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->fname); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = ((!__pyx_t_1) != 0); + if (unlikely(__pyx_t_6)) { + + /* "MDAnalysis/lib/formats/libdcd.pyx":296 + * if mode == 'r': + * if not path.isfile(self.fname): + * raise IOError("DCD file does not exist") # <<<<<<<<<<<<<< + * fio_mode = FIO_READ + * elif mode == 'w': + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 296, __pyx_L1_error) + + /* "MDAnalysis/lib/formats/libdcd.pyx":295 + * + * if mode == 'r': + * if not path.isfile(self.fname): # <<<<<<<<<<<<<< + * raise IOError("DCD file does not exist") + * fio_mode = FIO_READ + */ + } + + /* "MDAnalysis/lib/formats/libdcd.pyx":297 + * if not path.isfile(self.fname): + * raise IOError("DCD file does not exist") * fio_mode = FIO_READ # <<<<<<<<<<<<<< * elif mode == 'w': * fio_mode = FIO_WRITE @@ -4544,23 +4630,23 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str * self.close() * * if mode == 'r': # <<<<<<<<<<<<<< - * fio_mode = FIO_READ - * elif mode == 'w': + * if not path.isfile(self.fname): + * raise IOError("DCD file does not exist") */ goto __pyx_L4; } - /* "MDAnalysis/lib/formats/libdcd.pyx":296 - * if mode == 'r': + /* "MDAnalysis/lib/formats/libdcd.pyx":298 + * raise IOError("DCD file does not exist") * fio_mode = FIO_READ * elif mode == 'w': # <<<<<<<<<<<<<< * fio_mode = FIO_WRITE * else: */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 296, __pyx_L1_error) - if (likely(__pyx_t_1)) { + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 298, __pyx_L1_error) + if (likely(__pyx_t_6)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":297 + /* "MDAnalysis/lib/formats/libdcd.pyx":299 * fio_mode = FIO_READ * elif mode == 'w': * fio_mode = FIO_WRITE # <<<<<<<<<<<<<< @@ -4569,8 +4655,8 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str */ __pyx_v_fio_mode = __pyx_e_10MDAnalysis_3lib_7formats_6libdcd_FIO_WRITE; - /* "MDAnalysis/lib/formats/libdcd.pyx":296 - * if mode == 'r': + /* "MDAnalysis/lib/formats/libdcd.pyx":298 + * raise IOError("DCD file does not exist") * fio_mode = FIO_READ * elif mode == 'w': # <<<<<<<<<<<<<< * fio_mode = FIO_WRITE @@ -4579,7 +4665,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str goto __pyx_L4; } - /* "MDAnalysis/lib/formats/libdcd.pyx":299 + /* "MDAnalysis/lib/formats/libdcd.pyx":301 * fio_mode = FIO_WRITE * else: * raise IOError("unkown mode '{}', use either r or w".format(mode)) # <<<<<<<<<<<<<< @@ -4587,173 +4673,173 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str * */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unkown_mode_use_either_r_or_w, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unkown_mode_use_either_r_or_w, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); } } - if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) + if (!__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_mode}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_mode}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_mode}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_mode}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_mode); __Pyx_GIVEREF(__pyx_v_mode); - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_mode); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_mode); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 301, __pyx_L1_error) } __pyx_L4:; - /* "MDAnalysis/lib/formats/libdcd.pyx":300 + /* "MDAnalysis/lib/formats/libdcd.pyx":302 * else: * raise IOError("unkown mode '{}', use either r or w".format(mode)) * self.mode = str(mode) # <<<<<<<<<<<<<< * * ok = fio_open(self.fname, fio_mode, &self.fp) */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->mode); __Pyx_DECREF(__pyx_v_self->mode); - __pyx_v_self->mode = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_v_self->mode = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":302 + /* "MDAnalysis/lib/formats/libdcd.pyx":304 * self.mode = str(mode) * * ok = fio_open(self.fname, fio_mode, &self.fp) # <<<<<<<<<<<<<< * if ok != 0: * raise IOError("couldn't open file: {}\n" */ - __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->fname); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error) - __pyx_v_ok = fio_open(__pyx_t_6, __pyx_v_fio_mode, ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_fio_fd *)(&__pyx_v_self->fp))); + __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_self->fname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_v_ok = fio_open(__pyx_t_7, __pyx_v_fio_mode, ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_fio_fd *)(&__pyx_v_self->fp))); - /* "MDAnalysis/lib/formats/libdcd.pyx":303 + /* "MDAnalysis/lib/formats/libdcd.pyx":305 * * ok = fio_open(self.fname, fio_mode, &self.fp) * if ok != 0: # <<<<<<<<<<<<<< * raise IOError("couldn't open file: {}\n" * "ErrorCode: {}".format(self.fname, DCD_ERRORS[ok])) */ - __pyx_t_1 = ((__pyx_v_ok != 0) != 0); - if (unlikely(__pyx_t_1)) { + __pyx_t_6 = ((__pyx_v_ok != 0) != 0); + if (unlikely(__pyx_t_6)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":305 + /* "MDAnalysis/lib/formats/libdcd.pyx":307 * if ok != 0: * raise IOError("couldn't open file: {}\n" * "ErrorCode: {}".format(self.fname, DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * self.is_open = True * self.current_frame = 0 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_couldn_t_open_file_ErrorCode, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_couldn_t_open_file_ErrorCode, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_7 = 1; + __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->fname, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->fname, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->fname, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->fname, __pyx_t_5}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_self->fname); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_self->fname); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":304 + /* "MDAnalysis/lib/formats/libdcd.pyx":306 * ok = fio_open(self.fname, fio_mode, &self.fp) * if ok != 0: * raise IOError("couldn't open file: {}\n" # <<<<<<<<<<<<<< * "ErrorCode: {}".format(self.fname, DCD_ERRORS[ok])) * self.is_open = True */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 304, __pyx_L1_error) + __PYX_ERR(0, 306, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":303 + /* "MDAnalysis/lib/formats/libdcd.pyx":305 * * ok = fio_open(self.fname, fio_mode, &self.fp) * if ok != 0: # <<<<<<<<<<<<<< @@ -4762,7 +4848,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":306 + /* "MDAnalysis/lib/formats/libdcd.pyx":308 * raise IOError("couldn't open file: {}\n" * "ErrorCode: {}".format(self.fname, DCD_ERRORS[ok])) * self.is_open = True # <<<<<<<<<<<<<< @@ -4771,7 +4857,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str */ __pyx_v_self->is_open = 1; - /* "MDAnalysis/lib/formats/libdcd.pyx":307 + /* "MDAnalysis/lib/formats/libdcd.pyx":309 * "ErrorCode: {}".format(self.fname, DCD_ERRORS[ok])) * self.is_open = True * self.current_frame = 0 # <<<<<<<<<<<<<< @@ -4780,7 +4866,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str */ __pyx_v_self->current_frame = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":308 + /* "MDAnalysis/lib/formats/libdcd.pyx":310 * self.is_open = True * self.current_frame = 0 * self.reached_eof = False # <<<<<<<<<<<<<< @@ -4789,7 +4875,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str */ __pyx_v_self->reached_eof = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":309 + /* "MDAnalysis/lib/formats/libdcd.pyx":311 * self.current_frame = 0 * self.reached_eof = False * self.wrote_header = False # <<<<<<<<<<<<<< @@ -4798,18 +4884,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str */ __pyx_v_self->wrote_header = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":311 + /* "MDAnalysis/lib/formats/libdcd.pyx":313 * self.wrote_header = False * # Has to come last since it checks the reached_eof flag * if self.mode == 'r': # <<<<<<<<<<<<<< * self._read_header() * */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 311, __pyx_L1_error) - __pyx_t_9 = (__pyx_t_1 != 0); - if (__pyx_t_9) { + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_6 != 0); + if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/libdcd.pyx":312 + /* "MDAnalysis/lib/formats/libdcd.pyx":314 * # Has to come last since it checks the reached_eof flag * if self.mode == 'r': * self._read_header() # <<<<<<<<<<<<<< @@ -4818,7 +4904,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str */ ((struct __pyx_vtabstruct_10MDAnalysis_3lib_7formats_6libdcd_DCDFile *)__pyx_v_self->__pyx_vtab)->_read_header(__pyx_v_self); - /* "MDAnalysis/lib/formats/libdcd.pyx":311 + /* "MDAnalysis/lib/formats/libdcd.pyx":313 * self.wrote_header = False * # Has to come last since it checks the reached_eof flag * if self.mode == 'r': # <<<<<<<<<<<<<< @@ -4843,7 +4929,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("MDAnalysis.lib.formats.libdcd.DCDFile.open", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4852,7 +4938,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_22open(str return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":314 +/* "MDAnalysis/lib/formats/libdcd.pyx":316 * self._read_header() * * def close(self): # <<<<<<<<<<<<<< @@ -4887,7 +4973,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("close", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":318 + /* "MDAnalysis/lib/formats/libdcd.pyx":320 * * """ * if self.is_open: # <<<<<<<<<<<<<< @@ -4897,7 +4983,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st __pyx_t_1 = (__pyx_v_self->is_open != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/libdcd.pyx":321 + /* "MDAnalysis/lib/formats/libdcd.pyx":323 * # In case there are fixed atoms we should free the memory again. * # Both pointers are guaranted to be non NULL if either one is. * if self.freeind != NULL: # <<<<<<<<<<<<<< @@ -4907,7 +4993,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st __pyx_t_1 = ((__pyx_v_self->freeind != NULL) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/libdcd.pyx":322 + /* "MDAnalysis/lib/formats/libdcd.pyx":324 * # Both pointers are guaranted to be non NULL if either one is. * if self.freeind != NULL: * close_dcd_read(self.freeind, self.fixedcoords); # <<<<<<<<<<<<<< @@ -4916,7 +5002,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st */ close_dcd_read(__pyx_v_self->freeind, __pyx_v_self->fixedcoords); - /* "MDAnalysis/lib/formats/libdcd.pyx":321 + /* "MDAnalysis/lib/formats/libdcd.pyx":323 * # In case there are fixed atoms we should free the memory again. * # Both pointers are guaranted to be non NULL if either one is. * if self.freeind != NULL: # <<<<<<<<<<<<<< @@ -4925,7 +5011,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":324 + /* "MDAnalysis/lib/formats/libdcd.pyx":326 * close_dcd_read(self.freeind, self.fixedcoords); * * ok = fio_fclose(self.fp) # <<<<<<<<<<<<<< @@ -4934,7 +5020,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st */ __pyx_v_ok = fio_fclose(__pyx_v_self->fp); - /* "MDAnalysis/lib/formats/libdcd.pyx":326 + /* "MDAnalysis/lib/formats/libdcd.pyx":328 * ok = fio_fclose(self.fp) * * self.is_open = False # <<<<<<<<<<<<<< @@ -4943,7 +5029,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st */ __pyx_v_self->is_open = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":327 + /* "MDAnalysis/lib/formats/libdcd.pyx":329 * * self.is_open = False * if ok != 0: # <<<<<<<<<<<<<< @@ -4953,18 +5039,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st __pyx_t_1 = ((__pyx_v_ok != 0) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":329 + /* "MDAnalysis/lib/formats/libdcd.pyx":331 * if ok != 0: * raise IOError("couldn't close file: {}\n" * "ErrorCode: {}".format(self.fname, DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_couldn_t_close_file_ErrorCode, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_couldn_t_close_file_ErrorCode, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -4982,7 +5068,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self->fname, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4991,14 +5077,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self->fname, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -5009,27 +5095,27 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":328 + /* "MDAnalysis/lib/formats/libdcd.pyx":330 * self.is_open = False * if ok != 0: * raise IOError("couldn't close file: {}\n" # <<<<<<<<<<<<<< * "ErrorCode: {}".format(self.fname, DCD_ERRORS[ok])) * */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 328, __pyx_L1_error) + __PYX_ERR(0, 330, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":327 + /* "MDAnalysis/lib/formats/libdcd.pyx":329 * * self.is_open = False * if ok != 0: # <<<<<<<<<<<<<< @@ -5038,7 +5124,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":318 + /* "MDAnalysis/lib/formats/libdcd.pyx":320 * * """ * if self.is_open: # <<<<<<<<<<<<<< @@ -5047,7 +5133,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":314 + /* "MDAnalysis/lib/formats/libdcd.pyx":316 * self._read_header() * * def close(self): # <<<<<<<<<<<<<< @@ -5073,7 +5159,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_24close(st } static PyObject *__pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_header_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "MDAnalysis/lib/formats/libdcd.pyx":377 +/* "MDAnalysis/lib/formats/libdcd.pyx":379 * py_remarks = py_remarks.decode('ascii', 'ignore') * * py_remarks = "".join(s for s in py_remarks if s in string.printable) # <<<<<<<<<<<<<< @@ -5090,7 +5176,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_he if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 377, __pyx_L1_error) + __PYX_ERR(0, 379, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -5098,7 +5184,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_he __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_header_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DCDFile__read_header_locals_gene, __pyx_n_s_MDAnalysis_lib_formats_libdcd); if (unlikely(!gen)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_header_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_DCDFile__read_header_locals_gene, __pyx_n_s_MDAnalysis_lib_formats_libdcd); if (unlikely(!gen)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5135,32 +5221,32 @@ static PyObject *__pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_he return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 377, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_remarks)) { __Pyx_RaiseClosureNameError("py_remarks"); __PYX_ERR(0, 377, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 379, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_remarks)) { __Pyx_RaiseClosureNameError("py_remarks"); __PYX_ERR(0, 379, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_remarks)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_remarks)) { __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_remarks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_remarks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_py_remarks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 379, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 379, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -5170,7 +5256,7 @@ static PyObject *__pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_he PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 377, __pyx_L1_error) + else __PYX_ERR(0, 379, __pyx_L1_error) } break; } @@ -5180,12 +5266,12 @@ static PyObject *__pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_he __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_printable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_printable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { @@ -5207,7 +5293,7 @@ static PyObject *__pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_he __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 377, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 379, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5230,7 +5316,7 @@ static PyObject *__pyx_gb_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_he return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":332 +/* "MDAnalysis/lib/formats/libdcd.pyx":334 * * * cdef void _read_header(self): # <<<<<<<<<<<<<< @@ -5261,12 +5347,12 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 332, __pyx_L1_error) + __PYX_ERR(0, 334, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } - /* "MDAnalysis/lib/formats/libdcd.pyx":334 + /* "MDAnalysis/lib/formats/libdcd.pyx":336 * cdef void _read_header(self): * """read header and populate internal fields""" * if not self.is_open: # <<<<<<<<<<<<<< @@ -5276,20 +5362,20 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":335 + /* "MDAnalysis/lib/formats/libdcd.pyx":337 * """read header and populate internal fields""" * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * * cdef char* c_remarks */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 335, __pyx_L1_error) + __PYX_ERR(0, 337, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":334 + /* "MDAnalysis/lib/formats/libdcd.pyx":336 * cdef void _read_header(self): * """read header and populate internal fields""" * if not self.is_open: # <<<<<<<<<<<<<< @@ -5298,7 +5384,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":338 + /* "MDAnalysis/lib/formats/libdcd.pyx":340 * * cdef char* c_remarks * cdef int len_remarks = 0 # <<<<<<<<<<<<<< @@ -5307,7 +5393,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str */ __pyx_v_len_remarks = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":341 + /* "MDAnalysis/lib/formats/libdcd.pyx":343 * cdef int nsets * * ok = read_dcdheader(self.fp, &self.natoms, &nsets, &self.istart, # <<<<<<<<<<<<<< @@ -5316,7 +5402,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str */ __pyx_v_ok = read_dcdheader(__pyx_v_self->fp, (&__pyx_v_self->natoms), (&__pyx_v_nsets), (&__pyx_v_self->istart), (&__pyx_v_self->nsavc), (&__pyx_v_self->delta), (&__pyx_v_self->nfixed), (&__pyx_v_self->freeind), (&__pyx_v_self->fixedcoords), (&__pyx_v_self->reverse_endian), (&__pyx_v_self->charmm), (&__pyx_v_c_remarks), (&__pyx_v_len_remarks)); - /* "MDAnalysis/lib/formats/libdcd.pyx":345 + /* "MDAnalysis/lib/formats/libdcd.pyx":347 * &self.fixedcoords, &self.reverse_endian, * &self.charmm, &c_remarks, &len_remarks) * if ok != 0: # <<<<<<<<<<<<<< @@ -5326,18 +5412,18 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_t_1 = ((__pyx_v_ok != 0) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":346 + /* "MDAnalysis/lib/formats/libdcd.pyx":348 * &self.charmm, &c_remarks, &len_remarks) * if ok != 0: * raise IOError("Reading DCD header failed: {}".format(DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * * self.is_periodic = bool((self.charmm & DCD_IS_CHARMM) and */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_header_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_header_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -5351,14 +5437,14 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -5367,33 +5453,33 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 346, __pyx_L1_error) + __PYX_ERR(0, 348, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":345 + /* "MDAnalysis/lib/formats/libdcd.pyx":347 * &self.fixedcoords, &self.reverse_endian, * &self.charmm, &c_remarks, &len_remarks) * if ok != 0: # <<<<<<<<<<<<<< @@ -5402,22 +5488,22 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":348 + /* "MDAnalysis/lib/formats/libdcd.pyx":350 * raise IOError("Reading DCD header failed: {}".format(DCD_ERRORS[ok])) * * self.is_periodic = bool((self.charmm & DCD_IS_CHARMM) and # <<<<<<<<<<<<<< * (self.charmm & DCD_HAS_EXTRA_BLOCK)) * */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_IS_CHARMM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_IS_CHARMM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_And(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_6 = PyNumber_And(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { } else { @@ -5425,34 +5511,34 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str goto __pyx_L5_bool_binop_done; } - /* "MDAnalysis/lib/formats/libdcd.pyx":349 + /* "MDAnalysis/lib/formats/libdcd.pyx":351 * * self.is_periodic = bool((self.charmm & DCD_IS_CHARMM) and * (self.charmm & DCD_HAS_EXTRA_BLOCK)) # <<<<<<<<<<<<<< * * if c_remarks != NULL: */ - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_And(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_3 = PyNumber_And(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_7; __pyx_L5_bool_binop_done:; - /* "MDAnalysis/lib/formats/libdcd.pyx":348 + /* "MDAnalysis/lib/formats/libdcd.pyx":350 * raise IOError("Reading DCD header failed: {}".format(DCD_ERRORS[ok])) * * self.is_periodic = bool((self.charmm & DCD_IS_CHARMM) and # <<<<<<<<<<<<<< * (self.charmm & DCD_HAS_EXTRA_BLOCK)) * */ - __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->is_periodic); @@ -5460,7 +5546,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_v_self->is_periodic = __pyx_t_3; __pyx_t_3 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":351 + /* "MDAnalysis/lib/formats/libdcd.pyx":353 * (self.charmm & DCD_HAS_EXTRA_BLOCK)) * * if c_remarks != NULL: # <<<<<<<<<<<<<< @@ -5470,14 +5556,14 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_t_1 = ((__pyx_v_c_remarks != NULL) != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/libdcd.pyx":352 + /* "MDAnalysis/lib/formats/libdcd.pyx":354 * * if c_remarks != NULL: * py_remarks = c_remarks[:len_remarks] # <<<<<<<<<<<<<< * free(c_remarks) * else: */ - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_remarks + 0, __pyx_v_len_remarks - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_remarks + 0, __pyx_v_len_remarks - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); @@ -5486,7 +5572,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_cur_scope->__pyx_v_py_remarks = __pyx_t_2; __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":353 + /* "MDAnalysis/lib/formats/libdcd.pyx":355 * if c_remarks != NULL: * py_remarks = c_remarks[:len_remarks] * free(c_remarks) # <<<<<<<<<<<<<< @@ -5495,7 +5581,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str */ free(__pyx_v_c_remarks); - /* "MDAnalysis/lib/formats/libdcd.pyx":351 + /* "MDAnalysis/lib/formats/libdcd.pyx":353 * (self.charmm & DCD_HAS_EXTRA_BLOCK)) * * if c_remarks != NULL: # <<<<<<<<<<<<<< @@ -5505,7 +5591,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str goto __pyx_L7; } - /* "MDAnalysis/lib/formats/libdcd.pyx":355 + /* "MDAnalysis/lib/formats/libdcd.pyx":357 * free(c_remarks) * else: * py_remarks = "" # <<<<<<<<<<<<<< @@ -5513,28 +5599,28 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str * # This function assumes that the dcd header was already read and */ /*else*/ { - __Pyx_INCREF(__pyx_kp_s__4); - __Pyx_GIVEREF(__pyx_kp_s__4); - __pyx_cur_scope->__pyx_v_py_remarks = __pyx_kp_s__4; + __Pyx_INCREF(__pyx_kp_s__5); + __Pyx_GIVEREF(__pyx_kp_s__5); + __pyx_cur_scope->__pyx_v_py_remarks = __pyx_kp_s__5; } __pyx_L7:; - /* "MDAnalysis/lib/formats/libdcd.pyx":356 + /* "MDAnalysis/lib/formats/libdcd.pyx":358 * else: * py_remarks = "" * self.ndims = 3 if not self.charmm & DCD_HAS_4DIMS else 4 # <<<<<<<<<<<<<< * # This function assumes that the dcd header was already read and * # self.ndims is set. It will only work when called here !!! */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_4DIMS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_4DIMS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_6 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (((!__pyx_t_1) != 0)) { __pyx_t_8 = 3; @@ -5543,7 +5629,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str } __pyx_v_self->ndims = __pyx_t_8; - /* "MDAnalysis/lib/formats/libdcd.pyx":359 + /* "MDAnalysis/lib/formats/libdcd.pyx":361 * # This function assumes that the dcd header was already read and * # self.ndims is set. It will only work when called here !!! * self.n_frames = self._estimate_n_frames() # <<<<<<<<<<<<<< @@ -5552,7 +5638,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str */ __pyx_v_self->n_frames = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_7formats_6libdcd_DCDFile *)__pyx_v_self->__pyx_vtab)->_estimate_n_frames(__pyx_v_self); - /* "MDAnalysis/lib/formats/libdcd.pyx":360 + /* "MDAnalysis/lib/formats/libdcd.pyx":362 * # self.ndims is set. It will only work when called here !!! * self.n_frames = self._estimate_n_frames() * self.b_read_header = True # <<<<<<<<<<<<<< @@ -5561,7 +5647,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str */ __pyx_v_self->b_read_header = 1; - /* "MDAnalysis/lib/formats/libdcd.pyx":363 + /* "MDAnalysis/lib/formats/libdcd.pyx":365 * * # make sure fixed atoms have been read * try: # <<<<<<<<<<<<<< @@ -5577,14 +5663,14 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { - /* "MDAnalysis/lib/formats/libdcd.pyx":364 + /* "MDAnalysis/lib/formats/libdcd.pyx":366 * # make sure fixed atoms have been read * try: * self.read() # <<<<<<<<<<<<<< * self.seek(0) * except IOError: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -5597,30 +5683,30 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str } } if (__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L8_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L8_error) + __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L8_error) } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":365 + /* "MDAnalysis/lib/formats/libdcd.pyx":367 * try: * self.read() * self.seek(0) # <<<<<<<<<<<<<< * except IOError: * if self.n_frames != 0: */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L8_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":363 + /* "MDAnalysis/lib/formats/libdcd.pyx":365 * * # make sure fixed atoms have been read * try: # <<<<<<<<<<<<<< @@ -5639,7 +5725,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":366 + /* "MDAnalysis/lib/formats/libdcd.pyx":368 * self.read() * self.seek(0) * except IOError: # <<<<<<<<<<<<<< @@ -5649,12 +5735,12 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IOError); if (__pyx_t_8) { __Pyx_AddTraceback("MDAnalysis.lib.formats.libdcd.DCDFile._read_header", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 366, __pyx_L10_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 368, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_2); - /* "MDAnalysis/lib/formats/libdcd.pyx":367 + /* "MDAnalysis/lib/formats/libdcd.pyx":369 * self.seek(0) * except IOError: * if self.n_frames != 0: # <<<<<<<<<<<<<< @@ -5664,20 +5750,20 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_t_1 = ((__pyx_v_self->n_frames != 0) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":368 + /* "MDAnalysis/lib/formats/libdcd.pyx":370 * except IOError: * if self.n_frames != 0: * raise IOError("DCD is corrupted") # <<<<<<<<<<<<<< * * if sys.version_info[0] < 3: */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L10_except_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 368, __pyx_L10_except_error) + __PYX_ERR(0, 370, __pyx_L10_except_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":367 + /* "MDAnalysis/lib/formats/libdcd.pyx":369 * self.seek(0) * except IOError: * if self.n_frames != 0: # <<<<<<<<<<<<<< @@ -5693,7 +5779,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str goto __pyx_L10_except_error; __pyx_L10_except_error:; - /* "MDAnalysis/lib/formats/libdcd.pyx":363 + /* "MDAnalysis/lib/formats/libdcd.pyx":365 * * # make sure fixed atoms have been read * try: # <<<<<<<<<<<<<< @@ -5713,35 +5799,35 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_L13_try_end:; } - /* "MDAnalysis/lib/formats/libdcd.pyx":370 + /* "MDAnalysis/lib/formats/libdcd.pyx":372 * raise IOError("DCD is corrupted") * * if sys.version_info[0] < 3: # <<<<<<<<<<<<<< * py_remarks = unicode(py_remarks, 'ascii', "ignore") * py_remarks = str(py_remarks.encode('ascii', 'ignore')) */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 370, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/libdcd.pyx":371 + /* "MDAnalysis/lib/formats/libdcd.pyx":373 * * if sys.version_info[0] < 3: * py_remarks = unicode(py_remarks, 'ascii', "ignore") # <<<<<<<<<<<<<< * py_remarks = str(py_remarks.encode('ascii', 'ignore')) * else: */ - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_py_remarks); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_py_remarks); @@ -5752,7 +5838,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_INCREF(__pyx_n_s_ignore); __Pyx_GIVEREF(__pyx_n_s_ignore); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_ignore); - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_py_remarks); @@ -5760,19 +5846,19 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":372 + /* "MDAnalysis/lib/formats/libdcd.pyx":374 * if sys.version_info[0] < 3: * py_remarks = unicode(py_remarks, 'ascii', "ignore") * py_remarks = str(py_remarks.encode('ascii', 'ignore')) # <<<<<<<<<<<<<< * else: * if isinstance(py_remarks, bytes): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_py_remarks, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_py_remarks, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_py_remarks); @@ -5780,7 +5866,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":370 + /* "MDAnalysis/lib/formats/libdcd.pyx":372 * raise IOError("DCD is corrupted") * * if sys.version_info[0] < 3: # <<<<<<<<<<<<<< @@ -5790,7 +5876,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str goto __pyx_L17; } - /* "MDAnalysis/lib/formats/libdcd.pyx":374 + /* "MDAnalysis/lib/formats/libdcd.pyx":376 * py_remarks = str(py_remarks.encode('ascii', 'ignore')) * else: * if isinstance(py_remarks, bytes): # <<<<<<<<<<<<<< @@ -5805,16 +5891,16 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __pyx_t_7 = (__pyx_t_1 != 0); if (__pyx_t_7) { - /* "MDAnalysis/lib/formats/libdcd.pyx":375 + /* "MDAnalysis/lib/formats/libdcd.pyx":377 * else: * if isinstance(py_remarks, bytes): * py_remarks = py_remarks.decode('ascii', 'ignore') # <<<<<<<<<<<<<< * * py_remarks = "".join(s for s in py_remarks if s in string.printable) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_py_remarks, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_py_remarks, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_py_remarks); @@ -5822,7 +5908,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":374 + /* "MDAnalysis/lib/formats/libdcd.pyx":376 * py_remarks = str(py_remarks.encode('ascii', 'ignore')) * else: * if isinstance(py_remarks, bytes): # <<<<<<<<<<<<<< @@ -5833,16 +5919,16 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str } __pyx_L17:; - /* "MDAnalysis/lib/formats/libdcd.pyx":377 + /* "MDAnalysis/lib/formats/libdcd.pyx":379 * py_remarks = py_remarks.decode('ascii', 'ignore') * * py_remarks = "".join(s for s in py_remarks if s in string.printable) # <<<<<<<<<<<<<< * * self.remarks = py_remarks */ - __pyx_t_6 = __pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_header_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_6 = __pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_read_header_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__4, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_py_remarks); @@ -5850,7 +5936,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":379 + /* "MDAnalysis/lib/formats/libdcd.pyx":381 * py_remarks = "".join(s for s in py_remarks if s in string.printable) * * self.remarks = py_remarks # <<<<<<<<<<<<<< @@ -5863,7 +5949,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_DECREF(__pyx_v_self->remarks); __pyx_v_self->remarks = __pyx_cur_scope->__pyx_v_py_remarks; - /* "MDAnalysis/lib/formats/libdcd.pyx":332 + /* "MDAnalysis/lib/formats/libdcd.pyx":334 * * * cdef void _read_header(self): # <<<<<<<<<<<<<< @@ -5885,7 +5971,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__read_header(str __Pyx_RefNannyFinishContext(); } -/* "MDAnalysis/lib/formats/libdcd.pyx":381 +/* "MDAnalysis/lib/formats/libdcd.pyx":383 * self.remarks = py_remarks * * cdef int _estimate_n_frames(self): # <<<<<<<<<<<<<< @@ -5907,22 +5993,22 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__estimate_n_frame int __pyx_t_6; __Pyx_RefNannySetupContext("_estimate_n_frames", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":384 + /* "MDAnalysis/lib/formats/libdcd.pyx":386 * """ Only call this function in _read_header!!! * """ * extrablocksize = 48 + 8 if self.charmm & DCD_HAS_EXTRA_BLOCK else 0 # <<<<<<<<<<<<<< * self._firstframesize = (self.natoms + 2) * self.ndims * sizeof(float) + extrablocksize * self._framesize = ((self.natoms - self.nfixed + 2) * self.ndims * sizeof(float) + */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_int_56); @@ -5934,64 +6020,64 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__estimate_n_frame __pyx_v_extrablocksize = __pyx_t_1; __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":385 + /* "MDAnalysis/lib/formats/libdcd.pyx":387 * """ * extrablocksize = 48 + 8 if self.charmm & DCD_HAS_EXTRA_BLOCK else 0 * self._firstframesize = (self.natoms + 2) * self.ndims * sizeof(float) + extrablocksize # <<<<<<<<<<<<<< * self._framesize = ((self.natoms - self.nfixed + 2) * self.ndims * sizeof(float) + * extrablocksize) */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((((__pyx_v_self->natoms + 2) * __pyx_v_self->ndims) * (sizeof(float)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_FromSize_t((((__pyx_v_self->natoms + 2) * __pyx_v_self->ndims) * (sizeof(float)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_extrablocksize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_extrablocksize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->_firstframesize = __pyx_t_6; - /* "MDAnalysis/lib/formats/libdcd.pyx":386 + /* "MDAnalysis/lib/formats/libdcd.pyx":388 * extrablocksize = 48 + 8 if self.charmm & DCD_HAS_EXTRA_BLOCK else 0 * self._firstframesize = (self.natoms + 2) * self.ndims * sizeof(float) + extrablocksize * self._framesize = ((self.natoms - self.nfixed + 2) * self.ndims * sizeof(float) + # <<<<<<<<<<<<<< * extrablocksize) * filesize = path.getsize(self.fname) */ - __pyx_t_4 = __Pyx_PyInt_FromSize_t(((((__pyx_v_self->natoms - __pyx_v_self->nfixed) + 2) * __pyx_v_self->ndims) * (sizeof(float)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_FromSize_t(((((__pyx_v_self->natoms - __pyx_v_self->nfixed) + 2) * __pyx_v_self->ndims) * (sizeof(float)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "MDAnalysis/lib/formats/libdcd.pyx":387 + /* "MDAnalysis/lib/formats/libdcd.pyx":389 * self._firstframesize = (self.natoms + 2) * self.ndims * sizeof(float) + extrablocksize * self._framesize = ((self.natoms - self.nfixed + 2) * self.ndims * sizeof(float) + * extrablocksize) # <<<<<<<<<<<<<< * filesize = path.getsize(self.fname) * # It's safe to use ftell, even though ftell returns a long, because the */ - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_extrablocksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_extrablocksize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":386 + /* "MDAnalysis/lib/formats/libdcd.pyx":388 * extrablocksize = 48 + 8 if self.charmm & DCD_HAS_EXTRA_BLOCK else 0 * self._firstframesize = (self.natoms + 2) * self.ndims * sizeof(float) + extrablocksize * self._framesize = ((self.natoms - self.nfixed + 2) * self.ndims * sizeof(float) + # <<<<<<<<<<<<<< * extrablocksize) * filesize = path.getsize(self.fname) */ - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_framesize = __pyx_t_6; - /* "MDAnalysis/lib/formats/libdcd.pyx":388 + /* "MDAnalysis/lib/formats/libdcd.pyx":390 * self._framesize = ((self.natoms - self.nfixed + 2) * self.ndims * sizeof(float) + * extrablocksize) * filesize = path.getsize(self.fname) # <<<<<<<<<<<<<< * # It's safe to use ftell, even though ftell returns a long, because the * # header size is < 4GB. */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_getsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -6005,13 +6091,13 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__estimate_n_frame } } if (!__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->fname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->fname}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -6019,19 +6105,19 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__estimate_n_frame #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->fname}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_self->fname); __Pyx_GIVEREF(__pyx_v_self->fname); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_self->fname); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -6040,7 +6126,7 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__estimate_n_frame __pyx_v_filesize = __pyx_t_1; __pyx_t_1 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":391 + /* "MDAnalysis/lib/formats/libdcd.pyx":393 * # It's safe to use ftell, even though ftell returns a long, because the * # header size is < 4GB. * self._header_size = fio_ftell(self.fp) # <<<<<<<<<<<<<< @@ -6049,48 +6135,48 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__estimate_n_frame */ __pyx_v_self->_header_size = fio_ftell(__pyx_v_self->fp); - /* "MDAnalysis/lib/formats/libdcd.pyx":392 + /* "MDAnalysis/lib/formats/libdcd.pyx":394 * # header size is < 4GB. * self._header_size = fio_ftell(self.fp) * nframessize = filesize - self._header_size - self._firstframesize # <<<<<<<<<<<<<< * return nframessize / self._framesize + 1 * */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_header_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_header_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_filesize, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_filesize, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_firstframesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_firstframesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nframessize = __pyx_t_2; __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":393 + /* "MDAnalysis/lib/formats/libdcd.pyx":395 * self._header_size = fio_ftell(self.fp) * nframessize = filesize - self._header_size - self._firstframesize * return nframessize / self._framesize + 1 # <<<<<<<<<<<<<< * * def seek(self, frame): */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_framesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_framesize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_nframessize, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_nframessize, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; goto __pyx_L0; - /* "MDAnalysis/lib/formats/libdcd.pyx":381 + /* "MDAnalysis/lib/formats/libdcd.pyx":383 * self.remarks = py_remarks * * cdef int _estimate_n_frames(self): # <<<<<<<<<<<<<< @@ -6114,7 +6200,7 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile__estimate_n_frame return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":395 +/* "MDAnalysis/lib/formats/libdcd.pyx":397 * return nframessize / self._framesize + 1 * * def seek(self, frame): # <<<<<<<<<<<<<< @@ -6151,35 +6237,35 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("seek", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":406 + /* "MDAnalysis/lib/formats/libdcd.pyx":408 * * """ * if frame >= self.n_frames: # <<<<<<<<<<<<<< * raise EOFError('Trying to seek over max number of frames') * self.reached_eof = False */ - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_frame, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_frame, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":407 + /* "MDAnalysis/lib/formats/libdcd.pyx":409 * """ * if frame >= self.n_frames: * raise EOFError('Trying to seek over max number of frames') # <<<<<<<<<<<<<< * self.reached_eof = False * */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 407, __pyx_L1_error) + __PYX_ERR(0, 409, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":406 + /* "MDAnalysis/lib/formats/libdcd.pyx":408 * * """ * if frame >= self.n_frames: # <<<<<<<<<<<<<< @@ -6188,7 +6274,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":408 + /* "MDAnalysis/lib/formats/libdcd.pyx":410 * if frame >= self.n_frames: * raise EOFError('Trying to seek over max number of frames') * self.reached_eof = False # <<<<<<<<<<<<<< @@ -6197,20 +6283,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str */ __pyx_v_self->reached_eof = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":411 + /* "MDAnalysis/lib/formats/libdcd.pyx":413 * * cdef fio_size_t offset * if frame == 0: # <<<<<<<<<<<<<< * offset = self._header_size * else: */ - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_frame, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_frame, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/libdcd.pyx":412 + /* "MDAnalysis/lib/formats/libdcd.pyx":414 * cdef fio_size_t offset * if frame == 0: * offset = self._header_size # <<<<<<<<<<<<<< @@ -6220,7 +6306,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str __pyx_t_4 = __pyx_v_self->_header_size; __pyx_v_offset = __pyx_t_4; - /* "MDAnalysis/lib/formats/libdcd.pyx":411 + /* "MDAnalysis/lib/formats/libdcd.pyx":413 * * cdef fio_size_t offset * if frame == 0: # <<<<<<<<<<<<<< @@ -6230,7 +6316,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str goto __pyx_L4; } - /* "MDAnalysis/lib/formats/libdcd.pyx":414 + /* "MDAnalysis/lib/formats/libdcd.pyx":416 * offset = self._header_size * else: * offset = self._header_size + self._firstframesize + self._framesize * (frame - 1) # <<<<<<<<<<<<<< @@ -6238,43 +6324,43 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str * ok = fio_fseek(self.fp, offset, _whence_vals["FIO_SEEK_SET"]) */ /*else*/ { - __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->_header_size + __pyx_v_self->_firstframesize)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->_header_size + __pyx_v_self->_firstframesize)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_framesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_framesize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_frame, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_frame, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyInt_As_off_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_off_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((off_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_offset = __pyx_t_7; } __pyx_L4:; - /* "MDAnalysis/lib/formats/libdcd.pyx":416 + /* "MDAnalysis/lib/formats/libdcd.pyx":418 * offset = self._header_size + self._firstframesize + self._framesize * (frame - 1) * * ok = fio_fseek(self.fp, offset, _whence_vals["FIO_SEEK_SET"]) # <<<<<<<<<<<<<< * if ok != 0: * raise IOError("DCD seek failed with DCD error={}".format(DCD_ERRORS[ok])) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_whence_vals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_whence_vals); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_FIO_SEEK_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_FIO_SEEK_SET); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ok = fio_fseek(__pyx_v_self->fp, __pyx_v_offset, __pyx_t_4); - /* "MDAnalysis/lib/formats/libdcd.pyx":417 + /* "MDAnalysis/lib/formats/libdcd.pyx":419 * * ok = fio_fseek(self.fp, offset, _whence_vals["FIO_SEEK_SET"]) * if ok != 0: # <<<<<<<<<<<<<< @@ -6284,18 +6370,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str __pyx_t_3 = ((__pyx_v_ok != 0) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":418 + /* "MDAnalysis/lib/formats/libdcd.pyx":420 * ok = fio_fseek(self.fp, offset, _whence_vals["FIO_SEEK_SET"]) * if ok != 0: * raise IOError("DCD seek failed with DCD error={}".format(DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * self.current_frame = frame * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_DCD_seek_failed_with_DCD_error, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_DCD_seek_failed_with_DCD_error, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_ok, __pyx_t_10MDAnalysis_3lib_7formats_6libdcd_fio_size_t, 1, __Pyx_PyInt_From_off_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_ok, __pyx_t_10MDAnalysis_3lib_7formats_6libdcd_fio_size_t, 1, __Pyx_PyInt_From_off_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -6309,14 +6395,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str } } if (!__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6325,33 +6411,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_1}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 418, __pyx_L1_error) + __PYX_ERR(0, 420, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":417 + /* "MDAnalysis/lib/formats/libdcd.pyx":419 * * ok = fio_fseek(self.fp, offset, _whence_vals["FIO_SEEK_SET"]) * if ok != 0: # <<<<<<<<<<<<<< @@ -6360,17 +6446,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":419 + /* "MDAnalysis/lib/formats/libdcd.pyx":421 * if ok != 0: * raise IOError("DCD seek failed with DCD error={}".format(DCD_ERRORS[ok])) * self.current_frame = frame # <<<<<<<<<<<<<< * * @property */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_frame); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_frame); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_v_self->current_frame = __pyx_t_4; - /* "MDAnalysis/lib/formats/libdcd.pyx":395 + /* "MDAnalysis/lib/formats/libdcd.pyx":397 * return nframessize / self._framesize + 1 * * def seek(self, frame): # <<<<<<<<<<<<<< @@ -6395,7 +6481,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_26seek(str return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":422 +/* "MDAnalysis/lib/formats/libdcd.pyx":424 * * @property * def header(self): # <<<<<<<<<<<<<< @@ -6423,7 +6509,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_6header___ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":436 + /* "MDAnalysis/lib/formats/libdcd.pyx":438 * * """ * return {'natoms': self.natoms, # <<<<<<<<<<<<<< @@ -6431,71 +6517,71 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_6header___ * 'nsavc': self.nsavc, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_natoms, __pyx_t_2) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_natoms, __pyx_t_2) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":437 + /* "MDAnalysis/lib/formats/libdcd.pyx":439 * """ * return {'natoms': self.natoms, * 'istart': self.istart, # <<<<<<<<<<<<<< * 'nsavc': self.nsavc, * 'delta': self.delta, */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->istart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->istart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_istart, __pyx_t_2) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_istart, __pyx_t_2) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":438 + /* "MDAnalysis/lib/formats/libdcd.pyx":440 * return {'natoms': self.natoms, * 'istart': self.istart, * 'nsavc': self.nsavc, # <<<<<<<<<<<<<< * 'delta': self.delta, * 'is_periodic': self.is_periodic, */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nsavc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nsavc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nsavc, __pyx_t_2) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nsavc, __pyx_t_2) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":439 + /* "MDAnalysis/lib/formats/libdcd.pyx":441 * 'istart': self.istart, * 'nsavc': self.nsavc, * 'delta': self.delta, # <<<<<<<<<<<<<< * 'is_periodic': self.is_periodic, * 'remarks': self.remarks} */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->delta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->delta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delta, __pyx_t_2) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delta, __pyx_t_2) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":440 + /* "MDAnalysis/lib/formats/libdcd.pyx":442 * 'nsavc': self.nsavc, * 'delta': self.delta, * 'is_periodic': self.is_periodic, # <<<<<<<<<<<<<< * 'remarks': self.remarks} * */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_periodic, __pyx_v_self->is_periodic) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_periodic, __pyx_v_self->is_periodic) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":441 + /* "MDAnalysis/lib/formats/libdcd.pyx":443 * 'delta': self.delta, * 'is_periodic': self.is_periodic, * 'remarks': self.remarks} # <<<<<<<<<<<<<< * * @property */ - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_remarks, __pyx_v_self->remarks) < 0) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_remarks, __pyx_v_self->remarks) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/libdcd.pyx":422 + /* "MDAnalysis/lib/formats/libdcd.pyx":424 * * @property * def header(self): # <<<<<<<<<<<<<< @@ -6515,7 +6601,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_6header___ return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":444 +/* "MDAnalysis/lib/formats/libdcd.pyx":446 * * @property * def charmm_bitfield(self): # <<<<<<<<<<<<<< @@ -6542,7 +6628,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_15charmm_b PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":460 + /* "MDAnalysis/lib/formats/libdcd.pyx":462 * * """ * return self.charmm # <<<<<<<<<<<<<< @@ -6550,13 +6636,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_15charmm_b * def write_header(self, remarks, natoms, istart, nsavc, delta, is_periodic): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/libdcd.pyx":444 + /* "MDAnalysis/lib/formats/libdcd.pyx":446 * * @property * def charmm_bitfield(self): # <<<<<<<<<<<<<< @@ -6575,7 +6661,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_15charmm_b return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":462 +/* "MDAnalysis/lib/formats/libdcd.pyx":464 * return self.charmm * * def write_header(self, remarks, natoms, istart, nsavc, delta, is_periodic): # <<<<<<<<<<<<<< @@ -6627,35 +6713,35 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_29write_he case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_natoms)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 1); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 1); __PYX_ERR(0, 464, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_istart)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 2); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 2); __PYX_ERR(0, 464, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsavc)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 3); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 3); __PYX_ERR(0, 464, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delta)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 4); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 4); __PYX_ERR(0, 464, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_periodic)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 5); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, 5); __PYX_ERR(0, 464, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_header") < 0)) __PYX_ERR(0, 462, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_header") < 0)) __PYX_ERR(0, 464, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -6676,7 +6762,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_29write_he } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 462, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write_header", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 464, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.formats.libdcd.DCDFile.write_header", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -6711,7 +6797,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __Pyx_RefNannySetupContext("write_header", 0); __Pyx_INCREF(__pyx_v_remarks); - /* "MDAnalysis/lib/formats/libdcd.pyx":485 + /* "MDAnalysis/lib/formats/libdcd.pyx":487 * * """ * if not self.is_open: # <<<<<<<<<<<<<< @@ -6721,20 +6807,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":486 + /* "MDAnalysis/lib/formats/libdcd.pyx":488 * """ * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if not self.mode=='w': * raise IOError("Incorrect file mode for writing.") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 486, __pyx_L1_error) + __PYX_ERR(0, 488, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":485 + /* "MDAnalysis/lib/formats/libdcd.pyx":487 * * """ * if not self.is_open: # <<<<<<<<<<<<<< @@ -6743,31 +6829,31 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":487 + /* "MDAnalysis/lib/formats/libdcd.pyx":489 * if not self.is_open: * raise IOError("No file open") * if not self.mode=='w': # <<<<<<<<<<<<<< * raise IOError("Incorrect file mode for writing.") * if self.wrote_header: */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 489, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":488 + /* "MDAnalysis/lib/formats/libdcd.pyx":490 * raise IOError("No file open") * if not self.mode=='w': * raise IOError("Incorrect file mode for writing.") # <<<<<<<<<<<<<< * if self.wrote_header: * raise IOError("Header already written") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 488, __pyx_L1_error) + __PYX_ERR(0, 490, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":487 + /* "MDAnalysis/lib/formats/libdcd.pyx":489 * if not self.is_open: * raise IOError("No file open") * if not self.mode=='w': # <<<<<<<<<<<<<< @@ -6776,7 +6862,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":489 + /* "MDAnalysis/lib/formats/libdcd.pyx":491 * if not self.mode=='w': * raise IOError("Incorrect file mode for writing.") * if self.wrote_header: # <<<<<<<<<<<<<< @@ -6786,20 +6872,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __pyx_t_3 = (__pyx_v_self->wrote_header != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":490 + /* "MDAnalysis/lib/formats/libdcd.pyx":492 * raise IOError("Incorrect file mode for writing.") * if self.wrote_header: * raise IOError("Header already written") # <<<<<<<<<<<<<< * * cdef int with_unitcell = is_periodic */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 490, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":489 + /* "MDAnalysis/lib/formats/libdcd.pyx":491 * if not self.mode=='w': * raise IOError("Incorrect file mode for writing.") * if self.wrote_header: # <<<<<<<<<<<<<< @@ -6808,46 +6894,46 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":492 + /* "MDAnalysis/lib/formats/libdcd.pyx":494 * raise IOError("Header already written") * * cdef int with_unitcell = is_periodic # <<<<<<<<<<<<<< * if is_periodic: * self.charmm = DCD_HAS_EXTRA_BLOCK | DCD_IS_CHARMM */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_is_periodic); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_is_periodic); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) __pyx_v_with_unitcell = __pyx_t_4; - /* "MDAnalysis/lib/formats/libdcd.pyx":493 + /* "MDAnalysis/lib/formats/libdcd.pyx":495 * * cdef int with_unitcell = is_periodic * if is_periodic: # <<<<<<<<<<<<<< * self.charmm = DCD_HAS_EXTRA_BLOCK | DCD_IS_CHARMM * self.natoms = natoms */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_periodic); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_is_periodic); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 495, __pyx_L1_error) if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/libdcd.pyx":494 + /* "MDAnalysis/lib/formats/libdcd.pyx":496 * cdef int with_unitcell = is_periodic * if is_periodic: * self.charmm = DCD_HAS_EXTRA_BLOCK | DCD_IS_CHARMM # <<<<<<<<<<<<<< * self.natoms = natoms * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_IS_CHARMM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_IS_CHARMM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Or(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_6 = PyNumber_Or(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_self->charmm = __pyx_t_4; - /* "MDAnalysis/lib/formats/libdcd.pyx":493 + /* "MDAnalysis/lib/formats/libdcd.pyx":495 * * cdef int with_unitcell = is_periodic * if is_periodic: # <<<<<<<<<<<<<< @@ -6856,34 +6942,34 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":495 + /* "MDAnalysis/lib/formats/libdcd.pyx":497 * if is_periodic: * self.charmm = DCD_HAS_EXTRA_BLOCK | DCD_IS_CHARMM * self.natoms = natoms # <<<<<<<<<<<<<< * * if isinstance(remarks, six.string_types): */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_natoms); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_natoms); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error) __pyx_v_self->natoms = __pyx_t_4; - /* "MDAnalysis/lib/formats/libdcd.pyx":497 + /* "MDAnalysis/lib/formats/libdcd.pyx":499 * self.natoms = natoms * * if isinstance(remarks, six.string_types): # <<<<<<<<<<<<<< * try: * remarks = bytearray(remarks, 'ascii') */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_six); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_string_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = PyObject_IsInstance(__pyx_v_remarks, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 497, __pyx_L1_error) + __pyx_t_3 = PyObject_IsInstance(__pyx_v_remarks, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { - /* "MDAnalysis/lib/formats/libdcd.pyx":498 + /* "MDAnalysis/lib/formats/libdcd.pyx":500 * * if isinstance(remarks, six.string_types): * try: # <<<<<<<<<<<<<< @@ -6899,14 +6985,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __Pyx_XGOTREF(__pyx_t_9); /*try:*/ { - /* "MDAnalysis/lib/formats/libdcd.pyx":499 + /* "MDAnalysis/lib/formats/libdcd.pyx":501 * if isinstance(remarks, six.string_types): * try: * remarks = bytearray(remarks, 'ascii') # <<<<<<<<<<<<<< * except UnicodeDecodeError: * remarks = bytearray(remarks) */ - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 499, __pyx_L8_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_remarks); __Pyx_GIVEREF(__pyx_v_remarks); @@ -6914,13 +7000,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __Pyx_INCREF(__pyx_n_s_ascii); __Pyx_GIVEREF(__pyx_n_s_ascii); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_ascii); - __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L8_error) + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_remarks, __pyx_t_6); __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":498 + /* "MDAnalysis/lib/formats/libdcd.pyx":500 * * if isinstance(remarks, six.string_types): * try: # <<<<<<<<<<<<<< @@ -6937,7 +7023,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":500 + /* "MDAnalysis/lib/formats/libdcd.pyx":502 * try: * remarks = bytearray(remarks, 'ascii') * except UnicodeDecodeError: # <<<<<<<<<<<<<< @@ -6947,19 +7033,19 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_4) { __Pyx_AddTraceback("MDAnalysis.lib.formats.libdcd.DCDFile.write_header", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(0, 500, __pyx_L10_except_error) + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(0, 502, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_2); - /* "MDAnalysis/lib/formats/libdcd.pyx":501 + /* "MDAnalysis/lib/formats/libdcd.pyx":503 * remarks = bytearray(remarks, 'ascii') * except UnicodeDecodeError: * remarks = bytearray(remarks) # <<<<<<<<<<<<<< * * ok = write_dcdheader(self.fp, remarks, self.natoms, istart, */ - __pyx_t_10 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_v_remarks); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 501, __pyx_L10_except_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_v_remarks); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 503, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF_SET(__pyx_v_remarks, __pyx_t_10); __pyx_t_10 = 0; @@ -6971,7 +7057,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he goto __pyx_L10_except_error; __pyx_L10_except_error:; - /* "MDAnalysis/lib/formats/libdcd.pyx":498 + /* "MDAnalysis/lib/formats/libdcd.pyx":500 * * if isinstance(remarks, six.string_types): * try: # <<<<<<<<<<<<<< @@ -6991,7 +7077,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __pyx_L13_try_end:; } - /* "MDAnalysis/lib/formats/libdcd.pyx":497 + /* "MDAnalysis/lib/formats/libdcd.pyx":499 * self.natoms = natoms * * if isinstance(remarks, six.string_types): # <<<<<<<<<<<<<< @@ -7000,27 +7086,27 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":503 + /* "MDAnalysis/lib/formats/libdcd.pyx":505 * remarks = bytearray(remarks) * * ok = write_dcdheader(self.fp, remarks, self.natoms, istart, # <<<<<<<<<<<<<< * nsavc, delta, with_unitcell, * self.charmm) */ - __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_remarks); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_istart); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_remarks); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_istart); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 505, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":504 + /* "MDAnalysis/lib/formats/libdcd.pyx":506 * * ok = write_dcdheader(self.fp, remarks, self.natoms, istart, * nsavc, delta, with_unitcell, # <<<<<<<<<<<<<< * self.charmm) * if ok != 0: */ - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_nsavc); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error) - __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_nsavc); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_delta); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":503 + /* "MDAnalysis/lib/formats/libdcd.pyx":505 * remarks = bytearray(remarks) * * ok = write_dcdheader(self.fp, remarks, self.natoms, istart, # <<<<<<<<<<<<<< @@ -7029,7 +7115,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ __pyx_v_ok = write_dcdheader(__pyx_v_self->fp, __pyx_t_11, __pyx_v_self->natoms, __pyx_t_4, __pyx_t_12, __pyx_t_13, __pyx_v_with_unitcell, __pyx_v_self->charmm); - /* "MDAnalysis/lib/formats/libdcd.pyx":506 + /* "MDAnalysis/lib/formats/libdcd.pyx":508 * nsavc, delta, with_unitcell, * self.charmm) * if ok != 0: # <<<<<<<<<<<<<< @@ -7039,18 +7125,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he __pyx_t_1 = ((__pyx_v_ok != 0) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":507 + /* "MDAnalysis/lib/formats/libdcd.pyx":509 * self.charmm) * if ok != 0: * raise IOError("Writing DCD header failed: {}".format(DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * self.wrote_header = True * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Writing_DCD_header_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Writing_DCD_header_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -7064,14 +7150,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he } } if (!__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -7080,33 +7166,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { - __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_10); __pyx_t_10 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 507, __pyx_L1_error) + __PYX_ERR(0, 509, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":506 + /* "MDAnalysis/lib/formats/libdcd.pyx":508 * nsavc, delta, with_unitcell, * self.charmm) * if ok != 0: # <<<<<<<<<<<<<< @@ -7115,7 +7201,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":508 + /* "MDAnalysis/lib/formats/libdcd.pyx":510 * if ok != 0: * raise IOError("Writing DCD header failed: {}".format(DCD_ERRORS[ok])) * self.wrote_header = True # <<<<<<<<<<<<<< @@ -7124,7 +7210,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he */ __pyx_v_self->wrote_header = 1; - /* "MDAnalysis/lib/formats/libdcd.pyx":462 + /* "MDAnalysis/lib/formats/libdcd.pyx":464 * return self.charmm * * def write_header(self, remarks, natoms, istart, nsavc, delta, is_periodic): # <<<<<<<<<<<<<< @@ -7150,7 +7236,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_28write_he return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":510 +/* "MDAnalysis/lib/formats/libdcd.pyx":512 * self.wrote_header = True * * def write(self, xyz, box=None): # <<<<<<<<<<<<<< @@ -7195,7 +7281,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_31write(Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) __PYX_ERR(0, 510, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) __PYX_ERR(0, 512, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7211,7 +7297,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_31write(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("write", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("write", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.formats.libdcd.DCDFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7252,7 +7338,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st __Pyx_INCREF(__pyx_v_xyz); __Pyx_INCREF(__pyx_v_box); - /* "MDAnalysis/lib/formats/libdcd.pyx":522 + /* "MDAnalysis/lib/formats/libdcd.pyx":524 * * """ * if not self.is_open: # <<<<<<<<<<<<<< @@ -7262,20 +7348,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":523 + /* "MDAnalysis/lib/formats/libdcd.pyx":525 * """ * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if self.mode != 'w': * raise IOError('File opened in mode: {}. Writing only allowed ' */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 523, __pyx_L1_error) + __PYX_ERR(0, 525, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":522 + /* "MDAnalysis/lib/formats/libdcd.pyx":524 * * """ * if not self.is_open: # <<<<<<<<<<<<<< @@ -7284,45 +7370,45 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":524 + /* "MDAnalysis/lib/formats/libdcd.pyx":526 * if not self.is_open: * raise IOError("No file open") * if self.mode != 'w': # <<<<<<<<<<<<<< * raise IOError('File opened in mode: {}. Writing only allowed ' * 'in mode "w"'.format('self.mode')) */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 526, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":526 + /* "MDAnalysis/lib/formats/libdcd.pyx":528 * if self.mode != 'w': * raise IOError('File opened in mode: {}. Writing only allowed ' * 'in mode "w"'.format('self.mode')) # <<<<<<<<<<<<<< * if (self.charmm & DCD_HAS_EXTRA_BLOCK): * if len(box) != 6: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Writing_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Writing_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":525 + /* "MDAnalysis/lib/formats/libdcd.pyx":527 * raise IOError("No file open") * if self.mode != 'w': * raise IOError('File opened in mode: {}. Writing only allowed ' # <<<<<<<<<<<<<< * 'in mode "w"'.format('self.mode')) * if (self.charmm & DCD_HAS_EXTRA_BLOCK): */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 525, __pyx_L1_error) + __PYX_ERR(0, 527, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":524 + /* "MDAnalysis/lib/formats/libdcd.pyx":526 * if not self.is_open: * raise IOError("No file open") * if self.mode != 'w': # <<<<<<<<<<<<<< @@ -7331,46 +7417,46 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":527 + /* "MDAnalysis/lib/formats/libdcd.pyx":529 * raise IOError('File opened in mode: {}. Writing only allowed ' * 'in mode "w"'.format('self.mode')) * if (self.charmm & DCD_HAS_EXTRA_BLOCK): # <<<<<<<<<<<<<< * if len(box) != 6: * raise ValueError("box size is wrong should be 6, got: {}".format(box.size)) */ - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->charmm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_HAS_EXTRA_BLOCK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_And(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_5 = PyNumber_And(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/libdcd.pyx":528 + /* "MDAnalysis/lib/formats/libdcd.pyx":530 * 'in mode "w"'.format('self.mode')) * if (self.charmm & DCD_HAS_EXTRA_BLOCK): * if len(box) != 6: # <<<<<<<<<<<<<< * raise ValueError("box size is wrong should be 6, got: {}".format(box.size)) * else: */ - __pyx_t_6 = PyObject_Length(__pyx_v_box); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_v_box); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 530, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_6 != 6) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":529 + /* "MDAnalysis/lib/formats/libdcd.pyx":531 * if (self.charmm & DCD_HAS_EXTRA_BLOCK): * if len(box) != 6: * raise ValueError("box size is wrong should be 6, got: {}".format(box.size)) # <<<<<<<<<<<<<< * else: * # use a dummy box. It won't be written anyway in readdcd. */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_box_size_is_wrong_should_be_6_go, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_box_size_is_wrong_should_be_6_go, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_box, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_box, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -7383,14 +7469,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } } if (!__pyx_t_7) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -7399,33 +7485,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_2}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 529, __pyx_L1_error) + __PYX_ERR(0, 531, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":528 + /* "MDAnalysis/lib/formats/libdcd.pyx":530 * 'in mode "w"'.format('self.mode')) * if (self.charmm & DCD_HAS_EXTRA_BLOCK): * if len(box) != 6: # <<<<<<<<<<<<<< @@ -7434,7 +7520,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":527 + /* "MDAnalysis/lib/formats/libdcd.pyx":529 * raise IOError('File opened in mode: {}. Writing only allowed ' * 'in mode "w"'.format('self.mode')) * if (self.charmm & DCD_HAS_EXTRA_BLOCK): # <<<<<<<<<<<<<< @@ -7444,7 +7530,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st goto __pyx_L5; } - /* "MDAnalysis/lib/formats/libdcd.pyx":532 + /* "MDAnalysis/lib/formats/libdcd.pyx":534 * else: * # use a dummy box. It won't be written anyway in readdcd. * box = np.zeros(6) # <<<<<<<<<<<<<< @@ -7452,12 +7538,12 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st * if not self.wrote_header: */ /*else*/ { - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_box, __pyx_t_4); @@ -7465,7 +7551,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } __pyx_L5:; - /* "MDAnalysis/lib/formats/libdcd.pyx":534 + /* "MDAnalysis/lib/formats/libdcd.pyx":536 * box = np.zeros(6) * * if not self.wrote_header: # <<<<<<<<<<<<<< @@ -7475,20 +7561,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st __pyx_t_3 = ((!(__pyx_v_self->wrote_header != 0)) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":535 + /* "MDAnalysis/lib/formats/libdcd.pyx":537 * * if not self.wrote_header: * raise IOError("write header first before frames can be written") # <<<<<<<<<<<<<< * xyz = np.asarray(xyz, order='F', dtype=FLOAT) * if xyz.shape != (self.natoms, 3): */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 535, __pyx_L1_error) + __PYX_ERR(0, 537, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":534 + /* "MDAnalysis/lib/formats/libdcd.pyx":536 * box = np.zeros(6) * * if not self.wrote_header: # <<<<<<<<<<<<<< @@ -7497,31 +7583,31 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":536 + /* "MDAnalysis/lib/formats/libdcd.pyx":538 * if not self.wrote_header: * raise IOError("write header first before frames can be written") * xyz = np.asarray(xyz, order='F', dtype=FLOAT) # <<<<<<<<<<<<<< * if xyz.shape != (self.natoms, 3): * raise ValueError("xyz shape is wrong should be (natoms, 3), got:".format(xyz.shape)) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_xyz); __Pyx_GIVEREF(__pyx_v_xyz); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_xyz); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 536, __pyx_L1_error) - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 536, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7529,18 +7615,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st __Pyx_DECREF_SET(__pyx_v_xyz, __pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":537 + /* "MDAnalysis/lib/formats/libdcd.pyx":539 * raise IOError("write header first before frames can be written") * xyz = np.asarray(xyz, order='F', dtype=FLOAT) * if xyz.shape != (self.natoms, 3): # <<<<<<<<<<<<<< * raise ValueError("xyz shape is wrong should be (natoms, 3), got:".format(xyz.shape)) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); @@ -7548,23 +7634,23 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st __Pyx_GIVEREF(__pyx_int_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":538 + /* "MDAnalysis/lib/formats/libdcd.pyx":540 * xyz = np.asarray(xyz, order='F', dtype=FLOAT) * if xyz.shape != (self.natoms, 3): * raise ValueError("xyz shape is wrong should be (natoms, 3), got:".format(xyz.shape)) # <<<<<<<<<<<<<< * * cdef DOUBLE_T[::1] c_box = np.asarray(box, order='C', dtype=DOUBLE) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_xyz_shape_is_wrong_should_be_nat, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_xyz_shape_is_wrong_should_be_nat, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_xyz, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -7577,14 +7663,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } } if (!__pyx_t_5) { - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -7593,33 +7679,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 538, __pyx_L1_error) + __PYX_ERR(0, 540, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":537 + /* "MDAnalysis/lib/formats/libdcd.pyx":539 * raise IOError("write header first before frames can be written") * xyz = np.asarray(xyz, order='F', dtype=FLOAT) * if xyz.shape != (self.natoms, 3): # <<<<<<<<<<<<<< @@ -7628,87 +7714,87 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":540 + /* "MDAnalysis/lib/formats/libdcd.pyx":542 * raise ValueError("xyz shape is wrong should be (natoms, 3), got:".format(xyz.shape)) * * cdef DOUBLE_T[::1] c_box = np.asarray(box, order='C', dtype=DOUBLE) # <<<<<<<<<<<<<< * cdef FLOAT_T[::1] x = xyz[:, 0] * cdef FLOAT_T[::1] y = xyz[:, 1] */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_box); __Pyx_GIVEREF(__pyx_v_box); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_box); - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 540, __pyx_L1_error) - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_c_box = __pyx_t_9; __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":541 + /* "MDAnalysis/lib/formats/libdcd.pyx":543 * * cdef DOUBLE_T[::1] c_box = np.asarray(box, order='C', dtype=DOUBLE) * cdef FLOAT_T[::1] x = xyz[:, 0] # <<<<<<<<<<<<<< * cdef FLOAT_T[::1] y = xyz[:, 1] * cdef FLOAT_T[::1] z = xyz[:, 2] */ - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_xyz, __pyx_tuple__18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_xyz, __pyx_tuple__19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_x = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":542 + /* "MDAnalysis/lib/formats/libdcd.pyx":544 * cdef DOUBLE_T[::1] c_box = np.asarray(box, order='C', dtype=DOUBLE) * cdef FLOAT_T[::1] x = xyz[:, 0] * cdef FLOAT_T[::1] y = xyz[:, 1] # <<<<<<<<<<<<<< * cdef FLOAT_T[::1] z = xyz[:, 2] * */ - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_xyz, __pyx_tuple__20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_xyz, __pyx_tuple__21); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_y = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":543 + /* "MDAnalysis/lib/formats/libdcd.pyx":545 * cdef FLOAT_T[::1] x = xyz[:, 0] * cdef FLOAT_T[::1] y = xyz[:, 1] * cdef FLOAT_T[::1] z = xyz[:, 2] # <<<<<<<<<<<<<< * * step = self.istart + self.current_frame * self.nsavc */ - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_xyz, __pyx_tuple__22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_xyz, __pyx_tuple__23); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_z = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":545 + /* "MDAnalysis/lib/formats/libdcd.pyx":547 * cdef FLOAT_T[::1] z = xyz[:, 2] * * step = self.istart + self.current_frame * self.nsavc # <<<<<<<<<<<<<< @@ -7717,7 +7803,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ __pyx_v_step = (__pyx_v_self->istart + (__pyx_v_self->current_frame * __pyx_v_self->nsavc)); - /* "MDAnalysis/lib/formats/libdcd.pyx":547 + /* "MDAnalysis/lib/formats/libdcd.pyx":549 * step = self.istart + self.current_frame * self.nsavc * ok = write_dcdstep(self.fp, self.current_frame + 1, step, * self.natoms, &x[0], # <<<<<<<<<<<<<< @@ -7732,10 +7818,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } else if (unlikely(__pyx_t_11 >= __pyx_v_x.shape[0])) __pyx_t_12 = 0; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 547, __pyx_L1_error) + __PYX_ERR(0, 549, __pyx_L1_error) } - /* "MDAnalysis/lib/formats/libdcd.pyx":548 + /* "MDAnalysis/lib/formats/libdcd.pyx":550 * ok = write_dcdstep(self.fp, self.current_frame + 1, step, * self.natoms, &x[0], * &y[0], &z[0], # <<<<<<<<<<<<<< @@ -7750,7 +7836,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } else if (unlikely(__pyx_t_13 >= __pyx_v_y.shape[0])) __pyx_t_12 = 0; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 548, __pyx_L1_error) + __PYX_ERR(0, 550, __pyx_L1_error) } __pyx_t_14 = 0; __pyx_t_12 = -1; @@ -7760,10 +7846,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } else if (unlikely(__pyx_t_14 >= __pyx_v_z.shape[0])) __pyx_t_12 = 0; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 548, __pyx_L1_error) + __PYX_ERR(0, 550, __pyx_L1_error) } - /* "MDAnalysis/lib/formats/libdcd.pyx":549 + /* "MDAnalysis/lib/formats/libdcd.pyx":551 * self.natoms, &x[0], * &y[0], &z[0], * &c_box[0], self.charmm) # <<<<<<<<<<<<<< @@ -7778,10 +7864,10 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } else if (unlikely(__pyx_t_15 >= __pyx_v_c_box.shape[0])) __pyx_t_12 = 0; if (unlikely(__pyx_t_12 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_12); - __PYX_ERR(0, 549, __pyx_L1_error) + __PYX_ERR(0, 551, __pyx_L1_error) } - /* "MDAnalysis/lib/formats/libdcd.pyx":546 + /* "MDAnalysis/lib/formats/libdcd.pyx":548 * * step = self.istart + self.current_frame * self.nsavc * ok = write_dcdstep(self.fp, self.current_frame + 1, step, # <<<<<<<<<<<<<< @@ -7790,7 +7876,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ __pyx_v_ok = write_dcdstep(__pyx_v_self->fp, (__pyx_v_self->current_frame + 1), __pyx_v_step, __pyx_v_self->natoms, ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) __pyx_v_x.data) + __pyx_t_11)) ))))), ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) __pyx_v_y.data) + __pyx_t_13)) ))))), ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) __pyx_v_z.data) + __pyx_t_14)) ))))), ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T *) __pyx_v_c_box.data) + __pyx_t_15)) ))))), __pyx_v_self->charmm); - /* "MDAnalysis/lib/formats/libdcd.pyx":550 + /* "MDAnalysis/lib/formats/libdcd.pyx":552 * &y[0], &z[0], * &c_box[0], self.charmm) * if ok != 0: # <<<<<<<<<<<<<< @@ -7800,18 +7886,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st __pyx_t_3 = ((__pyx_v_ok != 0) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":551 + /* "MDAnalysis/lib/formats/libdcd.pyx":553 * &c_box[0], self.charmm) * if ok != 0: * raise IOError("Couldn't write DCD frame: reason {}".format(DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * * self.current_frame += 1 */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Couldn_t_write_DCD_frame_reason, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Couldn_t_write_DCD_frame_reason, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -7825,14 +7911,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7841,33 +7927,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 551, __pyx_L1_error) + __PYX_ERR(0, 553, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":550 + /* "MDAnalysis/lib/formats/libdcd.pyx":552 * &y[0], &z[0], * &c_box[0], self.charmm) * if ok != 0: # <<<<<<<<<<<<<< @@ -7876,7 +7962,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":553 + /* "MDAnalysis/lib/formats/libdcd.pyx":555 * raise IOError("Couldn't write DCD frame: reason {}".format(DCD_ERRORS[ok])) * * self.current_frame += 1 # <<<<<<<<<<<<<< @@ -7885,7 +7971,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st */ __pyx_v_self->current_frame = (__pyx_v_self->current_frame + 1); - /* "MDAnalysis/lib/formats/libdcd.pyx":510 + /* "MDAnalysis/lib/formats/libdcd.pyx":512 * self.wrote_header = True * * def write(self, xyz, box=None): # <<<<<<<<<<<<<< @@ -7918,7 +8004,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_30write(st return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":555 +/* "MDAnalysis/lib/formats/libdcd.pyx":557 * self.current_frame += 1 * * def read(self): # <<<<<<<<<<<<<< @@ -7961,7 +8047,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("read", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":571 + /* "MDAnalysis/lib/formats/libdcd.pyx":573 * * """ * if self.reached_eof: # <<<<<<<<<<<<<< @@ -7971,20 +8057,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str __pyx_t_1 = (__pyx_v_self->reached_eof != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":572 + /* "MDAnalysis/lib/formats/libdcd.pyx":574 * """ * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') # <<<<<<<<<<<<<< * if not self.is_open: * raise IOError("No file open") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 572, __pyx_L1_error) + __PYX_ERR(0, 574, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":571 + /* "MDAnalysis/lib/formats/libdcd.pyx":573 * * """ * if self.reached_eof: # <<<<<<<<<<<<<< @@ -7993,7 +8079,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":573 + /* "MDAnalysis/lib/formats/libdcd.pyx":575 * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: # <<<<<<<<<<<<<< @@ -8003,20 +8089,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":574 + /* "MDAnalysis/lib/formats/libdcd.pyx":576 * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 574, __pyx_L1_error) + __PYX_ERR(0, 576, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":573 + /* "MDAnalysis/lib/formats/libdcd.pyx":575 * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: # <<<<<<<<<<<<<< @@ -8025,45 +8111,45 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":575 + /* "MDAnalysis/lib/formats/libdcd.pyx":577 * if not self.is_open: * raise IOError("No file open") * if self.mode != 'r': # <<<<<<<<<<<<<< * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 577, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":577 + /* "MDAnalysis/lib/formats/libdcd.pyx":579 * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) # <<<<<<<<<<<<<< * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Reading_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Reading_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":576 + /* "MDAnalysis/lib/formats/libdcd.pyx":578 * raise IOError("No file open") * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' # <<<<<<<<<<<<<< * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 576, __pyx_L1_error) + __PYX_ERR(0, 578, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":575 + /* "MDAnalysis/lib/formats/libdcd.pyx":577 * if not self.is_open: * raise IOError("No file open") * if self.mode != 'r': # <<<<<<<<<<<<<< @@ -8072,7 +8158,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":578 + /* "MDAnalysis/lib/formats/libdcd.pyx":580 * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: # <<<<<<<<<<<<<< @@ -8082,20 +8168,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str __pyx_t_3 = ((__pyx_v_self->n_frames == 0) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":579 + /* "MDAnalysis/lib/formats/libdcd.pyx":581 * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") # <<<<<<<<<<<<<< * * cdef np.ndarray xyz = np.empty((self.natoms, self.ndims), dtype=FLOAT, order='F') */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 579, __pyx_L1_error) + __PYX_ERR(0, 581, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":578 + /* "MDAnalysis/lib/formats/libdcd.pyx":580 * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: # <<<<<<<<<<<<<< @@ -8104,23 +8190,23 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":581 + /* "MDAnalysis/lib/formats/libdcd.pyx":583 * raise IOError("opened empty file. No frames are saved") * * cdef np.ndarray xyz = np.empty((self.natoms, self.ndims), dtype=FLOAT, order='F') # <<<<<<<<<<<<<< * cdef np.ndarray unitcell = np.empty(6, dtype=DOUBLE) * unitcell[0] = unitcell[2] = unitcell[5] = 0.0; */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -8128,108 +8214,108 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 581, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 581, __pyx_L1_error) + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 583, __pyx_L1_error) __pyx_v_xyz = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":582 + /* "MDAnalysis/lib/formats/libdcd.pyx":584 * * cdef np.ndarray xyz = np.empty((self.natoms, self.ndims), dtype=FLOAT, order='F') * cdef np.ndarray unitcell = np.empty(6, dtype=DOUBLE) # <<<<<<<<<<<<<< * unitcell[0] = unitcell[2] = unitcell[5] = 0.0; * unitcell[4] = unitcell[3] = unitcell[1] = 90.0; */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 582, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__27, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__28, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 582, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 584, __pyx_L1_error) __pyx_v_unitcell = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":583 + /* "MDAnalysis/lib/formats/libdcd.pyx":585 * cdef np.ndarray xyz = np.empty((self.natoms, self.ndims), dtype=FLOAT, order='F') * cdef np.ndarray unitcell = np.empty(6, dtype=DOUBLE) * unitcell[0] = unitcell[2] = unitcell[5] = 0.0; # <<<<<<<<<<<<<< * unitcell[4] = unitcell[3] = unitcell[1] = 90.0; * */ - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 0, __pyx_float_0_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 583, __pyx_L1_error) - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 2, __pyx_float_0_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 583, __pyx_L1_error) - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 5, __pyx_float_0_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 583, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 0, __pyx_float_0_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 2, __pyx_float_0_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 5, __pyx_float_0_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 585, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":584 + /* "MDAnalysis/lib/formats/libdcd.pyx":586 * cdef np.ndarray unitcell = np.empty(6, dtype=DOUBLE) * unitcell[0] = unitcell[2] = unitcell[5] = 0.0; * unitcell[4] = unitcell[3] = unitcell[1] = 90.0; # <<<<<<<<<<<<<< * * first_frame = self.current_frame == 0 */ - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 4, __pyx_float_90_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 3, __pyx_float_90_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) - if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 1, __pyx_float_90_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 4, __pyx_float_90_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 586, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 3, __pyx_float_90_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 586, __pyx_L1_error) + if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_unitcell), 1, __pyx_float_90_0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 586, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":586 + /* "MDAnalysis/lib/formats/libdcd.pyx":588 * unitcell[4] = unitcell[3] = unitcell[1] = 90.0; * * first_frame = self.current_frame == 0 # <<<<<<<<<<<<<< * ok = self.c_readframes_helper(xyz[:, 0], xyz[:, 1], xyz[:, 2], unitcell, first_frame) * if ok != 0 and ok != -4: */ - __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_self->current_frame == 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_self->current_frame == 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_first_frame = __pyx_t_5; __pyx_t_5 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":587 + /* "MDAnalysis/lib/formats/libdcd.pyx":589 * * first_frame = self.current_frame == 0 * ok = self.c_readframes_helper(xyz[:, 0], xyz[:, 1], xyz[:, 2], unitcell, first_frame) # <<<<<<<<<<<<<< * if ok != 0 and ok != -4: * raise IOError("Reading DCD header failed: {}".format(DCD_ERRORS[ok])) */ - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__29); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__30); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__31); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__33); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz), __pyx_tuple__34); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(((PyObject *)__pyx_v_unitcell), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 587, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_first_frame); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(((PyObject *)__pyx_v_unitcell), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_first_frame); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L1_error) __pyx_v_ok = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_7formats_6libdcd_DCDFile *)__pyx_v_self->__pyx_vtab)->c_readframes_helper(__pyx_v_self, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11); __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); __pyx_t_7.memview = NULL; @@ -8244,7 +8330,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":588 + /* "MDAnalysis/lib/formats/libdcd.pyx":590 * first_frame = self.current_frame == 0 * ok = self.c_readframes_helper(xyz[:, 0], xyz[:, 1], xyz[:, 2], unitcell, first_frame) * if ok != 0 and ok != -4: # <<<<<<<<<<<<<< @@ -8262,18 +8348,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str } if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":589 + /* "MDAnalysis/lib/formats/libdcd.pyx":591 * ok = self.c_readframes_helper(xyz[:, 0], xyz[:, 1], xyz[:, 2], unitcell, first_frame) * if ok != 0 and ok != -4: * raise IOError("Reading DCD header failed: {}".format(DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * * # we couldn't read any more frames. */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_header_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_header_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -8287,14 +8373,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str } } if (!__pyx_t_6) { - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_5); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -8303,33 +8389,33 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 589, __pyx_L1_error) + __PYX_ERR(0, 591, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":588 + /* "MDAnalysis/lib/formats/libdcd.pyx":590 * first_frame = self.current_frame == 0 * ok = self.c_readframes_helper(xyz[:, 0], xyz[:, 1], xyz[:, 2], unitcell, first_frame) * if ok != 0 and ok != -4: # <<<<<<<<<<<<<< @@ -8338,7 +8424,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":592 + /* "MDAnalysis/lib/formats/libdcd.pyx":594 * * # we couldn't read any more frames. * if ok == -4: # <<<<<<<<<<<<<< @@ -8348,7 +8434,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str __pyx_t_3 = ((__pyx_v_ok == -4L) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":593 + /* "MDAnalysis/lib/formats/libdcd.pyx":595 * # we couldn't read any more frames. * if ok == -4: * self.reached_eof = True # <<<<<<<<<<<<<< @@ -8357,7 +8443,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ __pyx_v_self->reached_eof = 1; - /* "MDAnalysis/lib/formats/libdcd.pyx":594 + /* "MDAnalysis/lib/formats/libdcd.pyx":596 * if ok == -4: * self.reached_eof = True * raise StopIteration # <<<<<<<<<<<<<< @@ -8365,9 +8451,9 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str * self.current_frame += 1 */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); - __PYX_ERR(0, 594, __pyx_L1_error) + __PYX_ERR(0, 596, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":592 + /* "MDAnalysis/lib/formats/libdcd.pyx":594 * * # we couldn't read any more frames. * if ok == -4: # <<<<<<<<<<<<<< @@ -8376,7 +8462,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":596 + /* "MDAnalysis/lib/formats/libdcd.pyx":598 * raise StopIteration * * self.current_frame += 1 # <<<<<<<<<<<<<< @@ -8385,7 +8471,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str */ __pyx_v_self->current_frame = (__pyx_v_self->current_frame + 1); - /* "MDAnalysis/lib/formats/libdcd.pyx":597 + /* "MDAnalysis/lib/formats/libdcd.pyx":599 * * self.current_frame += 1 * return DCDFrame(xyz, unitcell) # <<<<<<<<<<<<<< @@ -8393,7 +8479,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCDFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCDFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; __pyx_t_11 = 0; @@ -8410,7 +8496,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_unitcell)}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); } else @@ -8418,13 +8504,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_unitcell)}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { - __pyx_t_4 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __pyx_t_12 = NULL; @@ -8435,7 +8521,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str __Pyx_INCREF(((PyObject *)__pyx_v_unitcell)); __Pyx_GIVEREF(((PyObject *)__pyx_v_unitcell)); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_11, ((PyObject *)__pyx_v_unitcell)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -8444,7 +8530,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str __pyx_t_2 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/libdcd.pyx":555 + /* "MDAnalysis/lib/formats/libdcd.pyx":557 * self.current_frame += 1 * * def read(self): # <<<<<<<<<<<<<< @@ -8474,7 +8560,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_32read(str return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":600 +/* "MDAnalysis/lib/formats/libdcd.pyx":602 * * * def readframes(self, start=None, stop=None, step=None, order='fac', indices=None): # <<<<<<<<<<<<<< @@ -8552,7 +8638,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_35readfram } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readframes") < 0)) __PYX_ERR(0, 600, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "readframes") < 0)) __PYX_ERR(0, 602, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -8578,7 +8664,7 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_35readfram } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("readframes", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 600, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("readframes", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 602, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.formats.libdcd.DCDFile.readframes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -8652,7 +8738,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_pybuffernd_box.data = NULL; __pyx_pybuffernd_box.rcbuffer = &__pyx_pybuffer_box; - /* "MDAnalysis/lib/formats/libdcd.pyx":631 + /* "MDAnalysis/lib/formats/libdcd.pyx":633 * * """ * if self.reached_eof: # <<<<<<<<<<<<<< @@ -8662,20 +8748,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_1 = (__pyx_v_self->reached_eof != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":632 + /* "MDAnalysis/lib/formats/libdcd.pyx":634 * """ * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') # <<<<<<<<<<<<<< * if not self.is_open: * raise IOError("No file open") */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_EOFError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 632, __pyx_L1_error) + __PYX_ERR(0, 634, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":631 + /* "MDAnalysis/lib/formats/libdcd.pyx":633 * * """ * if self.reached_eof: # <<<<<<<<<<<<<< @@ -8684,7 +8770,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":633 + /* "MDAnalysis/lib/formats/libdcd.pyx":635 * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: # <<<<<<<<<<<<<< @@ -8694,20 +8780,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_1 = ((!(__pyx_v_self->is_open != 0)) != 0); if (unlikely(__pyx_t_1)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":634 + /* "MDAnalysis/lib/formats/libdcd.pyx":636 * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 634, __pyx_L1_error) + __PYX_ERR(0, 636, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":633 + /* "MDAnalysis/lib/formats/libdcd.pyx":635 * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: # <<<<<<<<<<<<<< @@ -8716,45 +8802,45 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":635 + /* "MDAnalysis/lib/formats/libdcd.pyx":637 * if not self.is_open: * raise IOError("No file open") * if self.mode != 'r': # <<<<<<<<<<<<<< * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) */ - __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 635, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->mode, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 637, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":637 + /* "MDAnalysis/lib/formats/libdcd.pyx":639 * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) # <<<<<<<<<<<<<< * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Reading_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_File_opened_in_mode_Reading_only, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":636 + /* "MDAnalysis/lib/formats/libdcd.pyx":638 * raise IOError("No file open") * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' # <<<<<<<<<<<<<< * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 636, __pyx_L1_error) + __PYX_ERR(0, 638, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":635 + /* "MDAnalysis/lib/formats/libdcd.pyx":637 * if not self.is_open: * raise IOError("No file open") * if self.mode != 'r': # <<<<<<<<<<<<<< @@ -8763,7 +8849,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":638 + /* "MDAnalysis/lib/formats/libdcd.pyx":640 * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: # <<<<<<<<<<<<<< @@ -8773,20 +8859,20 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_3 = ((__pyx_v_self->n_frames == 0) != 0); if (unlikely(__pyx_t_3)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":639 + /* "MDAnalysis/lib/formats/libdcd.pyx":641 * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") # <<<<<<<<<<<<<< * * self.seek(0) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 639, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":638 + /* "MDAnalysis/lib/formats/libdcd.pyx":640 * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: # <<<<<<<<<<<<<< @@ -8795,21 +8881,21 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":641 + /* "MDAnalysis/lib/formats/libdcd.pyx":643 * raise IOError("opened empty file. No frames are saved") * * self.seek(0) # <<<<<<<<<<<<<< * # if we only want to iterate backwards flip start and end * if start is None and stop is None and step is not None and step < 0: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":643 + /* "MDAnalysis/lib/formats/libdcd.pyx":645 * self.seek(0) * # if we only want to iterate backwards flip start and end * if start is None and stop is None and step is not None and step < 0: # <<<<<<<<<<<<<< @@ -8837,14 +8923,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_3 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_step, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_step, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L8_bool_binop_done:; if (__pyx_t_3) { - /* "MDAnalysis/lib/formats/libdcd.pyx":644 + /* "MDAnalysis/lib/formats/libdcd.pyx":646 * # if we only want to iterate backwards flip start and end * if start is None and stop is None and step is not None and step < 0: * stop = -1 # <<<<<<<<<<<<<< @@ -8854,19 +8940,19 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_INCREF(__pyx_int_neg_1); __Pyx_DECREF_SET(__pyx_v_stop, __pyx_int_neg_1); - /* "MDAnalysis/lib/formats/libdcd.pyx":645 + /* "MDAnalysis/lib/formats/libdcd.pyx":647 * if start is None and stop is None and step is not None and step < 0: * stop = -1 * start = self.n_frames - 1 # <<<<<<<<<<<<<< * stop = stop if not stop is None else self.n_frames * start = start if not start is None else 0 */ - __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_self->n_frames - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_self->n_frames - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":643 + /* "MDAnalysis/lib/formats/libdcd.pyx":645 * self.seek(0) * # if we only want to iterate backwards flip start and end * if start is None and stop is None and step is not None and step < 0: # <<<<<<<<<<<<<< @@ -8875,7 +8961,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":646 + /* "MDAnalysis/lib/formats/libdcd.pyx":648 * stop = -1 * start = self.n_frames - 1 * stop = stop if not stop is None else self.n_frames # <<<<<<<<<<<<<< @@ -8887,7 +8973,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_INCREF(__pyx_v_stop); __pyx_t_4 = __pyx_v_stop; } else { - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->n_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_t_2; __pyx_t_2 = 0; @@ -8895,7 +8981,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":647 + /* "MDAnalysis/lib/formats/libdcd.pyx":649 * start = self.n_frames - 1 * stop = stop if not stop is None else self.n_frames * start = start if not start is None else 0 # <<<<<<<<<<<<<< @@ -8913,7 +8999,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":648 + /* "MDAnalysis/lib/formats/libdcd.pyx":650 * stop = stop if not stop is None else self.n_frames * start = start if not start is None else 0 * step = step if not step is None else 1 # <<<<<<<<<<<<<< @@ -8931,14 +9017,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":652 + /* "MDAnalysis/lib/formats/libdcd.pyx":654 * * cdef int n * n = len(range(start, stop, step)) # <<<<<<<<<<<<<< * * cdef np.ndarray[np.int64_t, ndim=1] c_indices */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -8955,7 +9041,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_start, __pyx_v_stop, __pyx_v_step}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else @@ -8963,13 +9049,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_start, __pyx_v_stop, __pyx_v_step}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -8983,88 +9069,61 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_INCREF(__pyx_v_step); __Pyx_GIVEREF(__pyx_v_step); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_step); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 652, __pyx_L1_error) + __pyx_t_9 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_n = __pyx_t_9; - /* "MDAnalysis/lib/formats/libdcd.pyx":655 + /* "MDAnalysis/lib/formats/libdcd.pyx":657 * * cdef np.ndarray[np.int64_t, ndim=1] c_indices * if indices is None: # <<<<<<<<<<<<<< - * c_indices = np.arange(self.natoms) + * c_indices = np.arange(self.natoms, dtype=np.int64) * natoms = self.natoms */ __pyx_t_3 = (__pyx_v_indices == Py_None); __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { - /* "MDAnalysis/lib/formats/libdcd.pyx":656 + /* "MDAnalysis/lib/formats/libdcd.pyx":658 * cdef np.ndarray[np.int64_t, ndim=1] c_indices * if indices is None: - * c_indices = np.arange(self.natoms) # <<<<<<<<<<<<<< + * c_indices = np.arange(self.natoms, dtype=np.int64) # <<<<<<<<<<<<<< * natoms = self.natoms * else: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arange); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 656, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - if (!__pyx_t_6) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_4); - } else { - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_8)) { - PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { - PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - #endif - { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 656, __pyx_L1_error) - __pyx_t_11 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_c_indices.rcbuffer->pybuffer); @@ -9080,15 +9139,15 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_12 = __pyx_t_13 = __pyx_t_14 = 0; } __pyx_pybuffernd_c_indices.diminfo[0].strides = __pyx_pybuffernd_c_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c_indices.diminfo[0].shape = __pyx_pybuffernd_c_indices.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 656, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 658, __pyx_L1_error) } __pyx_t_11 = 0; - __pyx_v_c_indices = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_c_indices = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":657 + /* "MDAnalysis/lib/formats/libdcd.pyx":659 * if indices is None: - * c_indices = np.arange(self.natoms) + * c_indices = np.arange(self.natoms, dtype=np.int64) * natoms = self.natoms # <<<<<<<<<<<<<< * else: * natoms = len(indices) @@ -9096,17 +9155,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_7 = __pyx_v_self->natoms; __pyx_v_natoms = __pyx_t_7; - /* "MDAnalysis/lib/formats/libdcd.pyx":655 + /* "MDAnalysis/lib/formats/libdcd.pyx":657 * * cdef np.ndarray[np.int64_t, ndim=1] c_indices * if indices is None: # <<<<<<<<<<<<<< - * c_indices = np.arange(self.natoms) + * c_indices = np.arange(self.natoms, dtype=np.int64) * natoms = self.natoms */ goto __pyx_L12; } - /* "MDAnalysis/lib/formats/libdcd.pyx":659 + /* "MDAnalysis/lib/formats/libdcd.pyx":661 * natoms = self.natoms * else: * natoms = len(indices) # <<<<<<<<<<<<<< @@ -9114,41 +9173,41 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram * */ /*else*/ { - __pyx_t_9 = PyObject_Length(__pyx_v_indices); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_9 = PyObject_Length(__pyx_v_indices); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 661, __pyx_L1_error) __pyx_v_natoms = __pyx_t_9; - /* "MDAnalysis/lib/formats/libdcd.pyx":660 + /* "MDAnalysis/lib/formats/libdcd.pyx":662 * else: * natoms = len(indices) * c_indices = np.asarray(indices, dtype=np.int64) # <<<<<<<<<<<<<< * * cdef int hash_order = -1 */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_indices); __Pyx_GIVEREF(__pyx_v_indices); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_indices); - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_indices); + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 660, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 662, __pyx_L1_error) __pyx_t_11 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -9165,7 +9224,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_14 = __pyx_t_13 = __pyx_t_12 = 0; } __pyx_pybuffernd_c_indices.diminfo[0].strides = __pyx_pybuffernd_c_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_c_indices.diminfo[0].shape = __pyx_pybuffernd_c_indices.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 660, __pyx_L1_error) + if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 662, __pyx_L1_error) } __pyx_t_11 = 0; __pyx_v_c_indices = ((PyArrayObject *)__pyx_t_6); @@ -9173,7 +9232,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram } __pyx_L12:; - /* "MDAnalysis/lib/formats/libdcd.pyx":662 + /* "MDAnalysis/lib/formats/libdcd.pyx":664 * c_indices = np.asarray(indices, dtype=np.int64) * * cdef int hash_order = -1 # <<<<<<<<<<<<<< @@ -9182,44 +9241,44 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ __pyx_v_hash_order = -1; - /* "MDAnalysis/lib/formats/libdcd.pyx":663 + /* "MDAnalysis/lib/formats/libdcd.pyx":665 * * cdef int hash_order = -1 * if order == 'fac': # <<<<<<<<<<<<<< * shape = (n, natoms, self.ndims) * hash_order = 1 */ - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_fac, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_fac, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 665, __pyx_L1_error) if (__pyx_t_5) { - /* "MDAnalysis/lib/formats/libdcd.pyx":664 + /* "MDAnalysis/lib/formats/libdcd.pyx":666 * cdef int hash_order = -1 * if order == 'fac': * shape = (n, natoms, self.ndims) # <<<<<<<<<<<<<< * hash_order = 1 * elif order == 'fca': */ - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10); __pyx_t_6 = 0; + __pyx_t_8 = 0; __pyx_t_10 = 0; + __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; - __pyx_v_shape = __pyx_t_8; - __pyx_t_8 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":665 + /* "MDAnalysis/lib/formats/libdcd.pyx":667 * if order == 'fac': * shape = (n, natoms, self.ndims) * hash_order = 1 # <<<<<<<<<<<<<< @@ -9228,7 +9287,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ __pyx_v_hash_order = 1; - /* "MDAnalysis/lib/formats/libdcd.pyx":663 + /* "MDAnalysis/lib/formats/libdcd.pyx":665 * * cdef int hash_order = -1 * if order == 'fac': # <<<<<<<<<<<<<< @@ -9238,44 +9297,44 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram goto __pyx_L13; } - /* "MDAnalysis/lib/formats/libdcd.pyx":666 + /* "MDAnalysis/lib/formats/libdcd.pyx":668 * shape = (n, natoms, self.ndims) * hash_order = 1 * elif order == 'fca': # <<<<<<<<<<<<<< * shape = (n, self.ndims, natoms) * hash_order = 2 */ - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_fca, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_fca, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 668, __pyx_L1_error) if (__pyx_t_5) { - /* "MDAnalysis/lib/formats/libdcd.pyx":667 + /* "MDAnalysis/lib/formats/libdcd.pyx":669 * hash_order = 1 * elif order == 'fca': * shape = (n, self.ndims, natoms) # <<<<<<<<<<<<<< * hash_order = 2 * elif order == 'afc': */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 667, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 667, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error) + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_10); - __pyx_t_8 = 0; + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_8); __pyx_t_4 = 0; __pyx_t_10 = 0; + __pyx_t_8 = 0; __pyx_v_shape = __pyx_t_6; __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":668 + /* "MDAnalysis/lib/formats/libdcd.pyx":670 * elif order == 'fca': * shape = (n, self.ndims, natoms) * hash_order = 2 # <<<<<<<<<<<<<< @@ -9284,7 +9343,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ __pyx_v_hash_order = 2; - /* "MDAnalysis/lib/formats/libdcd.pyx":666 + /* "MDAnalysis/lib/formats/libdcd.pyx":668 * shape = (n, natoms, self.ndims) * hash_order = 1 * elif order == 'fca': # <<<<<<<<<<<<<< @@ -9294,44 +9353,44 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram goto __pyx_L13; } - /* "MDAnalysis/lib/formats/libdcd.pyx":669 + /* "MDAnalysis/lib/formats/libdcd.pyx":671 * shape = (n, self.ndims, natoms) * hash_order = 2 * elif order == 'afc': # <<<<<<<<<<<<<< * shape = (natoms, n, self.ndims) * hash_order = 3 */ - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_afc, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_afc, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 671, __pyx_L1_error) if (__pyx_t_5) { - /* "MDAnalysis/lib/formats/libdcd.pyx":670 + /* "MDAnalysis/lib/formats/libdcd.pyx":672 * hash_order = 2 * elif order == 'afc': * shape = (natoms, n, self.ndims) # <<<<<<<<<<<<<< * hash_order = 3 * elif order == 'acf': */ - __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10); __pyx_t_6 = 0; + __pyx_t_8 = 0; __pyx_t_10 = 0; + __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; - __pyx_v_shape = __pyx_t_8; - __pyx_t_8 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":671 + /* "MDAnalysis/lib/formats/libdcd.pyx":673 * elif order == 'afc': * shape = (natoms, n, self.ndims) * hash_order = 3 # <<<<<<<<<<<<<< @@ -9340,7 +9399,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ __pyx_v_hash_order = 3; - /* "MDAnalysis/lib/formats/libdcd.pyx":669 + /* "MDAnalysis/lib/formats/libdcd.pyx":671 * shape = (n, self.ndims, natoms) * hash_order = 2 * elif order == 'afc': # <<<<<<<<<<<<<< @@ -9350,44 +9409,44 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram goto __pyx_L13; } - /* "MDAnalysis/lib/formats/libdcd.pyx":672 + /* "MDAnalysis/lib/formats/libdcd.pyx":674 * shape = (natoms, n, self.ndims) * hash_order = 3 * elif order == 'acf': # <<<<<<<<<<<<<< * shape = (natoms, self.ndims, n) * hash_order = 4 */ - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_acf, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_acf, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 674, __pyx_L1_error) if (__pyx_t_5) { - /* "MDAnalysis/lib/formats/libdcd.pyx":673 + /* "MDAnalysis/lib/formats/libdcd.pyx":675 * hash_order = 3 * elif order == 'acf': * shape = (natoms, self.ndims, n) # <<<<<<<<<<<<<< * hash_order = 4 * elif order == 'caf': */ - __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 673, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_10); - __pyx_t_8 = 0; + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_8); __pyx_t_4 = 0; __pyx_t_10 = 0; + __pyx_t_8 = 0; __pyx_v_shape = __pyx_t_6; __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":674 + /* "MDAnalysis/lib/formats/libdcd.pyx":676 * elif order == 'acf': * shape = (natoms, self.ndims, n) * hash_order = 4 # <<<<<<<<<<<<<< @@ -9396,7 +9455,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ __pyx_v_hash_order = 4; - /* "MDAnalysis/lib/formats/libdcd.pyx":672 + /* "MDAnalysis/lib/formats/libdcd.pyx":674 * shape = (natoms, n, self.ndims) * hash_order = 3 * elif order == 'acf': # <<<<<<<<<<<<<< @@ -9406,44 +9465,44 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram goto __pyx_L13; } - /* "MDAnalysis/lib/formats/libdcd.pyx":675 + /* "MDAnalysis/lib/formats/libdcd.pyx":677 * shape = (natoms, self.ndims, n) * hash_order = 4 * elif order == 'caf': # <<<<<<<<<<<<<< * shape = (self.ndims, natoms, n) * hash_order = 5 */ - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_caf, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_caf, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 677, __pyx_L1_error) if (__pyx_t_5) { - /* "MDAnalysis/lib/formats/libdcd.pyx":676 + /* "MDAnalysis/lib/formats/libdcd.pyx":678 * hash_order = 4 * elif order == 'caf': * shape = (self.ndims, natoms, n) # <<<<<<<<<<<<<< * hash_order = 5 * elif order == 'cfa': */ - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10); __pyx_t_6 = 0; + __pyx_t_8 = 0; __pyx_t_10 = 0; + __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; - __pyx_v_shape = __pyx_t_8; - __pyx_t_8 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":677 + /* "MDAnalysis/lib/formats/libdcd.pyx":679 * elif order == 'caf': * shape = (self.ndims, natoms, n) * hash_order = 5 # <<<<<<<<<<<<<< @@ -9452,7 +9511,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ __pyx_v_hash_order = 5; - /* "MDAnalysis/lib/formats/libdcd.pyx":675 + /* "MDAnalysis/lib/formats/libdcd.pyx":677 * shape = (natoms, self.ndims, n) * hash_order = 4 * elif order == 'caf': # <<<<<<<<<<<<<< @@ -9462,17 +9521,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram goto __pyx_L13; } - /* "MDAnalysis/lib/formats/libdcd.pyx":678 + /* "MDAnalysis/lib/formats/libdcd.pyx":680 * shape = (self.ndims, natoms, n) * hash_order = 5 * elif order == 'cfa': # <<<<<<<<<<<<<< * hash_order = 6 * shape = (self.ndims, n, natoms) */ - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_cfa, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 678, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_order, __pyx_n_s_cfa, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 680, __pyx_L1_error) if (likely(__pyx_t_5)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":679 + /* "MDAnalysis/lib/formats/libdcd.pyx":681 * hash_order = 5 * elif order == 'cfa': * hash_order = 6 # <<<<<<<<<<<<<< @@ -9481,34 +9540,34 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ __pyx_v_hash_order = 6; - /* "MDAnalysis/lib/formats/libdcd.pyx":680 + /* "MDAnalysis/lib/formats/libdcd.pyx":682 * elif order == 'cfa': * hash_order = 6 * shape = (self.ndims, n, natoms) # <<<<<<<<<<<<<< * else: * raise ValueError("unkown order '{}'".format(order)) */ - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error) + __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_natoms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_10); - __pyx_t_8 = 0; + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_8); __pyx_t_4 = 0; __pyx_t_10 = 0; + __pyx_t_8 = 0; __pyx_v_shape = __pyx_t_6; __pyx_t_6 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":678 + /* "MDAnalysis/lib/formats/libdcd.pyx":680 * shape = (self.ndims, natoms, n) * hash_order = 5 * elif order == 'cfa': # <<<<<<<<<<<<<< @@ -9518,7 +9577,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram goto __pyx_L13; } - /* "MDAnalysis/lib/formats/libdcd.pyx":682 + /* "MDAnalysis/lib/formats/libdcd.pyx":684 * shape = (self.ndims, n, natoms) * else: * raise ValueError("unkown order '{}'".format(order)) # <<<<<<<<<<<<<< @@ -9526,387 +9585,387 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram * cdef np.ndarray[FLOAT_T, ndim=3] xyz = np.empty(shape, dtype=FLOAT) */ /*else*/ { - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unkown_order, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unkown_order, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_8, function); } } - if (!__pyx_t_4) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_order); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + if (!__pyx_t_10) { + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_order); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_order}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_order}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_order}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_order}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_6); } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_order); __Pyx_GIVEREF(__pyx_v_order); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_order); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_order); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 682, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_10, 0, 0, 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(0, 684, __pyx_L1_error) } __pyx_L13:; - /* "MDAnalysis/lib/formats/libdcd.pyx":684 + /* "MDAnalysis/lib/formats/libdcd.pyx":686 * raise ValueError("unkown order '{}'".format(order)) * * cdef np.ndarray[FLOAT_T, ndim=3] xyz = np.empty(shape, dtype=FLOAT) # <<<<<<<<<<<<<< * cdef np.ndarray[DOUBLE_T, ndim=2] box = np.empty((n, 6)) * */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_shape); - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_shape); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 684, __pyx_L1_error) - __pyx_t_15 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_t_15 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xyz.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) { __pyx_v_xyz = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_xyz.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 684, __pyx_L1_error) + __PYX_ERR(0, 686, __pyx_L1_error) } else {__pyx_pybuffernd_xyz.diminfo[0].strides = __pyx_pybuffernd_xyz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xyz.diminfo[0].shape = __pyx_pybuffernd_xyz.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_xyz.diminfo[1].strides = __pyx_pybuffernd_xyz.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_xyz.diminfo[1].shape = __pyx_pybuffernd_xyz.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_xyz.diminfo[2].strides = __pyx_pybuffernd_xyz.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_xyz.diminfo[2].shape = __pyx_pybuffernd_xyz.rcbuffer->pybuffer.shape[2]; } } __pyx_t_15 = 0; - __pyx_v_xyz = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_xyz = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":685 + /* "MDAnalysis/lib/formats/libdcd.pyx":687 * * cdef np.ndarray[FLOAT_T, ndim=3] xyz = np.empty(shape, dtype=FLOAT) * cdef np.ndarray[DOUBLE_T, ndim=2] box = np.empty((n, 6)) # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_INCREF(__pyx_int_6); __Pyx_GIVEREF(__pyx_int_6); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_6); - __pyx_t_8 = 0; - __pyx_t_8 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_8); + __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_8, function); } } - if (!__pyx_t_8) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) + if (!__pyx_t_4) { + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_4); + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6}; + __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { - PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6}; + __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 685, __pyx_L1_error) - __pyx_t_16 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_16 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_box.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_box = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_box.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 685, __pyx_L1_error) + __PYX_ERR(0, 687, __pyx_L1_error) } else {__pyx_pybuffernd_box.diminfo[0].strides = __pyx_pybuffernd_box.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_box.diminfo[0].shape = __pyx_pybuffernd_box.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_box.diminfo[1].strides = __pyx_pybuffernd_box.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_box.diminfo[1].shape = __pyx_pybuffernd_box.rcbuffer->pybuffer.shape[1]; } } __pyx_t_16 = 0; - __pyx_v_box = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_box = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":688 + /* "MDAnalysis/lib/formats/libdcd.pyx":690 * * * cdef np.ndarray xyz_tmp = np.empty((self.natoms, self.ndims), dtype=FLOAT, order='F') # <<<<<<<<<<<<<< * cdef int ok, i * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->natoms); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->ndims); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); - __pyx_t_4 = 0; + __pyx_t_10 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_FLOAT); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 688, __pyx_L1_error) - __pyx_v_xyz_tmp = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 690, __pyx_L1_error) + __pyx_v_xyz_tmp = ((PyArrayObject *)__pyx_t_10); + __pyx_t_10 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":691 + /* "MDAnalysis/lib/formats/libdcd.pyx":693 * cdef int ok, i * * if start == 0 and step == 1 and stop == self.n_frames: # <<<<<<<<<<<<<< * for i in range(n): * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[i], i==0) */ - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_start, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_v_start, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L15_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_step, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_v_step, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L15_bool_binop_done; } - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->n_frames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_stop, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->n_frames); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_stop, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L15_bool_binop_done:; if (__pyx_t_5) { - /* "MDAnalysis/lib/formats/libdcd.pyx":692 + /* "MDAnalysis/lib/formats/libdcd.pyx":694 * * if start == 0 and step == 1 and stop == self.n_frames: * for i in range(n): # <<<<<<<<<<<<<< * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[i], i==0) * if ok != 0 and ok != -4: */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_range); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_10, function); } } - if (!__pyx_t_10) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + if (!__pyx_t_8) { + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyFunction_Check(__pyx_t_10)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { - PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_2}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL; + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; + __pyx_t_10 = __pyx_t_6; __Pyx_INCREF(__pyx_t_10); __pyx_t_9 = 0; __pyx_t_17 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 694, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (likely(!__pyx_t_17)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break; + if (likely(PyList_CheckExact(__pyx_t_10))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 694, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { - if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_10)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 694, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { - __pyx_t_6 = __pyx_t_17(__pyx_t_4); + __pyx_t_6 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 692, __pyx_L1_error) + else __PYX_ERR(0, 694, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_i = __pyx_t_7; - /* "MDAnalysis/lib/formats/libdcd.pyx":693 + /* "MDAnalysis/lib/formats/libdcd.pyx":695 * if start == 0 and step == 1 and stop == self.n_frames: * for i in range(n): * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[i], i==0) # <<<<<<<<<<<<<< * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) */ - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__40); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__41); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__42); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__43); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__44); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__45); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_box), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_box), __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ok = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_7formats_6libdcd_DCDFile *)__pyx_v_self->__pyx_vtab)->c_readframes_helper(__pyx_v_self, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, (__pyx_v_i == 0)); __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1); @@ -9922,7 +9981,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_21.memview = NULL; __pyx_t_21.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":694 + /* "MDAnalysis/lib/formats/libdcd.pyx":696 * for i in range(n): * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[i], i==0) * if ok != 0 and ok != -4: # <<<<<<<<<<<<<< @@ -9940,74 +9999,74 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram } if (unlikely(__pyx_t_5)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":695 + /* "MDAnalysis/lib/formats/libdcd.pyx":697 * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[i], i==0) * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * copy_in_order(xyz_tmp[c_indices], xyz, hash_order, i) * else: */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_frames_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_frames_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_2) { - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); } else { #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_8)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_8}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { - PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_8}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2); __pyx_t_2 = NULL; - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 695, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_8, 0, 0, 0); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 697, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":694 + /* "MDAnalysis/lib/formats/libdcd.pyx":696 * for i in range(n): * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[i], i==0) * if ok != 0 and ok != -4: # <<<<<<<<<<<<<< @@ -10016,18 +10075,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":696 + /* "MDAnalysis/lib/formats/libdcd.pyx":698 * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) * copy_in_order(xyz_tmp[c_indices], xyz, hash_order, i) # <<<<<<<<<<<<<< * else: * counter = 0 */ - __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), ((PyObject *)__pyx_v_c_indices)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_8, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 696, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(((PyObject *)__pyx_v_xyz), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), ((PyObject *)__pyx_v_c_indices)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(((PyObject *)__pyx_v_xyz), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 698, __pyx_L1_error) __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_copy_in_order(__pyx_t_23, __pyx_t_24, __pyx_v_hash_order, __pyx_v_i); __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1); __pyx_t_23.memview = NULL; @@ -10036,7 +10095,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_24.memview = NULL; __pyx_t_24.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":692 + /* "MDAnalysis/lib/formats/libdcd.pyx":694 * * if start == 0 and step == 1 and stop == self.n_frames: * for i in range(n): # <<<<<<<<<<<<<< @@ -10044,9 +10103,9 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram * if ok != 0 and ok != -4: */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":691 + /* "MDAnalysis/lib/formats/libdcd.pyx":693 * cdef int ok, i * * if start == 0 and step == 1 and stop == self.n_frames: # <<<<<<<<<<<<<< @@ -10056,7 +10115,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram goto __pyx_L14; } - /* "MDAnalysis/lib/formats/libdcd.pyx":698 + /* "MDAnalysis/lib/formats/libdcd.pyx":700 * copy_in_order(xyz_tmp[c_indices], xyz, hash_order, i) * else: * counter = 0 # <<<<<<<<<<<<<< @@ -10067,45 +10126,45 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_INCREF(__pyx_int_0); __pyx_v_counter = __pyx_int_0; - /* "MDAnalysis/lib/formats/libdcd.pyx":699 + /* "MDAnalysis/lib/formats/libdcd.pyx":701 * else: * counter = 0 * for i in range(start, stop, step): # <<<<<<<<<<<<<< * self.seek(i) * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) */ - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_range); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_8)) { + if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_start, __pyx_v_stop, __pyx_v_step}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_start, __pyx_v_stop, __pyx_v_step}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); } else #endif { - __pyx_t_22 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_22 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -10119,137 +10178,137 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __Pyx_INCREF(__pyx_v_step); __Pyx_GIVEREF(__pyx_v_step); PyTuple_SET_ITEM(__pyx_t_22, 2+__pyx_t_7, __pyx_v_step); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_22, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { + __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; __pyx_t_17 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_17 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 701, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { if (likely(!__pyx_t_17)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { - if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 701, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); #endif } else { - if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 701, __pyx_L1_error) #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); #endif } } else { - __pyx_t_4 = __pyx_t_17(__pyx_t_8); - if (unlikely(!__pyx_t_4)) { + __pyx_t_10 = __pyx_t_17(__pyx_t_4); + if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 699, __pyx_L1_error) + else __PYX_ERR(0, 701, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_i = __pyx_t_7; - /* "MDAnalysis/lib/formats/libdcd.pyx":700 + /* "MDAnalysis/lib/formats/libdcd.pyx":702 * counter = 0 * for i in range(start, stop, step): * self.seek(i) # <<<<<<<<<<<<<< * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) * if ok != 0 and ok != -4: */ - __pyx_t_22 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = NULL; + __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_22))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_22); - if (likely(__pyx_t_10)) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_22); + if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22); - __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_22, function); } } - if (!__pyx_t_10) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) + if (!__pyx_t_8) { + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_22)) { - PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_22)) { - PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL; + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":701 + /* "MDAnalysis/lib/formats/libdcd.pyx":703 * for i in range(start, stop, step): * self.seek(i) * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) # <<<<<<<<<<<<<< * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) */ - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__46); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__48); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_box), __pyx_v_counter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__47); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__49); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), __pyx_tuple__51); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_box), __pyx_v_counter); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T(__pyx_t_10, PyBUF_WRITABLE); if (unlikely(!__pyx_t_21.memview)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_ok = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_7formats_6libdcd_DCDFile *)__pyx_v_self->__pyx_vtab)->c_readframes_helper(__pyx_v_self, __pyx_t_20, __pyx_t_19, __pyx_t_18, __pyx_t_21, (__pyx_v_i == 0)); __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1); __pyx_t_20.memview = NULL; @@ -10264,7 +10323,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_21.memview = NULL; __pyx_t_21.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":702 + /* "MDAnalysis/lib/formats/libdcd.pyx":704 * self.seek(i) * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) * if ok != 0 and ok != -4: # <<<<<<<<<<<<<< @@ -10282,18 +10341,18 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram } if (unlikely(__pyx_t_5)) { - /* "MDAnalysis/lib/formats/libdcd.pyx":703 + /* "MDAnalysis/lib/formats/libdcd.pyx":705 * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) # <<<<<<<<<<<<<< * copy_in_order(xyz_tmp[c_indices], xyz, hash_order, counter) * counter += 1 */ - __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_frames_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Reading_DCD_frames_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCD_ERRORS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_ok, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10307,49 +10366,49 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram } } if (!__pyx_t_2) { - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_22)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_22)) { PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL; + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_22 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 703, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_10); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_22, 0, 0, 0); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __PYX_ERR(0, 703, __pyx_L1_error) + __PYX_ERR(0, 705, __pyx_L1_error) - /* "MDAnalysis/lib/formats/libdcd.pyx":702 + /* "MDAnalysis/lib/formats/libdcd.pyx":704 * self.seek(i) * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) * if ok != 0 and ok != -4: # <<<<<<<<<<<<<< @@ -10358,19 +10417,19 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram */ } - /* "MDAnalysis/lib/formats/libdcd.pyx":704 + /* "MDAnalysis/lib/formats/libdcd.pyx":706 * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) * copy_in_order(xyz_tmp[c_indices], xyz, hash_order, counter) # <<<<<<<<<<<<<< * counter += 1 * */ - __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), ((PyObject *)__pyx_v_c_indices)); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_xyz_tmp), ((PyObject *)__pyx_v_c_indices)); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_22, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(__pyx_t_22, PyBUF_WRITABLE); if (unlikely(!__pyx_t_23.memview)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(((PyObject *)__pyx_v_xyz), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 704, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_counter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_dsdsds_nn___pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T(((PyObject *)__pyx_v_xyz), PyBUF_WRITABLE); if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 706, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_counter); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 706, __pyx_L1_error) __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_copy_in_order(__pyx_t_23, __pyx_t_24, __pyx_v_hash_order, __pyx_t_7); __PYX_XDEC_MEMVIEW(&__pyx_t_23, 1); __pyx_t_23.memview = NULL; @@ -10379,19 +10438,19 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram __pyx_t_24.memview = NULL; __pyx_t_24.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":705 + /* "MDAnalysis/lib/formats/libdcd.pyx":707 * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) * copy_in_order(xyz_tmp[c_indices], xyz, hash_order, counter) * counter += 1 # <<<<<<<<<<<<<< * * return DCDFrame(xyz, box) */ - __pyx_t_22 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyInt_AddObjC(__pyx_v_counter, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF_SET(__pyx_v_counter, __pyx_t_22); __pyx_t_22 = 0; - /* "MDAnalysis/lib/formats/libdcd.pyx":699 + /* "MDAnalysis/lib/formats/libdcd.pyx":701 * else: * counter = 0 * for i in range(start, stop, step): # <<<<<<<<<<<<<< @@ -10399,11 +10458,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) */ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L14:; - /* "MDAnalysis/lib/formats/libdcd.pyx":707 + /* "MDAnalysis/lib/formats/libdcd.pyx":709 * counter += 1 * * return DCDFrame(xyz, box) # <<<<<<<<<<<<<< @@ -10411,15 +10470,15 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram * # Helper to read current DCD frame */ __Pyx_XDECREF(__pyx_r); - __pyx_t_22 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCDFrame); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_22 = __Pyx_GetModuleGlobalName(__pyx_n_s_DCDFrame); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_22); - __pyx_t_4 = NULL; + __pyx_t_10 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_22))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_22); - if (likely(__pyx_t_4)) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_22); + if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_22, function); __pyx_t_7 = 1; @@ -10427,42 +10486,42 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_22)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_box)}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_box)}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_22)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_box)}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_xyz), ((PyObject *)__pyx_v_box)}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_4); } else #endif { - __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_4) { - __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_10) { + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_xyz)); __Pyx_GIVEREF(((PyObject *)__pyx_v_xyz)); - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, ((PyObject *)__pyx_v_xyz)); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_xyz)); __Pyx_INCREF(((PyObject *)__pyx_v_box)); __Pyx_GIVEREF(((PyObject *)__pyx_v_box)); - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, ((PyObject *)__pyx_v_box)); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, ((PyObject *)__pyx_v_box)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/formats/libdcd.pyx":600 + /* "MDAnalysis/lib/formats/libdcd.pyx":602 * * * def readframes(self, start=None, stop=None, step=None, order='fac', indices=None): # <<<<<<<<<<<<<< @@ -10514,7 +10573,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_34readfram return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":710 +/* "MDAnalysis/lib/formats/libdcd.pyx":712 * * # Helper to read current DCD frame * cdef int c_readframes_helper(self, FLOAT_T[::1] x, # <<<<<<<<<<<<<< @@ -10533,7 +10592,7 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_c_readframes_help Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("c_readframes_helper", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":715 + /* "MDAnalysis/lib/formats/libdcd.pyx":717 * cdef int ok * ok = read_dcdstep(self.fp, self.natoms, * &x[0], # <<<<<<<<<<<<<< @@ -10548,10 +10607,10 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_c_readframes_help } else if (unlikely(__pyx_t_1 >= __pyx_v_x.shape[0])) __pyx_t_2 = 0; if (unlikely(__pyx_t_2 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 715, __pyx_L1_error) + __PYX_ERR(0, 717, __pyx_L1_error) } - /* "MDAnalysis/lib/formats/libdcd.pyx":716 + /* "MDAnalysis/lib/formats/libdcd.pyx":718 * ok = read_dcdstep(self.fp, self.natoms, * &x[0], * &y[0], &z[0], # <<<<<<<<<<<<<< @@ -10566,7 +10625,7 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_c_readframes_help } else if (unlikely(__pyx_t_3 >= __pyx_v_y.shape[0])) __pyx_t_2 = 0; if (unlikely(__pyx_t_2 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 716, __pyx_L1_error) + __PYX_ERR(0, 718, __pyx_L1_error) } __pyx_t_4 = 0; __pyx_t_2 = -1; @@ -10576,10 +10635,10 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_c_readframes_help } else if (unlikely(__pyx_t_4 >= __pyx_v_z.shape[0])) __pyx_t_2 = 0; if (unlikely(__pyx_t_2 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 716, __pyx_L1_error) + __PYX_ERR(0, 718, __pyx_L1_error) } - /* "MDAnalysis/lib/formats/libdcd.pyx":717 + /* "MDAnalysis/lib/formats/libdcd.pyx":719 * &x[0], * &y[0], &z[0], * &unitcell[0], self.nfixed, first_frame, # <<<<<<<<<<<<<< @@ -10594,10 +10653,10 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_c_readframes_help } else if (unlikely(__pyx_t_5 >= __pyx_v_unitcell.shape[0])) __pyx_t_2 = 0; if (unlikely(__pyx_t_2 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_2); - __PYX_ERR(0, 717, __pyx_L1_error) + __PYX_ERR(0, 719, __pyx_L1_error) } - /* "MDAnalysis/lib/formats/libdcd.pyx":714 + /* "MDAnalysis/lib/formats/libdcd.pyx":716 * DOUBLE_T[::1] unitcell, int first_frame): * cdef int ok * ok = read_dcdstep(self.fp, self.natoms, # <<<<<<<<<<<<<< @@ -10606,7 +10665,7 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_c_readframes_help */ __pyx_v_ok = read_dcdstep(__pyx_v_self->fp, __pyx_v_self->natoms, ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) __pyx_v_x.data) + __pyx_t_1)) ))))), ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) __pyx_v_y.data) + __pyx_t_3)) ))))), ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_FLOAT_T *) __pyx_v_z.data) + __pyx_t_4)) ))))), ((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T *)(&(*((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T *) ( /* dim=0 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_7formats_6libdcd_DOUBLE_T *) __pyx_v_unitcell.data) + __pyx_t_5)) ))))), __pyx_v_self->nfixed, __pyx_v_first_frame, __pyx_v_self->freeind, __pyx_v_self->fixedcoords, __pyx_v_self->reverse_endian, __pyx_v_self->charmm); - /* "MDAnalysis/lib/formats/libdcd.pyx":720 + /* "MDAnalysis/lib/formats/libdcd.pyx":722 * self.freeind, self.fixedcoords, * self.reverse_endian, self.charmm) * return ok # <<<<<<<<<<<<<< @@ -10616,7 +10675,7 @@ static int __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_c_readframes_help __pyx_r = __pyx_v_ok; goto __pyx_L0; - /* "MDAnalysis/lib/formats/libdcd.pyx":710 + /* "MDAnalysis/lib/formats/libdcd.pyx":712 * * # Helper to read current DCD frame * cdef int c_readframes_helper(self, FLOAT_T[::1] x, # <<<<<<<<<<<<<< @@ -10927,7 +10986,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_6libdcd_7DCDFile_12_header_ return __pyx_r; } -/* "MDAnalysis/lib/formats/libdcd.pyx":724 +/* "MDAnalysis/lib/formats/libdcd.pyx":726 * * # Helper in readframes to copy given a specific memory layout * cdef void copy_in_order(FLOAT_T[:, :] source, FLOAT_T[:, :, :] target, int order, int index): # <<<<<<<<<<<<<< @@ -10946,7 +11005,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_copy_in_order(__Pyx_memvi __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_RefNannySetupContext("copy_in_order", 0); - /* "MDAnalysis/lib/formats/libdcd.pyx":725 + /* "MDAnalysis/lib/formats/libdcd.pyx":727 * # Helper in readframes to copy given a specific memory layout * cdef void copy_in_order(FLOAT_T[:, :] source, FLOAT_T[:, :, :] target, int order, int index): * if order == 1: # 'fac': # <<<<<<<<<<<<<< @@ -10956,7 +11015,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_copy_in_order(__Pyx_memvi switch (__pyx_v_order) { case 1: - /* "MDAnalysis/lib/formats/libdcd.pyx":726 + /* "MDAnalysis/lib/formats/libdcd.pyx":728 * cdef void copy_in_order(FLOAT_T[:, :] source, FLOAT_T[:, :, :] target, int order, int index): * if order == 1: # 'fac': * target[index] = source # <<<<<<<<<<<<<< @@ -10974,7 +11033,7 @@ static void __pyx_f_10MDAnalysis_3lib_7formats_6libdcd_copy_in_order(__Pyx_memvi __pyx_tmp_idx += __pyx_tmp_shape; if (1 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)"); - __PYX_ERR(0, 726, __pyx_L1_error) + __PYX_ERR(0, 728, __pyx_L1_error) } __pyx_t_1.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -10987,12 +11046,12 @@ __pyx_t_1.shape[1] = __pyx_v_target.shape[2]; __pyx_t_1.strides[1] = __pyx_v_target.strides[2]; __pyx_t_1.suboffsets[1] = -1; -if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_1, 2, 2, 0) < 0)) __PYX_ERR(0, 726, __pyx_L1_error) +if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_1, 2, 2, 0) < 0)) __PYX_ERR(0, 728, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":725 + /* "MDAnalysis/lib/formats/libdcd.pyx":727 * # Helper in readframes to copy given a specific memory layout * cdef void copy_in_order(FLOAT_T[:, :] source, FLOAT_T[:, :, :] target, int order, int index): * if order == 1: # 'fac': # <<<<<<<<<<<<<< @@ -11001,7 +11060,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_1, 2, 2, 0) */ break; - /* "MDAnalysis/lib/formats/libdcd.pyx":727 + /* "MDAnalysis/lib/formats/libdcd.pyx":729 * if order == 1: # 'fac': * target[index] = source * elif order == 2: # 'fca': # <<<<<<<<<<<<<< @@ -11010,7 +11069,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_1, 2, 2, 0) */ case 2: - /* "MDAnalysis/lib/formats/libdcd.pyx":728 + /* "MDAnalysis/lib/formats/libdcd.pyx":730 * target[index] = source * elif order == 2: # 'fca': * target[index] = source.T # <<<<<<<<<<<<<< @@ -11019,7 +11078,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_1, 2, 2, 0) */ __pyx_t_2 = __pyx_v_source; __PYX_INC_MEMVIEW(&__pyx_t_2, 1); - if (unlikely(__pyx_memslice_transpose(&__pyx_t_2) == 0)) __PYX_ERR(0, 728, __pyx_L1_error) + if (unlikely(__pyx_memslice_transpose(&__pyx_t_2) == 0)) __PYX_ERR(0, 730, __pyx_L1_error) __pyx_t_3.data = __pyx_v_target.data; __pyx_t_3.memview = __pyx_v_target.memview; __PYX_INC_MEMVIEW(&__pyx_t_3, 0); @@ -11031,7 +11090,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_1, 2, 2, 0) __pyx_tmp_idx += __pyx_tmp_shape; if (1 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 0)"); - __PYX_ERR(0, 728, __pyx_L1_error) + __PYX_ERR(0, 730, __pyx_L1_error) } __pyx_t_3.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -11044,7 +11103,7 @@ __pyx_t_3.shape[1] = __pyx_v_target.shape[2]; __pyx_t_3.strides[1] = __pyx_v_target.strides[2]; __pyx_t_3.suboffsets[1] = -1; -if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_2, __pyx_t_3, 2, 2, 0) < 0)) __PYX_ERR(0, 728, __pyx_L1_error) +if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_2, __pyx_t_3, 2, 2, 0) < 0)) __PYX_ERR(0, 730, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1); __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; @@ -11052,7 +11111,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_2, __pyx_t_3, 2, 2, 0) < 0)) __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":727 + /* "MDAnalysis/lib/formats/libdcd.pyx":729 * if order == 1: # 'fac': * target[index] = source * elif order == 2: # 'fca': # <<<<<<<<<<<<<< @@ -11061,7 +11120,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_2, __pyx_t_3, 2, 2, 0) < 0)) */ break; - /* "MDAnalysis/lib/formats/libdcd.pyx":729 + /* "MDAnalysis/lib/formats/libdcd.pyx":731 * elif order == 2: # 'fca': * target[index] = source.T * elif order == 3: # 'afc': # <<<<<<<<<<<<<< @@ -11070,7 +11129,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_2, __pyx_t_3, 2, 2, 0) < 0)) */ case 3: - /* "MDAnalysis/lib/formats/libdcd.pyx":730 + /* "MDAnalysis/lib/formats/libdcd.pyx":732 * target[index] = source.T * elif order == 3: # 'afc': * target[:, index] = source # <<<<<<<<<<<<<< @@ -11092,7 +11151,7 @@ __pyx_t_2.strides[0] = __pyx_v_target.strides[0]; __pyx_tmp_idx += __pyx_tmp_shape; if (1 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 730, __pyx_L1_error) + __PYX_ERR(0, 732, __pyx_L1_error) } __pyx_t_2.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -11101,12 +11160,12 @@ __pyx_t_2.shape[1] = __pyx_v_target.shape[2]; __pyx_t_2.strides[1] = __pyx_v_target.strides[2]; __pyx_t_2.suboffsets[1] = -1; -if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_2, 2, 2, 0) < 0)) __PYX_ERR(0, 730, __pyx_L1_error) +if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_2, 2, 2, 0) < 0)) __PYX_ERR(0, 732, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":729 + /* "MDAnalysis/lib/formats/libdcd.pyx":731 * elif order == 2: # 'fca': * target[index] = source.T * elif order == 3: # 'afc': # <<<<<<<<<<<<<< @@ -11115,7 +11174,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_2, 2, 2, 0) */ break; - /* "MDAnalysis/lib/formats/libdcd.pyx":731 + /* "MDAnalysis/lib/formats/libdcd.pyx":733 * elif order == 3: # 'afc': * target[:, index] = source * elif order == 4: # 'acf': # <<<<<<<<<<<<<< @@ -11124,7 +11183,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_2, 2, 2, 0) */ case 4: - /* "MDAnalysis/lib/formats/libdcd.pyx":732 + /* "MDAnalysis/lib/formats/libdcd.pyx":734 * target[:, index] = source * elif order == 4: # 'acf': * target[:, :, index] = source # <<<<<<<<<<<<<< @@ -11150,17 +11209,17 @@ __pyx_t_4.strides[1] = __pyx_v_target.strides[1]; __pyx_tmp_idx += __pyx_tmp_shape; if (1 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 2)"); - __PYX_ERR(0, 732, __pyx_L1_error) + __PYX_ERR(0, 734, __pyx_L1_error) } __pyx_t_4.data += __pyx_tmp_idx * __pyx_tmp_stride; } -if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_4, 2, 2, 0) < 0)) __PYX_ERR(0, 732, __pyx_L1_error) +if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_4, 2, 2, 0) < 0)) __PYX_ERR(0, 734, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":731 + /* "MDAnalysis/lib/formats/libdcd.pyx":733 * elif order == 3: # 'afc': * target[:, index] = source * elif order == 4: # 'acf': # <<<<<<<<<<<<<< @@ -11169,7 +11228,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_4, 2, 2, 0) */ break; - /* "MDAnalysis/lib/formats/libdcd.pyx":733 + /* "MDAnalysis/lib/formats/libdcd.pyx":735 * elif order == 4: # 'acf': * target[:, :, index] = source * elif order == 5: # 'caf': # <<<<<<<<<<<<<< @@ -11178,7 +11237,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_4, 2, 2, 0) */ case 5: - /* "MDAnalysis/lib/formats/libdcd.pyx":734 + /* "MDAnalysis/lib/formats/libdcd.pyx":736 * target[:, :, index] = source * elif order == 5: # 'caf': * target[:, :, index] = source.T # <<<<<<<<<<<<<< @@ -11187,7 +11246,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_v_source, __pyx_t_4, 2, 2, 0) */ __pyx_t_5 = __pyx_v_source; __PYX_INC_MEMVIEW(&__pyx_t_5, 1); - if (unlikely(__pyx_memslice_transpose(&__pyx_t_5) == 0)) __PYX_ERR(0, 734, __pyx_L1_error) + if (unlikely(__pyx_memslice_transpose(&__pyx_t_5) == 0)) __PYX_ERR(0, 736, __pyx_L1_error) __pyx_t_6.data = __pyx_v_target.data; __pyx_t_6.memview = __pyx_v_target.memview; __PYX_INC_MEMVIEW(&__pyx_t_6, 0); @@ -11207,12 +11266,12 @@ __pyx_t_6.strides[1] = __pyx_v_target.strides[1]; __pyx_tmp_idx += __pyx_tmp_shape; if (1 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 2)"); - __PYX_ERR(0, 734, __pyx_L1_error) + __PYX_ERR(0, 736, __pyx_L1_error) } __pyx_t_6.data += __pyx_tmp_idx * __pyx_tmp_stride; } -if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_6, 2, 2, 0) < 0)) __PYX_ERR(0, 734, __pyx_L1_error) +if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_6, 2, 2, 0) < 0)) __PYX_ERR(0, 736, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; @@ -11220,7 +11279,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_6, 2, 2, 0) < 0)) __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":733 + /* "MDAnalysis/lib/formats/libdcd.pyx":735 * elif order == 4: # 'acf': * target[:, :, index] = source * elif order == 5: # 'caf': # <<<<<<<<<<<<<< @@ -11229,7 +11288,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_6, 2, 2, 0) < 0)) */ break; - /* "MDAnalysis/lib/formats/libdcd.pyx":735 + /* "MDAnalysis/lib/formats/libdcd.pyx":737 * elif order == 5: # 'caf': * target[:, :, index] = source.T * elif order == 6: # 'cfa': # <<<<<<<<<<<<<< @@ -11237,14 +11296,14 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_6, 2, 2, 0) < 0)) */ case 6: - /* "MDAnalysis/lib/formats/libdcd.pyx":736 + /* "MDAnalysis/lib/formats/libdcd.pyx":738 * target[:, :, index] = source.T * elif order == 6: # 'cfa': * target[:, index] = source.T # <<<<<<<<<<<<<< */ __pyx_t_5 = __pyx_v_source; __PYX_INC_MEMVIEW(&__pyx_t_5, 1); - if (unlikely(__pyx_memslice_transpose(&__pyx_t_5) == 0)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(__pyx_memslice_transpose(&__pyx_t_5) == 0)) __PYX_ERR(0, 738, __pyx_L1_error) __pyx_t_7.data = __pyx_v_target.data; __pyx_t_7.memview = __pyx_v_target.memview; __PYX_INC_MEMVIEW(&__pyx_t_7, 0); @@ -11260,7 +11319,7 @@ __pyx_t_7.strides[0] = __pyx_v_target.strides[0]; __pyx_tmp_idx += __pyx_tmp_shape; if (1 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) { PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)"); - __PYX_ERR(0, 736, __pyx_L1_error) + __PYX_ERR(0, 738, __pyx_L1_error) } __pyx_t_7.data += __pyx_tmp_idx * __pyx_tmp_stride; } @@ -11269,7 +11328,7 @@ __pyx_t_7.shape[1] = __pyx_v_target.shape[2]; __pyx_t_7.strides[1] = __pyx_v_target.strides[2]; __pyx_t_7.suboffsets[1] = -1; -if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_7, 2, 2, 0) < 0)) __PYX_ERR(0, 736, __pyx_L1_error) +if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_7, 2, 2, 0) < 0)) __PYX_ERR(0, 738, __pyx_L1_error) __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1); __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL; @@ -11277,7 +11336,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_7, 2, 2, 0) < 0)) __pyx_t_5.memview = NULL; __pyx_t_5.data = NULL; - /* "MDAnalysis/lib/formats/libdcd.pyx":735 + /* "MDAnalysis/lib/formats/libdcd.pyx":737 * elif order == 5: # 'caf': * target[:, :, index] = source.T * elif order == 6: # 'cfa': # <<<<<<<<<<<<<< @@ -11287,7 +11346,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_7, 2, 2, 0) < 0)) default: break; } - /* "MDAnalysis/lib/formats/libdcd.pyx":724 + /* "MDAnalysis/lib/formats/libdcd.pyx":726 * * # Helper in readframes to copy given a specific memory layout * cdef void copy_in_order(FLOAT_T[:, :] source, FLOAT_T[:, :, :] target, int order, int index): # <<<<<<<<<<<<<< @@ -11310,7 +11369,7 @@ if (unlikely(__pyx_memoryview_copy_contents(__pyx_t_5, __pyx_t_7, 2, 2, 0) < 0)) __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -11358,7 +11417,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -11367,7 +11426,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -11376,7 +11435,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -11385,7 +11444,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11399,7 +11458,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -11410,7 +11469,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11419,20 +11478,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11441,7 +11500,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11455,7 +11514,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -11466,7 +11525,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11475,20 +11534,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -11497,7 +11556,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -11506,7 +11565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -11515,7 +11574,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -11525,7 +11584,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -11534,7 +11593,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -11543,7 +11602,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -11555,7 +11614,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -11564,7 +11623,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -11574,7 +11633,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -11584,7 +11643,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -11594,7 +11653,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -11605,7 +11664,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -11614,7 +11673,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -11623,7 +11682,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -11632,7 +11691,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -11641,7 +11700,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -11653,7 +11712,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -11666,7 +11725,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -11676,7 +11735,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -11686,7 +11745,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -11706,7 +11765,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -11723,7 +11782,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -11732,20 +11791,20 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 263, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -11754,7 +11813,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -11766,7 +11825,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -11777,7 +11836,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -11788,7 +11847,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -11799,7 +11858,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -11810,7 +11869,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -11821,7 +11880,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -11832,7 +11891,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -11843,7 +11902,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -11854,7 +11913,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -11865,7 +11924,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -11876,7 +11935,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -11887,7 +11946,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -11898,7 +11957,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -11909,7 +11968,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -11920,7 +11979,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -11931,7 +11990,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -11943,7 +12002,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -11964,7 +12023,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -11973,7 +12032,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -11983,7 +12042,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -11992,7 +12051,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -12002,7 +12061,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -12011,7 +12070,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -12020,7 +12079,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -12030,7 +12089,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -12040,7 +12099,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -12072,7 +12131,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -12096,7 +12155,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -12106,7 +12165,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -12115,7 +12174,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -12124,7 +12183,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -12134,7 +12193,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -12143,7 +12202,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -12152,7 +12211,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -12164,7 +12223,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -12178,7 +12237,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -12192,7 +12251,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -12211,7 +12270,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -12225,7 +12284,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -12239,7 +12298,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -12258,7 +12317,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -12272,7 +12331,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -12286,7 +12345,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -12305,7 +12364,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -12319,7 +12378,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -12333,7 +12392,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -12352,7 +12411,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -12366,7 +12425,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -12380,7 +12439,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -12399,7 +12458,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -12413,7 +12472,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -12423,7 +12482,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -12435,7 +12494,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -12444,7 +12503,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -12458,7 +12517,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -12473,7 +12532,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -12502,7 +12561,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -12511,7 +12570,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -12520,7 +12579,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -12543,7 +12602,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -12560,7 +12619,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -12595,7 +12654,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -12612,20 +12671,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -12634,7 +12693,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -12654,7 +12713,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -12671,7 +12730,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -12680,20 +12739,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -12702,7 +12761,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -12718,7 +12777,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -12727,7 +12786,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -12736,7 +12795,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -12747,7 +12806,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -12757,7 +12816,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -12767,7 +12826,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -12779,7 +12838,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -12789,20 +12848,20 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -12811,7 +12870,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -12829,7 +12888,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -12847,7 +12906,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -12865,7 +12924,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -12883,7 +12942,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -12901,7 +12960,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -12919,7 +12978,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -12937,7 +12996,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -12955,7 +13014,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -12973,7 +13032,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -12991,7 +13050,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -13009,7 +13068,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -13027,7 +13086,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -13045,7 +13104,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -13065,7 +13124,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -13085,7 +13144,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -13105,7 +13164,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -13123,7 +13182,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -13142,7 +13201,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -13151,7 +13210,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -13161,7 +13220,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -13174,7 +13233,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -13184,7 +13243,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -13194,7 +13253,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -13219,7 +13278,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -13234,7 +13293,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -13245,7 +13304,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -13254,7 +13313,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -13264,7 +13323,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -13274,7 +13333,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -13285,7 +13344,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -13294,7 +13353,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -13303,7 +13362,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -13315,7 +13374,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -13329,7 +13388,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -13339,7 +13398,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -13350,7 +13409,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -13359,7 +13418,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -13373,7 +13432,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -13388,7 +13447,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -13409,7 +13468,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -13425,7 +13484,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -13434,7 +13493,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -13448,7 +13507,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -13463,14 +13522,14 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _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__57, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1000, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1000, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -13479,7 +13538,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -13494,7 +13553,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -13517,7 +13576,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -13538,7 +13597,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13554,7 +13613,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -13563,7 +13622,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13577,7 +13636,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -13592,14 +13651,14 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _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__58, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1006, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1006, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -13608,7 +13667,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13623,7 +13682,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -13646,7 +13705,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -13667,7 +13726,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13683,7 +13742,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -13692,7 +13751,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13706,7 +13765,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -13720,12 +13779,12 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1012, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1012, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -13734,7 +13793,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13749,7 +13808,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -13969,7 +14028,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if itemsize <= 0: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 132, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -14001,7 +14060,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if not isinstance(format, bytes): */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -14036,7 +14095,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 138, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); @@ -14116,7 +14175,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 147, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -14390,7 +14449,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __ * * if self.dtype_is_object: */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 175, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -14631,7 +14690,7 @@ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(stru * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -15347,7 +15406,7 @@ static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __p * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -15400,7 +15459,7 @@ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17044,7 +17103,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setit * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 413, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18071,7 +18130,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: * if len(self.view.format) == 1: */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 490, __pyx_L5_except_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 490, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -18427,7 +18486,7 @@ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbu * * if flags & PyBUF_STRIDES: */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 515, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18967,7 +19026,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(st * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -19081,7 +19140,7 @@ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get_ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__72, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 572, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__73, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -20082,7 +20141,7 @@ static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struc * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20135,7 +20194,7 @@ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED st * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20486,9 +20545,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__75); - __Pyx_GIVEREF(__pyx_slice__75); - PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__75); + __Pyx_INCREF(__pyx_slice__76); + __Pyx_GIVEREF(__pyx_slice__76); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__76); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 677, __pyx_L1_error) @@ -20521,7 +20580,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * else: */ /*else*/ { - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__76); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 680, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__77); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 680, __pyx_L1_error) } __pyx_L7:; @@ -20661,9 +20720,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { - __Pyx_INCREF(__pyx_slice__77); - __Pyx_GIVEREF(__pyx_slice__77); - PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__77); + __Pyx_INCREF(__pyx_slice__78); + __Pyx_GIVEREF(__pyx_slice__78); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__78); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 691, __pyx_L1_error) @@ -20787,7 +20846,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * * */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 698, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -22950,7 +23009,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -23003,7 +23062,7 @@ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUS * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -27887,7 +27946,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, {&__pyx_kp_s_Writing_DCD_header_failed, __pyx_k_Writing_DCD_header_failed, sizeof(__pyx_k_Writing_DCD_header_failed), 0, 0, 1, 0}, - {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, {&__pyx_n_s_acf, __pyx_k_acf, sizeof(__pyx_k_acf), 0, 0, 1, 1}, {&__pyx_n_s_afc, __pyx_k_afc, sizeof(__pyx_k_afc), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, @@ -27942,6 +28001,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, {&__pyx_n_s_is_periodic, __pyx_k_is_periodic, sizeof(__pyx_k_is_periodic), 0, 0, 1, 1}, + {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1}, {&__pyx_n_s_istart, __pyx_k_istart, sizeof(__pyx_k_istart), 0, 0, 1, 1}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, @@ -28034,9 +28094,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 245, __pyx_L1_error) __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_builtin_EOFError = __Pyx_GetBuiltinName(__pyx_n_s_EOFError); if (!__pyx_builtin_EOFError) __PYX_ERR(0, 407, __pyx_L1_error) - __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 500, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_builtin_EOFError = __Pyx_GetBuiltinName(__pyx_n_s_EOFError); if (!__pyx_builtin_EOFError) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 531, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 242, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error) @@ -28077,475 +28137,486 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "MDAnalysis/lib/formats/libdcd.pyx":335 + /* "MDAnalysis/lib/formats/libdcd.pyx":296 + * if mode == 'r': + * if not path.isfile(self.fname): + * raise IOError("DCD file does not exist") # <<<<<<<<<<<<<< + * fio_mode = FIO_READ + * elif mode == 'w': + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_DCD_file_does_not_exist); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "MDAnalysis/lib/formats/libdcd.pyx":337 * """read header and populate internal fields""" * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * * cdef char* c_remarks */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); - /* "MDAnalysis/lib/formats/libdcd.pyx":365 + /* "MDAnalysis/lib/formats/libdcd.pyx":367 * try: * self.read() * self.seek(0) # <<<<<<<<<<<<<< * except IOError: * if self.n_frames != 0: */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); - /* "MDAnalysis/lib/formats/libdcd.pyx":368 + /* "MDAnalysis/lib/formats/libdcd.pyx":370 * except IOError: * if self.n_frames != 0: * raise IOError("DCD is corrupted") # <<<<<<<<<<<<<< * * if sys.version_info[0] < 3: */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_DCD_is_corrupted); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_DCD_is_corrupted); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); - /* "MDAnalysis/lib/formats/libdcd.pyx":372 + /* "MDAnalysis/lib/formats/libdcd.pyx":374 * if sys.version_info[0] < 3: * py_remarks = unicode(py_remarks, 'ascii', "ignore") * py_remarks = str(py_remarks.encode('ascii', 'ignore')) # <<<<<<<<<<<<<< * else: * if isinstance(py_remarks, bytes): */ - __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_ascii, __pyx_n_s_ignore); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 372, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_ascii, __pyx_n_s_ignore); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); - /* "MDAnalysis/lib/formats/libdcd.pyx":375 + /* "MDAnalysis/lib/formats/libdcd.pyx":377 * else: * if isinstance(py_remarks, bytes): * py_remarks = py_remarks.decode('ascii', 'ignore') # <<<<<<<<<<<<<< * * py_remarks = "".join(s for s in py_remarks if s in string.printable) */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_ascii, __pyx_n_s_ignore); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_ascii, __pyx_n_s_ignore); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); - /* "MDAnalysis/lib/formats/libdcd.pyx":407 + /* "MDAnalysis/lib/formats/libdcd.pyx":409 * """ * if frame >= self.n_frames: * raise EOFError('Trying to seek over max number of frames') # <<<<<<<<<<<<<< * self.reached_eof = False * */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Trying_to_seek_over_max_number_o); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 407, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Trying_to_seek_over_max_number_o); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); - /* "MDAnalysis/lib/formats/libdcd.pyx":486 + /* "MDAnalysis/lib/formats/libdcd.pyx":488 * """ * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if not self.mode=='w': * raise IOError("Incorrect file mode for writing.") */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); - /* "MDAnalysis/lib/formats/libdcd.pyx":488 + /* "MDAnalysis/lib/formats/libdcd.pyx":490 * raise IOError("No file open") * if not self.mode=='w': * raise IOError("Incorrect file mode for writing.") # <<<<<<<<<<<<<< * if self.wrote_header: * raise IOError("Header already written") */ - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Incorrect_file_mode_for_writing); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Incorrect_file_mode_for_writing); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); - /* "MDAnalysis/lib/formats/libdcd.pyx":490 + /* "MDAnalysis/lib/formats/libdcd.pyx":492 * raise IOError("Incorrect file mode for writing.") * if self.wrote_header: * raise IOError("Header already written") # <<<<<<<<<<<<<< * * cdef int with_unitcell = is_periodic */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Header_already_written); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Header_already_written); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); - /* "MDAnalysis/lib/formats/libdcd.pyx":523 + /* "MDAnalysis/lib/formats/libdcd.pyx":525 * """ * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if self.mode != 'w': * raise IOError('File opened in mode: {}. Writing only allowed ' */ - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); - /* "MDAnalysis/lib/formats/libdcd.pyx":526 + /* "MDAnalysis/lib/formats/libdcd.pyx":528 * if self.mode != 'w': * raise IOError('File opened in mode: {}. Writing only allowed ' * 'in mode "w"'.format('self.mode')) # <<<<<<<<<<<<<< * if (self.charmm & DCD_HAS_EXTRA_BLOCK): * if len(box) != 6: */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 526, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); - /* "MDAnalysis/lib/formats/libdcd.pyx":532 + /* "MDAnalysis/lib/formats/libdcd.pyx":534 * else: * # use a dummy box. It won't be written anyway in readdcd. * box = np.zeros(6) # <<<<<<<<<<<<<< * * if not self.wrote_header: */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); - /* "MDAnalysis/lib/formats/libdcd.pyx":535 + /* "MDAnalysis/lib/formats/libdcd.pyx":537 * * if not self.wrote_header: * raise IOError("write header first before frames can be written") # <<<<<<<<<<<<<< * xyz = np.asarray(xyz, order='F', dtype=FLOAT) * if xyz.shape != (self.natoms, 3): */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_write_header_first_before_frames); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_write_header_first_before_frames); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); - /* "MDAnalysis/lib/formats/libdcd.pyx":541 + /* "MDAnalysis/lib/formats/libdcd.pyx":543 * * cdef DOUBLE_T[::1] c_box = np.asarray(box, order='C', dtype=DOUBLE) * cdef FLOAT_T[::1] x = xyz[:, 0] # <<<<<<<<<<<<<< * cdef FLOAT_T[::1] y = xyz[:, 1] * cdef FLOAT_T[::1] z = xyz[:, 2] */ - __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__17); - __Pyx_GIVEREF(__pyx_slice__17); - __pyx_tuple__18 = PyTuple_Pack(2, __pyx_slice__17, __pyx_int_0); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 541, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__18); + __Pyx_GIVEREF(__pyx_slice__18); + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_slice__18, __pyx_int_0); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); - /* "MDAnalysis/lib/formats/libdcd.pyx":542 + /* "MDAnalysis/lib/formats/libdcd.pyx":544 * cdef DOUBLE_T[::1] c_box = np.asarray(box, order='C', dtype=DOUBLE) * cdef FLOAT_T[::1] x = xyz[:, 0] * cdef FLOAT_T[::1] y = xyz[:, 1] # <<<<<<<<<<<<<< * cdef FLOAT_T[::1] z = xyz[:, 2] * */ - __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__19); - __Pyx_GIVEREF(__pyx_slice__19); - __pyx_tuple__20 = PyTuple_Pack(2, __pyx_slice__19, __pyx_int_1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__20); + __Pyx_GIVEREF(__pyx_slice__20); + __pyx_tuple__21 = PyTuple_Pack(2, __pyx_slice__20, __pyx_int_1); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); - /* "MDAnalysis/lib/formats/libdcd.pyx":543 + /* "MDAnalysis/lib/formats/libdcd.pyx":545 * cdef FLOAT_T[::1] x = xyz[:, 0] * cdef FLOAT_T[::1] y = xyz[:, 1] * cdef FLOAT_T[::1] z = xyz[:, 2] # <<<<<<<<<<<<<< * * step = self.istart + self.current_frame * self.nsavc */ - __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(0, 543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__21); - __Pyx_GIVEREF(__pyx_slice__21); - __pyx_tuple__22 = PyTuple_Pack(2, __pyx_slice__21, __pyx_int_2); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__22); + __Pyx_GIVEREF(__pyx_slice__22); + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_slice__22, __pyx_int_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); - /* "MDAnalysis/lib/formats/libdcd.pyx":572 + /* "MDAnalysis/lib/formats/libdcd.pyx":574 * """ * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') # <<<<<<<<<<<<<< * if not self.is_open: * raise IOError("No file open") */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Reached_last_frame_in_DCD_seek_t); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Reached_last_frame_in_DCD_seek_t); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); - /* "MDAnalysis/lib/formats/libdcd.pyx":574 + /* "MDAnalysis/lib/formats/libdcd.pyx":576 * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); - /* "MDAnalysis/lib/formats/libdcd.pyx":577 + /* "MDAnalysis/lib/formats/libdcd.pyx":579 * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) # <<<<<<<<<<<<<< * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); - /* "MDAnalysis/lib/formats/libdcd.pyx":579 + /* "MDAnalysis/lib/formats/libdcd.pyx":581 * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") # <<<<<<<<<<<<<< * * cdef np.ndarray xyz = np.empty((self.natoms, self.ndims), dtype=FLOAT, order='F') */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_opened_empty_file_No_frames_are); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_opened_empty_file_No_frames_are); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); - /* "MDAnalysis/lib/formats/libdcd.pyx":582 + /* "MDAnalysis/lib/formats/libdcd.pyx":584 * * cdef np.ndarray xyz = np.empty((self.natoms, self.ndims), dtype=FLOAT, order='F') * cdef np.ndarray unitcell = np.empty(6, dtype=DOUBLE) # <<<<<<<<<<<<<< * unitcell[0] = unitcell[2] = unitcell[5] = 0.0; * unitcell[4] = unitcell[3] = unitcell[1] = 90.0; */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 582, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); - /* "MDAnalysis/lib/formats/libdcd.pyx":587 + /* "MDAnalysis/lib/formats/libdcd.pyx":589 * * first_frame = self.current_frame == 0 * ok = self.c_readframes_helper(xyz[:, 0], xyz[:, 1], xyz[:, 2], unitcell, first_frame) # <<<<<<<<<<<<<< * if ok != 0 and ok != -4: * raise IOError("Reading DCD header failed: {}".format(DCD_ERRORS[ok])) */ - __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__28); - __Pyx_GIVEREF(__pyx_slice__28); - __pyx_tuple__29 = PyTuple_Pack(2, __pyx_slice__28, __pyx_int_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__30); - __Pyx_GIVEREF(__pyx_slice__30); - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_slice__30, __pyx_int_1); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__32); - __Pyx_GIVEREF(__pyx_slice__32); - __pyx_tuple__33 = PyTuple_Pack(2, __pyx_slice__32, __pyx_int_2); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - - /* "MDAnalysis/lib/formats/libdcd.pyx":632 + __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__29); + __Pyx_GIVEREF(__pyx_slice__29); + __pyx_tuple__30 = PyTuple_Pack(2, __pyx_slice__29, __pyx_int_0); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__31); + __Pyx_GIVEREF(__pyx_slice__31); + __pyx_tuple__32 = PyTuple_Pack(2, __pyx_slice__31, __pyx_int_1); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__33); + __Pyx_GIVEREF(__pyx_slice__33); + __pyx_tuple__34 = PyTuple_Pack(2, __pyx_slice__33, __pyx_int_2); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "MDAnalysis/lib/formats/libdcd.pyx":634 * """ * if self.reached_eof: * raise EOFError('Reached last frame in DCD, seek to 0') # <<<<<<<<<<<<<< * if not self.is_open: * raise IOError("No file open") */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Reached_last_frame_in_DCD_seek_t); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Reached_last_frame_in_DCD_seek_t); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); - /* "MDAnalysis/lib/formats/libdcd.pyx":634 + /* "MDAnalysis/lib/formats/libdcd.pyx":636 * raise EOFError('Reached last frame in DCD, seek to 0') * if not self.is_open: * raise IOError("No file open") # <<<<<<<<<<<<<< * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' */ - __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_file_open); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); - /* "MDAnalysis/lib/formats/libdcd.pyx":637 + /* "MDAnalysis/lib/formats/libdcd.pyx":639 * if self.mode != 'r': * raise IOError('File opened in mode: {}. Reading only allow ' * 'in mode "r"'.format('self.mode')) # <<<<<<<<<<<<<< * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") */ - __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_self_mode); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); - /* "MDAnalysis/lib/formats/libdcd.pyx":639 + /* "MDAnalysis/lib/formats/libdcd.pyx":641 * 'in mode "r"'.format('self.mode')) * if self.n_frames == 0: * raise IOError("opened empty file. No frames are saved") # <<<<<<<<<<<<<< * * self.seek(0) */ - __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_opened_empty_file_No_frames_are); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_opened_empty_file_No_frames_are); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); - /* "MDAnalysis/lib/formats/libdcd.pyx":641 + /* "MDAnalysis/lib/formats/libdcd.pyx":643 * raise IOError("opened empty file. No frames are saved") * * self.seek(0) # <<<<<<<<<<<<<< * # if we only want to iterate backwards flip start and end * if start is None and stop is None and step is not None and step < 0: */ - __pyx_tuple__38 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); - /* "MDAnalysis/lib/formats/libdcd.pyx":693 + /* "MDAnalysis/lib/formats/libdcd.pyx":695 * if start == 0 and step == 1 and stop == self.n_frames: * for i in range(n): * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[i], i==0) # <<<<<<<<<<<<<< * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) */ - __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__39); - __Pyx_GIVEREF(__pyx_slice__39); - __pyx_tuple__40 = PyTuple_Pack(2, __pyx_slice__39, __pyx_int_0); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__40); - __Pyx_GIVEREF(__pyx_tuple__40); - __pyx_slice__41 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__41)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__41); - __Pyx_GIVEREF(__pyx_slice__41); - __pyx_tuple__42 = PyTuple_Pack(2, __pyx_slice__41, __pyx_int_1); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_slice__43 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__43)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__43); - __Pyx_GIVEREF(__pyx_slice__43); - __pyx_tuple__44 = PyTuple_Pack(2, __pyx_slice__43, __pyx_int_2); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - - /* "MDAnalysis/lib/formats/libdcd.pyx":701 + __pyx_slice__40 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__40)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__40); + __Pyx_GIVEREF(__pyx_slice__40); + __pyx_tuple__41 = PyTuple_Pack(2, __pyx_slice__40, __pyx_int_0); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_slice__42 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__42)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__42); + __Pyx_GIVEREF(__pyx_slice__42); + __pyx_tuple__43 = PyTuple_Pack(2, __pyx_slice__42, __pyx_int_1); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_slice__44 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__44)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__44); + __Pyx_GIVEREF(__pyx_slice__44); + __pyx_tuple__45 = PyTuple_Pack(2, __pyx_slice__44, __pyx_int_2); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "MDAnalysis/lib/formats/libdcd.pyx":703 * for i in range(start, stop, step): * self.seek(i) * ok = self.c_readframes_helper(xyz_tmp[:, 0], xyz_tmp[:, 1], xyz_tmp[:, 2], box[counter], i==0) # <<<<<<<<<<<<<< * if ok != 0 and ok != -4: * raise IOError("Reading DCD frames failed: {}".format(DCD_ERRORS[ok])) */ - __pyx_slice__45 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__45)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__45); - __Pyx_GIVEREF(__pyx_slice__45); - __pyx_tuple__46 = PyTuple_Pack(2, __pyx_slice__45, __pyx_int_0); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - __pyx_slice__47 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__47)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__47); - __Pyx_GIVEREF(__pyx_slice__47); - __pyx_tuple__48 = PyTuple_Pack(2, __pyx_slice__47, __pyx_int_1); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_slice__49 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__49)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__49); - __Pyx_GIVEREF(__pyx_slice__49); - __pyx_tuple__50 = PyTuple_Pack(2, __pyx_slice__49, __pyx_int_2); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + __pyx_slice__46 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__46); + __Pyx_GIVEREF(__pyx_slice__46); + __pyx_tuple__47 = PyTuple_Pack(2, __pyx_slice__46, __pyx_int_0); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_slice__48 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__48)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__48); + __Pyx_GIVEREF(__pyx_slice__48); + __pyx_tuple__49 = PyTuple_Pack(2, __pyx_slice__48, __pyx_int_1); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_slice__50 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__50)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__50); + __Pyx_GIVEREF(__pyx_slice__50); + __pyx_tuple__51 = PyTuple_Pack(2, __pyx_slice__50, __pyx_int_2); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 810, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 1000, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 1000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< */ - __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 1012, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 1012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); /* "View.MemoryView":132 * @@ -28554,9 +28625,9 @@ static int __Pyx_InitCachedConstants(void) { * * if itemsize <= 0: */ - __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); /* "View.MemoryView":135 * @@ -28565,9 +28636,9 @@ static int __Pyx_InitCachedConstants(void) { * * if not isinstance(format, bytes): */ - __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 135, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); /* "View.MemoryView":138 * @@ -28576,9 +28647,9 @@ static int __Pyx_InitCachedConstants(void) { * self._format = format # keep a reference to the byte string * self.format = self._format */ - __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); /* "View.MemoryView":147 * @@ -28587,9 +28658,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); /* "View.MemoryView":175 * self.data = malloc(self.len) @@ -28598,9 +28669,9 @@ static int __Pyx_InitCachedConstants(void) { * * if self.dtype_is_object: */ - __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); /* "View.MemoryView":191 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS @@ -28609,9 +28680,9 @@ static int __Pyx_InitCachedConstants(void) { * info.buf = self.data * info.len = self.len */ - __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -28619,18 +28690,18 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(2, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__66); - __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(2, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); /* "View.MemoryView":413 * def __setitem__(memoryview self, object index, object value): @@ -28639,9 +28710,9 @@ static int __Pyx_InitCachedConstants(void) { * * have_slices, index = _unellipsify(index, self.view.ndim) */ - __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(2, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__68); - __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(2, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); /* "View.MemoryView":490 * result = struct.unpack(self.view.format, bytesitem) @@ -28650,9 +28721,9 @@ static int __Pyx_InitCachedConstants(void) { * else: * if len(self.view.format) == 1: */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(2, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(2, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); /* "View.MemoryView":515 * def __getbuffer__(self, Py_buffer *info, int flags): @@ -28661,9 +28732,9 @@ static int __Pyx_InitCachedConstants(void) { * * if flags & PyBUF_STRIDES: */ - __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(2, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__70); - __Pyx_GIVEREF(__pyx_tuple__70); + __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(2, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); /* "View.MemoryView":565 * if self.view.strides == NULL: @@ -28672,9 +28743,9 @@ static int __Pyx_InitCachedConstants(void) { * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ - __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(2, 565, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(2, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__72); + __Pyx_GIVEREF(__pyx_tuple__72); /* "View.MemoryView":572 * def suboffsets(self): @@ -28683,12 +28754,12 @@ static int __Pyx_InitCachedConstants(void) { * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ - __pyx_tuple__72 = PyTuple_New(1); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(2, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__72); + __pyx_tuple__73 = PyTuple_New(1); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(2, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_tuple__72, 0, __pyx_int_neg_1); - __Pyx_GIVEREF(__pyx_tuple__72); + PyTuple_SET_ITEM(__pyx_tuple__73, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__73); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -28696,18 +28767,18 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(2, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__73); - __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__74); + __Pyx_GIVEREF(__pyx_tuple__74); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(2, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__74); - __Pyx_GIVEREF(__pyx_tuple__74); + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); /* "View.MemoryView":677 * if item is Ellipsis: @@ -28716,9 +28787,9 @@ static int __Pyx_InitCachedConstants(void) { * seen_ellipsis = True * else: */ - __pyx_slice__75 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__75)) __PYX_ERR(2, 677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__75); - __Pyx_GIVEREF(__pyx_slice__75); + __pyx_slice__76 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__76)) __PYX_ERR(2, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__76); + __Pyx_GIVEREF(__pyx_slice__76); /* "View.MemoryView":680 * seen_ellipsis = True @@ -28727,9 +28798,9 @@ static int __Pyx_InitCachedConstants(void) { * have_slices = True * else: */ - __pyx_slice__76 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__76)) __PYX_ERR(2, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__76); - __Pyx_GIVEREF(__pyx_slice__76); + __pyx_slice__77 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__77)) __PYX_ERR(2, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__77); + __Pyx_GIVEREF(__pyx_slice__77); /* "View.MemoryView":691 * nslices = ndim - len(result) @@ -28738,9 +28809,9 @@ static int __Pyx_InitCachedConstants(void) { * * return have_slices or nslices, tuple(result) */ - __pyx_slice__77 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__77)) __PYX_ERR(2, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__77); - __Pyx_GIVEREF(__pyx_slice__77); + __pyx_slice__78 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__78)) __PYX_ERR(2, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__78); + __Pyx_GIVEREF(__pyx_slice__78); /* "View.MemoryView":698 * for suboffset in suboffsets[:ndim]: @@ -28749,9 +28820,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(2, 698, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); /* "(tree fragment)":2 * def __reduce_cython__(self): @@ -28759,18 +28830,18 @@ static int __Pyx_InitCachedConstants(void) { * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(2, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__79); - __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); /* "MDAnalysis/lib/formats/libdcd.pyx":145 * const double *unitcell, int charmm); @@ -28779,9 +28850,9 @@ static int __Pyx_InitCachedConstants(void) { * * cdef class DCDFile: */ - __pyx_tuple__81 = PyTuple_Pack(2, __pyx_n_s_DCDFrame, __pyx_kp_s_xyz_unitcell); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__81); - __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_tuple__82 = PyTuple_Pack(2, __pyx_n_s_DCDFrame, __pyx_kp_s_xyz_unitcell); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); /* "View.MemoryView":285 * return self.name @@ -28790,9 +28861,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__82); - __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); /* "View.MemoryView":286 * @@ -28801,9 +28872,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef indirect = Enum("") * */ - __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__83); - __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); /* "View.MemoryView":287 * cdef generic = Enum("") @@ -28812,9 +28883,9 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 287, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__84); - __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); /* "View.MemoryView":290 * @@ -28823,9 +28894,9 @@ static int __Pyx_InitCachedConstants(void) { * cdef indirect_contiguous = Enum("") * */ - __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__85); - __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); /* "View.MemoryView":291 * @@ -28834,19 +28905,19 @@ static int __Pyx_InitCachedConstants(void) { * * */ - __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 291, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__86); - __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * if __pyx_checksum != 0xb068931: * from pickle import PickleError as __pyx_PickleError */ - __pyx_tuple__87 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__87); - __Pyx_GIVEREF(__pyx_tuple__87); - __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(2, 1, __pyx_L1_error) + __pyx_tuple__88 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(2, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__88); + __Pyx_GIVEREF(__pyx_tuple__88); + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -28932,13 +29003,13 @@ static int __Pyx_modinit_type_init_code(void) { if (__Pyx_SetVtable(__pyx_type_10MDAnalysis_3lib_7formats_6libdcd_DCDFile.tp_dict, __pyx_vtabptr_10MDAnalysis_3lib_7formats_6libdcd_DCDFile) < 0) __PYX_ERR(0, 147, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "DCDFile", (PyObject *)&__pyx_type_10MDAnalysis_3lib_7formats_6libdcd_DCDFile) < 0) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_ptype_10MDAnalysis_3lib_7formats_6libdcd_DCDFile = &__pyx_type_10MDAnalysis_3lib_7formats_6libdcd_DCDFile; - if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header) < 0) __PYX_ERR(0, 332, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header) < 0) __PYX_ERR(0, 334, __pyx_L1_error) __pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header.tp_dictoffset && __pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header = &__pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct___read_header; - if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 377, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 379, __pyx_L1_error) __pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct_1_genexpr.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_10MDAnalysis_3lib_7formats_6libdcd___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; @@ -29050,8 +29121,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -29446,7 +29517,7 @@ if (!__Pyx_RefNanny) { */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_DCDFrame, __pyx_t_1) < 0) __PYX_ERR(0, 145, __pyx_L1_error) @@ -29482,7 +29553,7 @@ if (!__Pyx_RefNanny) { * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 285, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_1); @@ -29496,7 +29567,7 @@ if (!__Pyx_RefNanny) { * cdef indirect = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_1); @@ -29510,7 +29581,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_1); @@ -29524,7 +29595,7 @@ if (!__Pyx_RefNanny) { * cdef indirect_contiguous = Enum("") * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 290, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_1); @@ -29538,7 +29609,7 @@ if (!__Pyx_RefNanny) { * * */ - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); @@ -30511,6 +30582,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -30565,7 +30639,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -30580,7 +30654,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -30664,7 +30738,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -31969,7 +32043,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -32120,14 +32194,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i #ifndef offsetof @@ -504,6 +504,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -709,7 +710,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -817,7 +818,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -964,7 +965,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -973,7 +974,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -982,7 +983,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -991,7 +992,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -1000,7 +1001,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -1009,7 +1010,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -1018,7 +1019,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -1027,7 +1028,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -1036,7 +1037,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -1045,7 +1046,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -1054,7 +1055,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -1063,7 +1064,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -1072,7 +1073,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -1081,7 +1082,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -1090,7 +1091,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -1099,7 +1100,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1108,7 +1109,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1117,7 +1118,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1126,7 +1127,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1135,7 +1136,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1144,7 +1145,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1195,7 +1196,7 @@ struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1204,7 +1205,7 @@ struct __pyx_memoryviewslice_obj; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1213,7 +1214,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1222,7 +1223,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -10793,7 +10794,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_7formats_9libmdaxdr_7XTCFile_6write( return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -10841,7 +10842,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -10850,7 +10851,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -10859,7 +10860,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -10868,7 +10869,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -10882,7 +10883,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -10893,7 +10894,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -10902,7 +10903,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -10915,7 +10916,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -10924,7 +10925,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -10938,7 +10939,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -10949,7 +10950,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -10958,7 +10959,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -10971,7 +10972,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -10980,7 +10981,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -10989,7 +10990,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -10998,7 +10999,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -11008,7 +11009,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -11017,7 +11018,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -11026,7 +11027,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -11038,7 +11039,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -11047,7 +11048,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -11057,7 +11058,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -11067,7 +11068,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -11077,7 +11078,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -11088,7 +11089,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -11097,7 +11098,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -11106,7 +11107,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -11115,7 +11116,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -11124,7 +11125,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -11136,7 +11137,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -11149,7 +11150,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -11159,7 +11160,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -11169,7 +11170,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -11189,7 +11190,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -11206,7 +11207,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -11215,7 +11216,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -11228,7 +11229,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -11237,7 +11238,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -11249,7 +11250,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -11260,7 +11261,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -11271,7 +11272,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -11282,7 +11283,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -11293,7 +11294,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -11304,7 +11305,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -11315,7 +11316,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -11326,7 +11327,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -11337,7 +11338,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -11348,7 +11349,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -11359,7 +11360,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -11370,7 +11371,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -11381,7 +11382,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -11392,7 +11393,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -11403,7 +11404,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -11414,7 +11415,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -11426,7 +11427,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -11447,7 +11448,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -11456,7 +11457,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -11466,7 +11467,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -11475,7 +11476,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -11485,7 +11486,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -11494,7 +11495,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -11503,7 +11504,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -11513,7 +11514,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -11523,7 +11524,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -11555,7 +11556,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -11579,7 +11580,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -11589,7 +11590,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -11598,7 +11599,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -11607,7 +11608,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -11617,7 +11618,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -11626,7 +11627,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -11635,7 +11636,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -11647,7 +11648,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -11661,7 +11662,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -11675,7 +11676,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -11694,7 +11695,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -11708,7 +11709,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -11722,7 +11723,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -11741,7 +11742,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -11755,7 +11756,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -11769,7 +11770,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -11788,7 +11789,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -11802,7 +11803,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -11816,7 +11817,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -11835,7 +11836,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -11849,7 +11850,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -11863,7 +11864,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -11882,7 +11883,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -11896,7 +11897,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -11906,7 +11907,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -11918,7 +11919,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -11927,7 +11928,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -11941,7 +11942,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -11956,7 +11957,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -11985,7 +11986,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -11994,7 +11995,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -12003,7 +12004,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -12026,7 +12027,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -12043,7 +12044,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -12078,7 +12079,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -12095,7 +12096,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -12108,7 +12109,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -12117,7 +12118,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -12137,7 +12138,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -12154,7 +12155,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -12163,7 +12164,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -12176,7 +12177,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -12185,7 +12186,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -12201,7 +12202,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -12210,7 +12211,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -12219,7 +12220,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -12230,7 +12231,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -12240,7 +12241,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -12250,7 +12251,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -12262,7 +12263,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -12272,7 +12273,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -12285,7 +12286,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -12294,7 +12295,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -12312,7 +12313,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -12330,7 +12331,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -12348,7 +12349,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -12366,7 +12367,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -12384,7 +12385,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -12402,7 +12403,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -12420,7 +12421,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -12438,7 +12439,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -12456,7 +12457,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -12474,7 +12475,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -12492,7 +12493,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -12510,7 +12511,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -12528,7 +12529,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -12548,7 +12549,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -12568,7 +12569,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -12588,7 +12589,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -12606,7 +12607,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -12625,7 +12626,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -12634,7 +12635,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -12644,7 +12645,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -12657,7 +12658,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -12667,7 +12668,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -12677,7 +12678,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -12702,7 +12703,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -12717,7 +12718,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -12728,7 +12729,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -12737,7 +12738,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -12747,7 +12748,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -12757,7 +12758,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -12768,7 +12769,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -12777,7 +12778,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -12786,7 +12787,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -12798,7 +12799,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -12812,7 +12813,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -12822,7 +12823,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -12833,7 +12834,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -12842,7 +12843,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -12856,7 +12857,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -12871,7 +12872,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -12892,7 +12893,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -12908,7 +12909,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -12917,7 +12918,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -12931,7 +12932,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -12946,7 +12947,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -12962,7 +12963,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -12977,7 +12978,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -13000,7 +13001,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -13021,7 +13022,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13037,7 +13038,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -13046,7 +13047,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13060,7 +13061,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -13075,7 +13076,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -13091,7 +13092,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -13106,7 +13107,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -13129,7 +13130,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -13150,7 +13151,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13166,7 +13167,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -13175,7 +13176,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13189,7 +13190,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -13203,7 +13204,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -13217,7 +13218,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -13232,7 +13233,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -27580,7 +27581,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -27591,7 +27592,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -27602,7 +27603,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -27613,7 +27614,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -27624,7 +27625,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -27635,7 +27636,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -27646,7 +27647,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -27657,7 +27658,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -27668,7 +27669,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -28194,8 +28195,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -29658,6 +29659,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -29873,7 +29877,7 @@ static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -29888,7 +29892,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -29972,7 +29976,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -30363,7 +30367,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -30514,14 +30518,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i -#include +#define _FILE_OFFSET_BITS 64 + +#ifdef _WIN32 +# include +#else /* __unix__ */ +# include +#endif + #ifdef HAVE_RPC_XDR_H # include @@ -2512,8 +2519,8 @@ static int xdrstdio_getlong (XDR *, int32_t *); static int xdrstdio_putlong (XDR *, int32_t *); static int xdrstdio_getbytes (XDR *, char *, unsigned int); static int xdrstdio_putbytes (XDR *, char *, unsigned int); -static off_t xdrstdio_getpos (XDR *); -static int xdrstdio_setpos (XDR *, off_t, int); +static int64_t xdrstdio_getpos (XDR *); +static int xdrstdio_setpos (XDR *, int64_t, int); static void xdrstdio_destroy (XDR *); /* @@ -2595,14 +2602,18 @@ xdrstdio_putbytes (XDR *xdrs, char *addr, unsigned int len) } -static off_t +static int64_t xdrstdio_getpos (XDR *xdrs) { + #ifdef _WIN32 + return _ftelli64((FILE *) xdrs->x_private); + #else /* __unix__ */ return ftello((FILE *) xdrs->x_private); + #endif } static int -xdrstdio_setpos (XDR *xdrs, off_t pos, int whence) +xdrstdio_setpos (XDR *xdrs, int64_t pos, int whence) { /* A reason for failure can be filesystem limits on allocation units, * before the actual off_t overflow (ext3, with a 4K clustersize, @@ -2610,7 +2621,13 @@ xdrstdio_setpos (XDR *xdrs, off_t pos, int whence) /* We return errno relying on the fact that it is never set to 0 on * success, which means that if an error occurrs it'll never be the same * as exdrOK, and xdr_seek won't be confused.*/ + #ifdef _WIN32 + return _fseeki64((FILE *) xdrs->x_private, pos, whence) < 0 ? errno : exdrOK; + #else /* __unix__ */ return fseeko((FILE *) xdrs->x_private, pos, whence) < 0 ? errno : exdrOK; + #endif + + } @@ -2624,7 +2641,7 @@ int xdr_seek(XDRFILE *xd, int64_t pos, int whence) /* Seeks to position in file */ { int result; - if ((result = xdrstdio_setpos(xd->xdr, (off_t) pos, whence)) != 0) + if ((result = xdrstdio_setpos(xd->xdr, (int64_t) pos, whence)) != 0) return result; return exdrOK; diff --git a/package/MDAnalysis/lib/include/calc_distances.h b/package/MDAnalysis/lib/include/calc_distances.h index 3d4315e24b2..701b52a8973 100644 --- a/package/MDAnalysis/lib/include/calc_distances.h +++ b/package/MDAnalysis/lib/include/calc_distances.h @@ -307,28 +307,28 @@ static void _calc_self_distance_array_triclinic(coordinate* ref, int numref, } } -static void _coord_transform(coordinate* coords, int numCoords, coordinate* box) +void _coord_transform(float coords[][3], int numCoords, float box[][3]) { int i, j, k; - float new[3]; + float newpos[3]; // Matrix multiplication inCoords * box = outCoords // Multiplication done in place using temp array 'new' // Used to transform coordinates to/from S/R space in trilinic boxes #ifdef PARALLEL -#pragma omp parallel for private(i, j, k, new) shared(coords) +#pragma omp parallel for private(i, j, k, newpos) shared(coords) #endif for (i=0; i < numCoords; i++){ - new[0] = 0.0; - new[1] = 0.0; - new[2] = 0.0; + newpos[0] = 0.0; + newpos[1] = 0.0; + newpos[2] = 0.0; for (j=0; j<3; j++){ for (k=0; k<3; k++){ - new[j] += coords[i][k] * box[k][j]; + newpos[j] += coords[i][k] * box[k][j]; } } - coords[i][0] = new[0]; - coords[i][1] = new[1]; - coords[i][2] = new[2]; + coords[i][0] = newpos[0]; + coords[i][1] = newpos[1]; + coords[i][2] = newpos[2]; } } diff --git a/package/MDAnalysis/lib/log.py b/package/MDAnalysis/lib/log.py index 71ac5be41e1..be4ae0f9fb4 100644 --- a/package/MDAnalysis/lib/log.py +++ b/package/MDAnalysis/lib/log.py @@ -221,59 +221,6 @@ def _guess_string_format(template): return _legacy_format -def _set_verbose(verbose, quiet, default=True, - was='quiet', now='verbose'): - """Return the expected value of verbosity - - This function aims at handling the deprecation of the *quiet* keyword in - versin 0.16. - - This function issues a deprecation warning if *quiet* was set (is not - None), and raises a ValueError if *verbose* and *quiet* are set to - contradicting values. - - If *verbose* is set, then the function returns the set value of *verbose*. - If it is not set, but *quiet* is set, then the function returns - `not quiet`. Finally, if none of *verbose* nor *quiet* is set, then - *default* is returned. - - During the deprecation phase of the *quiet* keyword, this function is - expected to be used as follow: - - .. code-block:: python - - def method(verbose=None, quiet=None): - # *verbose* and *quiet* are set to None to distinguish explicitly - # set values. - self.verbose = _set_verbose(verbose, quiet, default=True) - - At the end of the deprecation period, the code above should be replaced by: - - .. code-block:: python - - def method(verbose=True): - # The *quiet* keyword disapeard and the default value for *verbose* - # is set to the actual default value. - self.verbose = verbose - - In `MDAnalysis.analysis.hbonds.hbonds_analysis`, the deprecation scheme is - more complex: *quiet* becomes *verbose*, and *verbose* becomes *debug*. - Hence, this function allows to use diffrent argument names to display in - error messages and deprecation warnings. - """ - if quiet is not None: - warnings.warn("Keyword *{}* is deprecated (from version 0.16); " - "use *{}* instead.".format(was, now), DeprecationWarning) - if verbose is not None and verbose == quiet: - raise ValueError("Keywords *{}* and *{}* are contradicting each other." - .format(now, was)) - return not quiet - elif verbose is None: - return default - else: - return verbose - - class ProgressMeter(object): r"""Simple progress meter @@ -378,17 +325,15 @@ class ProgressMeter(object): """ def __init__(self, numsteps, format=None, interval=10, offset=1, - verbose=None, dynamic=True, - format_handling='auto', quiet=None): + verbose=True, dynamic=True, + format_handling='auto'): self.numsteps = numsteps self.interval = int(interval) self.offset = int(offset) + self.verbose = verbose self.dynamic = dynamic self.numouts = -1 - # The *quiet* keyword argument is deprecated. - self.verbose = _set_verbose(verbose, quiet, default=True) - if format is None: format = "Step {step:5d}/{numsteps} [{percentage:5.1f}%]" self.format_handler = _new_format diff --git a/package/MDAnalysis/lib/mdamath.py b/package/MDAnalysis/lib/mdamath.py index eccc43fdf55..220f17d29b8 100644 --- a/package/MDAnalysis/lib/mdamath.py +++ b/package/MDAnalysis/lib/mdamath.py @@ -35,6 +35,7 @@ .. autofunction:: triclinic_vectors .. autofunction:: box_volume .. autofunction:: make_whole +.. autofunction:: find_fragments .. versionadded:: 0.11.0 """ @@ -43,7 +44,8 @@ import numpy as np from ..exceptions import NoDataError - +from . import util +from ._cutil import make_whole, find_fragments # geometric functions def norm(v): @@ -248,226 +250,3 @@ def box_volume(dimensions): """ return np.linalg.det(triclinic_vectors(dimensions)) - -def _is_contiguous(atomgroup, atom): - """Walk through atomgroup, starting with atom. - - Returns - ------- - bool - ``True`` if all of *atomgroup* is accessible through walking - along bonds. - ``False`` otherwise. - """ - seen = set([atom]) - walked = set() - ag_set = set(atomgroup) - - nloops = 0 - while len(seen) < len(atomgroup): - nloops += 1 - if nloops > len(atomgroup): - return False - - todo = seen.difference(walked) - for atom in todo: - for other in atom.bonded_atoms: - if other in ag_set: - seen.add(other) - walked.add(atom) - - return True - - -def make_whole(atomgroup, reference_atom=None): - """Move all atoms in a single molecule so that bonds don't split over images - - Atoms are modified in place. - - This function is most useful when atoms have been packed into the primary - unit cell, causing breaks mid molecule, with the molecule then appearing - on either side of the unit cell. This is problematic for operations - such as calculating the center of mass of the molecule. :: - - +-----------+ +-----------+ - | | | | - | 6 3 | | 3 | 6 - | ! ! | | ! | ! - |-5-8 1-2-| -> | 1-2-|-5-8 - | ! ! | | ! | ! - | 7 4 | | 4 | 7 - | | | | - +-----------+ +-----------+ - - - Parameters - ---------- - atomgroup : AtomGroup - The :class:`MDAnalysis.core.groups.AtomGroup` to work with. - The positions of this are modified in place. All these atoms - must belong in the same molecule or fragment. - reference_atom : :class:`~MDAnalysis.core.groups.Atom` - The atom around which all other atoms will be moved. - Defaults to atom 0 in the atomgroup. - - Raises - ------ - NoDataError - There are no bonds present. - (See :func:`~MDAnalysis.topology.core.guess_bonds`) - - ValueError - The algorithm fails to work. This is usually - caused by the atomgroup not being a single fragment. - (ie the molecule can't be traversed by following bonds) - - Note - ---- - Only orthogonal boxes are currently supported. - - Example - ------- - Make fragments whole:: - - from MDAnalysis.util.mdamath import make_whole - - # This algorithm requires bonds, these can be guessed! - u = mda.Universe(......, guess_bonds=True) - - # MDAnalysis can split molecules into their fragments - # based on bonding information. - # Note that this function will only handle a single fragment - # at a time, necessitating a loop. - for frag in u.fragments: - make_whole(frag) - - Alternatively, to keep a single atom in place as the anchor:: - - # This will mean that atomgroup[10] will NOT get moved, - # and all other atoms will move (if necessary). - make_whole(atomgroup, reference_atom=atomgroup[10]) - - - .. versionadded:: 0.11.0 - """ - try: - b = atomgroup.bonds - except (AttributeError, NoDataError): - raise NoDataError("The atomgroup is required to have bonds") - - if reference_atom is None: - ref = atomgroup[0] - else: - ref = reference_atom - # Sanity check - if not ref in atomgroup: - raise ValueError("Reference atom not in atomgroup") - - # Check all of atomgroup is accessible from ref - if not _is_contiguous(atomgroup, ref): - raise ValueError("atomgroup not contiguous from bonds") - - # Not sure if this is actually a requirement... - # I think application of pbc would need to be changed for triclinic boxes - # but that's all? How does minimum bond length criteria change? - if not all(atomgroup.dimensions[3:] == 90.0): - raise ValueError("Non orthogonal boxes are not supported") - box = atomgroup.dimensions[:3] - - if all(box == 0.0): - raise ValueError("Supplied box had zero size") - - box_length = box.min() / 2.0 - - bondlengths = atomgroup.bonds.bonds(pbc=True) - if bondlengths.min() * 1.4 > box_length: - raise ValueError("Box lengths are too small relative to bond lengths") - - # All checks done, let's continue - # If bond lengths don't change after pbc applied, then no bonds - # straddle the box boundaries - if np.allclose(atomgroup.bonds.bonds(), bondlengths): - return - # Can't reuse this calculation of bond lengths as we're changing - # stuff as we go. - - processed = set() # Who have I already done? - ref_points = set([ref]) # Who is safe to use as reference point? - - ag_set = set(atomgroup) - nres = len(atomgroup) # total size of the problem - nloops = 0 - while len(ref_points) < nres: # While all atoms aren't correct - nloops += 1 - if nloops > nres: # To prevent infinite loop - # This point probable isn't reachable with the above _is_contiguous - # check, but better safe than sorry. - raise ValueError("Algorithm couldn't traverse atomgroup. " - "Perhaps the atomgroup isn't fully connected") - - # We want to iterate over atoms that are good to use as reference - # points, but haven't been processed yet. - todo = ref_points.difference(processed) - for atom in todo: - for b in atom.bonds: - other = b.partner(atom) - # Avoid atoms not in our scope - if other not in ag_set: - continue - if other in ref_points: - continue - if b.length() > box_length: - # Vector from ref atom to other - vec = other.position - ref.position - # Apply pbc to this vector - vec -= np.rint(vec/box) * box - # Define the position of other based on this vector - other.position = ref.position + vec - # This atom can now be used as a reference point - ref_points.add(other) - - processed.add(atom) - - -def one_to_many_pointers(Ni, Nj, i2j): - """Based on a many to one mapping of i to j, create the reverse mapping - - Arguments - --------- - Ni : int - number of i components - Nj : int - number of j components - i2j : numpy.ndarray - relates i to parent js - - Returns - ------- - ordered : list - an ordered list of i indices [size (i,)] - ptrs : list - the start and end index for each j [size (Nj, 2)] - - Example - ------- - .. code:: python - - # Residx - the resid of each Atom - ordered, ptrs = one_to_many_pointers(Natoms, Nres, Residx) - - # Returns an array of the atom indices that are in resid 7 - atoms = ordered[ptrs[7,0]:ptrs[7,1]] - - """ - ordered = i2j.argsort() - sorted_idx = i2j[ordered] - borders = np.concatenate([[0], - np.where(np.diff(sorted_idx))[0] + 1, - [Ni]]) - - ptrs = np.zeros((Nj, 2), dtype=np.int32) - for x, y in zip(borders[:-1], borders[1:]): - i = sorted_idx[x] - ptrs[i] = x, y - - return ordered, ptrs diff --git a/package/MDAnalysis/lib/nsgrid.cpp b/package/MDAnalysis/lib/nsgrid.cpp new file mode 100644 index 00000000000..61627150861 --- /dev/null +++ b/package/MDAnalysis/lib/nsgrid.cpp @@ -0,0 +1,34155 @@ +/* Generated by Cython 0.28.5 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h" + ], + "extra_compile_args": [ + "-ffast-math", + "-O3", + "-funroll-loops", + "-std=c++11", + "-stdlib=libc++" + ], + "include_dirs": [ + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include" + ], + "language": "c++", + "name": "MDAnalysis.lib.nsgrid", + "sources": [ + "MDAnalysis/lib/nsgrid.pyx" + ] + }, + "module_name": "MDAnalysis.lib.nsgrid" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_28_5" +#define CYTHON_FUTURE_DIVISION 0 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef __cplusplus + #error "Cython files generated with the C++ option must be compiled with a C++ compiler." +#endif +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #else + #define CYTHON_INLINE inline + #endif +#endif +template +void __Pyx_call_destructor(T& x) { + x.~T(); +} +template +class __Pyx_FakeReference { + public: + __Pyx_FakeReference() : ptr(NULL) { } + __Pyx_FakeReference(const T& ref) : ptr(const_cast(&ref)) { } + T *operator->() { return ptr; } + T *operator&() { return ptr; } + operator T&() { return *ptr; } + template bool operator ==(U other) { return *ptr == other; } + template bool operator !=(U other) { return *ptr != other; } + private: + T *ptr; +}; + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__MDAnalysis__lib__nsgrid +#define __PYX_HAVE_API__MDAnalysis__lib__nsgrid +/* Early includes */ +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include +#include +#include "numpy/arrayobject.h" +#include "numpy/ufuncobject.h" +#include "pythread.h" +#include +#include "pystate.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + +/* Header.proto */ +#if !defined(CYTHON_CCOMPLEX) + #if defined(__cplusplus) + #define CYTHON_CCOMPLEX 1 + #elif defined(_Complex_I) + #define CYTHON_CCOMPLEX 1 + #else + #define CYTHON_CCOMPLEX 0 + #endif +#endif +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #include + #else + #include + #endif +#endif +#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) + #undef _Complex_I + #define _Complex_I 1.0fj +#endif + + +static const char *__pyx_f[] = { + "MDAnalysis/lib/nsgrid.pyx", + "stringsource", + "__init__.pxd", + "type.pxd", +}; +/* MemviewSliceStruct.proto */ +struct __pyx_memoryview_obj; +typedef struct { + struct __pyx_memoryview_obj *memview; + char *data; + Py_ssize_t shape[8]; + Py_ssize_t strides[8]; + Py_ssize_t suboffsets[8]; +} __Pyx_memviewslice; +#define __Pyx_MemoryView_Len(m) (m.shape[0]) + +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __pyx_atomic_int_type int +#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ + !defined(__i386__) + #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type LONG + #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 + #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) + #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using Intel atomics" + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +typedef volatile __pyx_atomic_int_type __pyx_atomic_int; +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* BufferFormatStructs.proto */ +#define IS_UNSIGNED(type) (((type) -1) > 0) +struct __Pyx_StructField_; +#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) +typedef struct { + const char* name; + struct __Pyx_StructField_* fields; + size_t size; + size_t arraysize[8]; + int ndim; + char typegroup; + char is_unsigned; + int flags; +} __Pyx_TypeInfo; +typedef struct __Pyx_StructField_ { + __Pyx_TypeInfo* type; + const char* name; + size_t offset; +} __Pyx_StructField; +typedef struct { + __Pyx_StructField* field; + size_t parent_offset; +} __Pyx_BufFmt_StackElem; +typedef struct { + __Pyx_StructField root; + __Pyx_BufFmt_StackElem* head; + size_t fmt_offset; + size_t new_count, enc_count; + size_t struct_alignment; + int is_complex; + char enc_type; + char new_packmode; + char enc_packmode; + char is_valid_array; +} __Pyx_BufFmt_Context; + + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 + * # 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 + * + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t + */ +typedef npy_int16 __pyx_t_5numpy_int16_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 + * ctypedef npy_int8 int8_t + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< + * ctypedef npy_int64 int64_t + * #ctypedef npy_int96 int96_t + */ +typedef npy_int32 __pyx_t_5numpy_int32_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 + * ctypedef npy_int16 int16_t + * ctypedef npy_int32 int32_t + * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< + * #ctypedef npy_int96 int96_t + * #ctypedef npy_int128 int128_t + */ +typedef npy_int64 __pyx_t_5numpy_int64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 + * #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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 + * + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t + */ +typedef npy_uint16 __pyx_t_5numpy_uint16_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 + * ctypedef npy_uint8 uint8_t + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< + * ctypedef npy_uint64 uint64_t + * #ctypedef npy_uint96 uint96_t + */ +typedef npy_uint32 __pyx_t_5numpy_uint32_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 + * ctypedef npy_uint16 uint16_t + * ctypedef npy_uint32 uint32_t + * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< + * #ctypedef npy_uint96 uint96_t + * #ctypedef npy_uint128 uint128_t + */ +typedef npy_uint64 __pyx_t_5numpy_uint64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 + * #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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 + * + * ctypedef npy_float32 float32_t + * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< + * #ctypedef npy_float80 float80_t + * #ctypedef npy_float128 float128_t + */ +typedef npy_float64 __pyx_t_5numpy_float64_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 + * # The int types are mapped a bit surprising -- + * # numpy.int corresponds to 'l' and numpy.long to 'q' + * ctypedef npy_long int_t # <<<<<<<<<<<<<< + * ctypedef npy_longlong long_t + * ctypedef npy_longlong longlong_t + */ +typedef npy_long __pyx_t_5numpy_int_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 + * # 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 + * + * ctypedef npy_ulong uint_t + * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< + * ctypedef npy_ulonglong ulonglong_t + * + */ +typedef npy_ulonglong __pyx_t_5numpy_ulong_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 + * ctypedef npy_ulonglong ulonglong_t + * + * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< + * ctypedef npy_uintp uintp_t + * + */ +typedef npy_intp __pyx_t_5numpy_intp_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 + * + * ctypedef npy_intp intp_t + * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< + * + * ctypedef npy_double float_t + */ +typedef npy_uintp __pyx_t_5numpy_uintp_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 + * + * ctypedef npy_double float_t + * ctypedef npy_double double_t # <<<<<<<<<<<<<< + * ctypedef npy_longdouble longdouble_t + * + */ +typedef npy_double __pyx_t_5numpy_double_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 + * 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; + +/* "MDAnalysis/lib/nsgrid.pyx":89 + * DEF EPSILON = 1e-5 + * + * ctypedef np.int_t ns_int # <<<<<<<<<<<<<< + * ctypedef np.float32_t real + * ctypedef real rvec[DIM] + */ +typedef __pyx_t_5numpy_int_t __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int; + +/* "MDAnalysis/lib/nsgrid.pyx":90 + * + * ctypedef np.int_t ns_int + * ctypedef np.float32_t real # <<<<<<<<<<<<<< + * ctypedef real rvec[DIM] + * ctypedef ns_int ivec[DIM] + */ +typedef __pyx_t_5numpy_float32_t __pyx_t_10MDAnalysis_3lib_6nsgrid_real; +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< float > __pyx_t_float_complex; + #else + typedef float _Complex __pyx_t_float_complex; + #endif +#else + typedef struct { float real, imag; } __pyx_t_float_complex; +#endif +static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); + +/* Declarations.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + typedef ::std::complex< double > __pyx_t_double_complex; + #else + typedef double _Complex __pyx_t_double_complex; + #endif +#else + typedef struct { double real, imag; } __pyx_t_double_complex; +#endif +static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); + + +/*--- Type declarations ---*/ +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox; +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults; +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid; +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; +struct __pyx_memoryview_obj; +struct __pyx_memoryviewslice_obj; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 + * + * ctypedef npy_cfloat cfloat_t + * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< + * ctypedef npy_clongdouble clongdouble_t + * + */ +typedef npy_cdouble __pyx_t_5numpy_cdouble_t; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 + * 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; + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 + * ctypedef npy_clongdouble clongdouble_t + * + * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew1(a): + */ +typedef npy_cdouble __pyx_t_5numpy_complex_t; +struct __pyx_t_10MDAnalysis_3lib_6nsgrid_cPBCBox_t; + +/* "MDAnalysis/lib/nsgrid.pyx":91 + * ctypedef np.int_t ns_int + * ctypedef np.float32_t real + * ctypedef real rvec[DIM] # <<<<<<<<<<<<<< + * ctypedef ns_int ivec[DIM] + * ctypedef real matrix[DIM][DIM] + */ +typedef __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_10MDAnalysis_3lib_6nsgrid_rvec[3]; + +/* "MDAnalysis/lib/nsgrid.pyx":92 + * ctypedef np.float32_t real + * ctypedef real rvec[DIM] + * ctypedef ns_int ivec[DIM] # <<<<<<<<<<<<<< + * ctypedef real matrix[DIM][DIM] + * + */ +typedef __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_10MDAnalysis_3lib_6nsgrid_ivec[3]; + +/* "MDAnalysis/lib/nsgrid.pyx":93 + * ctypedef real rvec[DIM] + * ctypedef ns_int ivec[DIM] + * ctypedef real matrix[DIM][DIM] # <<<<<<<<<<<<<< + * + * ctypedef vector[ns_int] intvec + */ +typedef __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_10MDAnalysis_3lib_6nsgrid_matrix[3][3]; + +/* "MDAnalysis/lib/nsgrid.pyx":95 + * ctypedef real matrix[DIM][DIM] + * + * ctypedef vector[ns_int] intvec # <<<<<<<<<<<<<< + * ctypedef vector[real] realvec + * + */ +typedef std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> __pyx_t_10MDAnalysis_3lib_6nsgrid_intvec; + +/* "MDAnalysis/lib/nsgrid.pyx":96 + * + * ctypedef vector[ns_int] intvec + * ctypedef vector[real] realvec # <<<<<<<<<<<<<< + * + * # Useful Functions + */ +typedef std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> __pyx_t_10MDAnalysis_3lib_6nsgrid_realvec; + +/* "MDAnalysis/lib/nsgrid.pyx":110 + * # Utility class to handle PBC # + * ############################### + * cdef struct cPBCBox_t: # <<<<<<<<<<<<<< + * matrix box + * rvec fbox_diag + */ +struct __pyx_t_10MDAnalysis_3lib_6nsgrid_cPBCBox_t { + __pyx_t_10MDAnalysis_3lib_6nsgrid_matrix box; + __pyx_t_10MDAnalysis_3lib_6nsgrid_rvec fbox_diag; + __pyx_t_10MDAnalysis_3lib_6nsgrid_rvec hbox_diag; + __pyx_t_10MDAnalysis_3lib_6nsgrid_rvec mhbox_diag; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real max_cutoff2; +}; + +/* "MDAnalysis/lib/nsgrid.pyx":119 + * + * # Class to handle PBC calculations + * cdef class PBCBox(object): # <<<<<<<<<<<<<< + * """ + * Cython implementation of + */ +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox { + PyObject_HEAD + struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_vtab; + struct __pyx_t_10MDAnalysis_3lib_6nsgrid_cPBCBox_t c_pbcbox; + int is_triclinic; + int periodic; +}; + + +/* "MDAnalysis/lib/nsgrid.pyx":310 + * ######################### + * + * cdef class NSResults(object): # <<<<<<<<<<<<<< + * """Class to store the results + * + */ +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults { + PyObject_HEAD + struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_vtab; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real cutoff; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int npairs; + __Pyx_memviewslice coords; + __Pyx_memviewslice searchcoords; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> indices_buffer; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> distances_buffer; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> pairs_buffer; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> pair_distances_buffer; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> pair_distances2_buffer; +}; + + +/* "MDAnalysis/lib/nsgrid.pyx":510 + * return list(self.distances_buffer) + * + * cdef class NSGrid(object): # <<<<<<<<<<<<<< + * """Constructs a uniform cuboidal grid for a brick-shaped box + * + */ +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid { + PyObject_HEAD + struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_vtab; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real cutoff; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int size; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int ncoords; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int ncells[3]; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int cell_offsets[3]; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real cellsize[3]; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int nbeads_per_cell; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *nbeads; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *beadids; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *cellids; + int force; +}; + + +/* "MDAnalysis/lib/nsgrid.pyx":686 + * + * + * cdef class FastNS(object): # <<<<<<<<<<<<<< + * """Grid based search between two group of atoms + * + */ +struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS { + PyObject_HEAD + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *box; + __Pyx_memviewslice coords; + __Pyx_memviewslice coords_bbox; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real cutoff; + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *grid; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int max_gridsize; + int periodic; +}; + + +/* "View.MemoryView":104 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ +struct __pyx_array_obj { + PyObject_HEAD + struct __pyx_vtabstruct_array *__pyx_vtab; + char *data; + Py_ssize_t len; + char *format; + int ndim; + Py_ssize_t *_shape; + Py_ssize_t *_strides; + Py_ssize_t itemsize; + PyObject *mode; + PyObject *_format; + void (*callback_free_data)(void *); + int free_data; + int dtype_is_object; +}; + + +/* "View.MemoryView":278 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":329 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ +struct __pyx_memoryview_obj { + PyObject_HEAD + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":960 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); +}; + + + +/* "MDAnalysis/lib/nsgrid.pyx":119 + * + * # Class to handle PBC calculations + * cdef class PBCBox(object): # <<<<<<<<<<<<<< + * """ + * Cython implementation of + */ + +struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox { + void (*fast_update)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __Pyx_memviewslice); + void (*fast_pbc_dx)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *); + __pyx_t_10MDAnalysis_3lib_6nsgrid_real (*fast_distance2)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *); + __Pyx_memviewslice (*fast_put_atoms_in_bbox)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __Pyx_memviewslice); +}; +static struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_PBCBox; + + +/* "MDAnalysis/lib/nsgrid.pyx":310 + * ######################### + * + * cdef class NSResults(object): # <<<<<<<<<<<<<< + * """Class to store the results + * + */ + +struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults { + void (*add_neighbors)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int, __pyx_t_10MDAnalysis_3lib_6nsgrid_real); + void (*create_buffers)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *); +}; +static struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSResults; + + +/* "MDAnalysis/lib/nsgrid.pyx":510 + * return list(self.distances_buffer) + * + * cdef class NSGrid(object): # <<<<<<<<<<<<<< + * """Constructs a uniform cuboidal grid for a brick-shaped box + * + */ + +struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int (*coord2cellid)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *); + int (*cellid2cellxyz)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *); + PyObject *(*fill_grid)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *, __Pyx_memviewslice); +}; +static struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSGrid; + + +/* "View.MemoryView":104 + * + * @cname("__pyx_array") + * cdef class array: # <<<<<<<<<<<<<< + * + * cdef: + */ + +struct __pyx_vtabstruct_array { + PyObject *(*get_memview)(struct __pyx_array_obj *); +}; +static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; + + +/* "View.MemoryView":329 + * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< + * + * cdef object obj + */ + +struct __pyx_vtabstruct_memoryview { + char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); + PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); + PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); + PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); +}; +static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; + + +/* "View.MemoryView":960 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ + +struct __pyx_vtabstruct__memoryviewslice { + struct __pyx_vtabstruct_memoryview __pyx_base; +}; +static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* MemviewSliceInit.proto */ +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#define __Pyx_MEMVIEW_DIRECT 1 +#define __Pyx_MEMVIEW_PTR 2 +#define __Pyx_MEMVIEW_FULL 4 +#define __Pyx_MEMVIEW_CONTIG 8 +#define __Pyx_MEMVIEW_STRIDED 16 +#define __Pyx_MEMVIEW_FOLLOW 32 +#define __Pyx_IS_C_CONTIG 1 +#define __Pyx_IS_F_CONTIG 2 +static int __Pyx_init_memviewslice( + struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference); +static CYTHON_INLINE int __pyx_add_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( + __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); +#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) +#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) +#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) +#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) +static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* GetModuleGlobalName.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* SliceObject.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( + PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* UnaryNegOverflows.proto */ +#define UNARY_NEG_WOULD_OVERFLOW(x)\ + (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) + +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); +#else +#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ + (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +#if PY_MAJOR_VERSION < 3 + static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); + static void __Pyx_ReleaseBuffer(Py_buffer *view); +#else + #define __Pyx_GetBuffer PyObject_GetBuffer + #define __Pyx_ReleaseBuffer PyBuffer_Release +#endif + + +/* BufferStructDeclare.proto */ +typedef struct { + Py_ssize_t shape, strides, suboffsets; +} __Pyx_Buf_DimInfo; +typedef struct { + size_t refcount; + Py_buffer pybuffer; +} __Pyx_Buffer; +typedef struct { + __Pyx_Buffer *rcbuffer; + char *data; + __Pyx_Buf_DimInfo diminfo[8]; +} __Pyx_LocalBuf_ND; + +/* MemviewSliceIsContig.proto */ +static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); + +/* OverlappingSlices.proto */ +static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize); + +/* Capsule.proto */ +static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); + +/* None.proto */ +#include + +/* MemviewDtypeToObject.proto */ +static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(const char *itemp); +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(const char *itemp, PyObject *obj); + +/* IsLittleEndian.proto */ +static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); + +/* BufferFormatCheck.proto */ +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); +static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type); + +/* TypeInfoCompare.proto */ +static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); + +/* MemviewSliceValidateAndInit.proto */ +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyObject *, int writable_flag); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value); + +/* CppExceptionConversion.proto */ +#ifndef __Pyx_CppExn2PyErr +#include +#include +#include +#include +static void __Pyx_CppExn2PyErr() { + try { + if (PyErr_Occurred()) + ; // let the latest Python exn pass through and ignore the current one + else + throw; + } catch (const std::bad_alloc& exn) { + PyErr_SetString(PyExc_MemoryError, exn.what()); + } catch (const std::bad_cast& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::bad_typeid& exn) { + PyErr_SetString(PyExc_TypeError, exn.what()); + } catch (const std::domain_error& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::invalid_argument& exn) { + PyErr_SetString(PyExc_ValueError, exn.what()); + } catch (const std::ios_base::failure& exn) { + PyErr_SetString(PyExc_IOError, exn.what()); + } catch (const std::out_of_range& exn) { + PyErr_SetString(PyExc_IndexError, exn.what()); + } catch (const std::overflow_error& exn) { + PyErr_SetString(PyExc_OverflowError, exn.what()); + } catch (const std::range_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::underflow_error& exn) { + PyErr_SetString(PyExc_ArithmeticError, exn.what()); + } catch (const std::exception& exn) { + PyErr_SetString(PyExc_RuntimeError, exn.what()); + } + catch (...) + { + PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); + } +} +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* RealImag.proto */ +#if CYTHON_CCOMPLEX + #ifdef __cplusplus + #define __Pyx_CREAL(z) ((z).real()) + #define __Pyx_CIMAG(z) ((z).imag()) + #else + #define __Pyx_CREAL(z) (__real__(z)) + #define __Pyx_CIMAG(z) (__imag__(z)) + #endif +#else + #define __Pyx_CREAL(z) ((z).real) + #define __Pyx_CIMAG(z) ((z).imag) +#endif +#if defined(__cplusplus) && CYTHON_CCOMPLEX\ + && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) + #define __Pyx_SET_CREAL(z,x) ((z).real(x)) + #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) +#else + #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) + #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_float(a, b) ((a)==(b)) + #define __Pyx_c_sum_float(a, b) ((a)+(b)) + #define __Pyx_c_diff_float(a, b) ((a)-(b)) + #define __Pyx_c_prod_float(a, b) ((a)*(b)) + #define __Pyx_c_quot_float(a, b) ((a)/(b)) + #define __Pyx_c_neg_float(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_float(z) ((z)==(float)0) + #define __Pyx_c_conj_float(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_float(z) (::std::abs(z)) + #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_float(z) ((z)==0) + #define __Pyx_c_conj_float(z) (conjf(z)) + #if 1 + #define __Pyx_c_abs_float(z) (cabsf(z)) + #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); + #endif +#endif + +/* Arithmetic.proto */ +#if CYTHON_CCOMPLEX + #define __Pyx_c_eq_double(a, b) ((a)==(b)) + #define __Pyx_c_sum_double(a, b) ((a)+(b)) + #define __Pyx_c_diff_double(a, b) ((a)-(b)) + #define __Pyx_c_prod_double(a, b) ((a)*(b)) + #define __Pyx_c_quot_double(a, b) ((a)/(b)) + #define __Pyx_c_neg_double(a) (-(a)) + #ifdef __cplusplus + #define __Pyx_c_is_zero_double(z) ((z)==(double)0) + #define __Pyx_c_conj_double(z) (::std::conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (::std::abs(z)) + #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) + #endif + #else + #define __Pyx_c_is_zero_double(z) ((z)==0) + #define __Pyx_c_conj_double(z) (conj(z)) + #if 1 + #define __Pyx_c_abs_double(z) (cabs(z)) + #define __Pyx_c_pow_double(a, b) (cpow(a, b)) + #endif + #endif +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); + #endif +#endif + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); + +/* MemviewSliceCopyTemplate.proto */ +static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object); + +/* CIntFromPy.proto */ +static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CopyContentsUtility.proto */ +#define __pyx_memoryview_copy_slice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real_c(slice)\ + __pyx_memoryview_copy_new_contig(&slice, "c", 2,\ + sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_real), (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT),\ + 0) + +/* CopyContentsUtility.proto */ +#define __pyx_memoryview_copy_slice_dcd__nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real_f(slice)\ + __pyx_memoryview_copy_new_contig(&slice, "fortran", 2,\ + sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_real), (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT),\ + 0) + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + +/* ObjectToMemviewSlice.proto */ +static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(PyObject *, int writable_flag); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyIdentifierFromString.proto */ +#if !defined(__Pyx_PyIdentifier_FromString) +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +#else + #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) +#endif +#endif + +/* ModuleImport.proto */ +static PyObject *__Pyx_ImportModule(const char *name); + +/* TypeImport.proto */ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_update(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_box); /* proto*/ +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_pbc_dx(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_ref, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_other, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_dx); /* proto*/ +static __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_distance2(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_a, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_b); /* proto*/ +static __Pyx_memviewslice __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_put_atoms_in_bbox(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_coords); /* proto*/ +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_9NSResults_add_neighbors(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_beadid_i, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_beadid_j, __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_distance2); /* proto*/ +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_9NSResults_create_buffers(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self); /* proto*/ +static __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_coord2cellid(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_coord); /* proto*/ +static int __pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_cellid2cellxyz(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_cellid, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *__pyx_v_cellxyz); /* proto*/ +static PyObject *__pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_fill_grid(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, __Pyx_memviewslice __pyx_v_coords); /* proto*/ +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'libc.math' */ + +/* Module declarations from 'libcpp.vector' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'numpy' */ + +/* Module declarations from 'numpy' */ +static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; +static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ + +/* Module declarations from 'MDAnalysis.lib.nsgrid' */ +static PyTypeObject *__pyx_ptype_10MDAnalysis_3lib_6nsgrid_PBCBox = 0; +static PyTypeObject *__pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSResults = 0; +static PyTypeObject *__pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSGrid = 0; +static PyTypeObject *__pyx_ptype_10MDAnalysis_3lib_6nsgrid_FastNS = 0; +static PyTypeObject *__pyx_array_type = 0; +static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; +static PyTypeObject *__pyx_memoryviewslice_type = 0; +static PyObject *generic = 0; +static PyObject *strided = 0; +static PyObject *indirect = 0; +static PyObject *contiguous = 0; +static PyObject *indirect_contiguous = 0; +static int __pyx_memoryview_thread_locks_used; +static PyThread_type_lock __pyx_memoryview_thread_locks[8]; +static __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_f_10MDAnalysis_3lib_6nsgrid_rvec_norm2(__pyx_t_10MDAnalysis_3lib_6nsgrid_real *); /*proto*/ +static PyObject *__pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults__set_state(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *, PyObject *); /*proto*/ +static PyObject *__pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_FastNS__set_state(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *, PyObject *); /*proto*/ +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> &); /*proto*/ +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyObject *); /*proto*/ +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(PyObject *); /*proto*/ +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> &); /*proto*/ +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(PyObject *); /*proto*/ +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(PyObject *); /*proto*/ +static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ +static void *__pyx_align_pointer(void *, size_t); /*proto*/ +static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ +static PyObject *_unellipsify(PyObject *, int); /*proto*/ +static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ +static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ +static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ +static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ +static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ +static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ +static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ +static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ +static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ +static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real = { "real", NULL, sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_real), { 0 }, 0, 'R', 0, 0 }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int = { "ns_int", NULL, sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int), { 0 }, 0, IS_UNSIGNED(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int), 0 }; +#define __Pyx_MODULE_NAME "MDAnalysis.lib.nsgrid" +extern int __pyx_module_is_main_MDAnalysis__lib__nsgrid; +int __pyx_module_is_main_MDAnalysis__lib__nsgrid = 0; + +/* Implementation of 'MDAnalysis.lib.nsgrid' */ +static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_enumerate; +static PyObject *__pyx_builtin_Ellipsis; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_IndexError; +static const char __pyx_k_C[] = "C"; +static const char __pyx_k_O[] = "O"; +static const char __pyx_k_c[] = "c"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_np[] = "np"; +static const char __pyx_k_box[] = "box"; +static const char __pyx_k_int[] = "int"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_pbc[] = "pbc"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_copy[] = "copy"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mode[] = "mode"; +static const char __pyx_k_name[] = "name"; +static const char __pyx_k_ndim[] = "ndim"; +static const char __pyx_k_pack[] = "pack"; +static const char __pyx_k_size[] = "size"; +static const char __pyx_k_sqrt[] = "sqrt"; +static const char __pyx_k_step[] = "step"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_ASCII[] = "ASCII"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dtype[] = "dtype"; +static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_force[] = "force"; +static const char __pyx_k_int64[] = "int64"; +static const char __pyx_k_numpy[] = "numpy"; +static const char __pyx_k_order[] = "order"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_shape[] = "shape"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_astype[] = "astype"; +static const char __pyx_k_coords[] = "coords"; +static const char __pyx_k_cutoff[] = "cutoff"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_name_2[] = "__name__"; +static const char __pyx_k_pickle[] = "pickle"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_struct[] = "struct"; +static const char __pyx_k_unpack[] = "unpack"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_asarray[] = "asarray"; +static const char __pyx_k_float32[] = "float32"; +static const char __pyx_k_fortran[] = "fortran"; +static const char __pyx_k_memview[] = "memview"; +static const char __pyx_k_ncoords[] = "ncoords"; +static const char __pyx_k_reshape[] = "reshape"; +static const char __pyx_k_Ellipsis[] = "Ellipsis"; +static const char __pyx_k_allclose[] = "allclose"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_itemsize[] = "itemsize"; +static const char __pyx_k_max_size[] = "max_size"; +static const char __pyx_k_periodic[] = "periodic"; +static const char __pyx_k_pyx_type[] = "__pyx_type"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_enumerate[] = "enumerate"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_IndexError[] = "IndexError"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_result[] = "__pyx_result"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_PickleError[] = "PickleError"; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_max_gridsize[] = "max_gridsize"; +static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; +static const char __pyx_k_searchcoords[] = "searchcoords"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; +static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; +static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; +static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; +static const char __pyx_k_triclinic_vectors[] = "triclinic_vectors"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_pyx_unpickle_FastNS[] = "__pyx_unpickle_FastNS"; +static const char __pyx_k_strided_and_indirect[] = ""; +static const char __pyx_k_MDAnalysis_lib_nsgrid[] = "MDAnalysis.lib.nsgrid"; +static const char __pyx_k_contiguous_and_direct[] = ""; +static const char __pyx_k_MDAnalysis_lib_mdamath[] = "MDAnalysis.lib.mdamath"; +static const char __pyx_k_MemoryView_of_r_object[] = ""; +static const char __pyx_k_pyx_unpickle_NSResults[] = "__pyx_unpickle_NSResults"; +static const char __pyx_k_Cutoff_must_be_positive[] = "Cutoff must be positive!"; +static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; +static const char __pyx_k_contiguous_and_indirect[] = ""; +static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; +static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; +static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; +static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; +static const char __pyx_k_Box_must_be_a_x_matrix_Got_x[] = "Box must be a {} x {} matrix. Got: {} x {})"; +static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; +static const char __pyx_k_strided_and_direct_or_indirect[] = ""; +static const char __pyx_k_Neighbor_search_library_mod_MDA[] = "\nNeighbor search library --- :mod:`MDAnalysis.lib.nsgrid`\n========================================================\n\n\nAbout the code\n--------------\n\nThis Neighbor search library is a serialized Cython version greatly\ninspired by the NS grid search implemented in\n`GROMACS `_ .\n\nGROMACS 4.x code (more precisely\n`nsgrid.c `_\nand `ns.c `_ )\nwas used as reference to write this file.\n\nGROMACS 4.x code is released under the GNU Public Licence v2.\n\nAbout the algorithm\n-------------------\n\nThe neighbor search implemented here is based on\n`cell lists `_ which allow\ncomputation of pairs [#]_ with a cost of :math:`O(N)`, instead\nof :math:`O(N^2)`. The basic algorithm is described in\nAppendix F, Page 552 of\n``Understanding Molecular Dynamics: From Algorithm to Applications`` by Frenkel and Smit.\n\nIn brief, the algorithm divides the domain into smaller subdomains called `cells`\nand distributes every particle to these cells based on their positions. Subsequently,\nany distance based query first identifies the corresponding cell position in the\ndomain followed by distance evaluations within the identified cell and\nneighboring cells only. Care must be taken to ensure that `cellsize` is\ngreater than the desired search distance, otherwise all of the neighbours might\nnot reflect in the results.\n\n\n.. [#] a pair correspond to two particles that are considered as neighbors .\n\n\n.. versionadded:: 0.19.0\n"; +static const char __pyx_k_Pickling_of_struct_members_such[] = "Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)"; +static const char __pyx_k_coords_must_have_a_shape_of_n_3[] = "coords must have a shape of (n, 3), got {}."; +static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; +static const char __pyx_k_search_coords_must_have_a_shape[] = "search_coords must have a shape of (n, 3), got {}."; +static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static const char __pyx_k_Any_of_the_box_dimensions_cannot[] = "Any of the box dimensions cannot be 0"; +static const char __pyx_k_Box_does_not_correspond_to_PBC_x[] = "Box does not correspond to PBC=xyz"; +static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; +static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; +static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; +static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; +static const char __pyx_k_Could_not_allocate_memory_for_NS[] = "Could not allocate memory for NSGrid.beadids ({} bits requested)"; +static const char __pyx_k_Could_not_allocate_memory_from_N[] = "Could not allocate memory from NSGrid.nbeads ({} bits requested)"; +static const char __pyx_k_Cutoff_greater_than_maximum_cuto[] = "Cutoff greater than maximum cutoff ({:.3f}) given the PBC"; +static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; +static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; +static const char __pyx_k_Incompatible_checksums_s_vs_0x29[] = "Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; +static const char __pyx_k_Incompatible_checksums_s_vs_0xd3[] = "Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))"; +static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; +static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; +static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; +static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; +static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; +static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; +static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; +static const char __pyx_k_self_beadids_self_cellids_self_n[] = "self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling"; +static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; +static const char __pyx_k_Could_not_allocate_memory_from_N_2[] = "Could not allocate memory from NSGrid.cellids ({} bits requested)"; +static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_n_s_ASCII; +static PyObject *__pyx_kp_s_Any_of_the_box_dimensions_cannot; +static PyObject *__pyx_kp_s_Box_does_not_correspond_to_PBC_x; +static PyObject *__pyx_kp_s_Box_must_be_a_x_matrix_Got_x; +static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; +static PyObject *__pyx_n_s_C; +static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; +static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; +static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; +static PyObject *__pyx_kp_s_Cannot_index_with_type_s; +static PyObject *__pyx_kp_s_Could_not_allocate_memory_for_NS; +static PyObject *__pyx_kp_s_Could_not_allocate_memory_from_N; +static PyObject *__pyx_kp_s_Could_not_allocate_memory_from_N_2; +static PyObject *__pyx_kp_s_Cutoff_greater_than_maximum_cuto; +static PyObject *__pyx_kp_s_Cutoff_must_be_positive; +static PyObject *__pyx_n_s_Ellipsis; +static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; +static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x29; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; +static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd3; +static PyObject *__pyx_n_s_IndexError; +static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; +static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; +static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; +static PyObject *__pyx_n_s_MDAnalysis_lib_mdamath; +static PyObject *__pyx_n_s_MDAnalysis_lib_nsgrid; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; +static PyObject *__pyx_kp_s_MemoryView_of_r_object; +static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_b_O; +static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; +static PyObject *__pyx_n_s_PickleError; +static PyObject *__pyx_kp_s_Pickling_of_struct_members_such; +static PyObject *__pyx_n_s_RuntimeError; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_View_MemoryView; +static PyObject *__pyx_n_s_allclose; +static PyObject *__pyx_n_s_allocate_buffer; +static PyObject *__pyx_n_s_asarray; +static PyObject *__pyx_n_s_astype; +static PyObject *__pyx_n_s_base; +static PyObject *__pyx_n_s_box; +static PyObject *__pyx_n_s_c; +static PyObject *__pyx_n_u_c; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_kp_s_contiguous_and_direct; +static PyObject *__pyx_kp_s_contiguous_and_indirect; +static PyObject *__pyx_n_s_coords; +static PyObject *__pyx_kp_s_coords_must_have_a_shape_of_n_3; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_cutoff; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_dtype_is_object; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_enumerate; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_float32; +static PyObject *__pyx_n_s_force; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_fortran; +static PyObject *__pyx_n_u_fortran; +static PyObject *__pyx_n_s_getstate; +static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_int; +static PyObject *__pyx_n_s_int64; +static PyObject *__pyx_n_s_itemsize; +static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_max_gridsize; +static PyObject *__pyx_n_s_max_size; +static PyObject *__pyx_n_s_memview; +static PyObject *__pyx_n_s_mode; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_ncoords; +static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; +static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; +static PyObject *__pyx_n_s_ndim; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; +static PyObject *__pyx_n_s_np; +static PyObject *__pyx_n_s_numpy; +static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; +static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_order; +static PyObject *__pyx_n_s_pack; +static PyObject *__pyx_n_s_pbc; +static PyObject *__pyx_n_s_periodic; +static PyObject *__pyx_n_s_pickle; +static PyObject *__pyx_n_s_pyx_PickleError; +static PyObject *__pyx_n_s_pyx_checksum; +static PyObject *__pyx_n_s_pyx_getbuffer; +static PyObject *__pyx_n_s_pyx_result; +static PyObject *__pyx_n_s_pyx_state; +static PyObject *__pyx_n_s_pyx_type; +static PyObject *__pyx_n_s_pyx_unpickle_Enum; +static PyObject *__pyx_n_s_pyx_unpickle_FastNS; +static PyObject *__pyx_n_s_pyx_unpickle_NSResults; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_range; +static PyObject *__pyx_n_s_reduce; +static PyObject *__pyx_n_s_reduce_cython; +static PyObject *__pyx_n_s_reduce_ex; +static PyObject *__pyx_n_s_reshape; +static PyObject *__pyx_kp_s_search_coords_must_have_a_shape; +static PyObject *__pyx_n_s_searchcoords; +static PyObject *__pyx_kp_s_self_beadids_self_cellids_self_n; +static PyObject *__pyx_n_s_setstate; +static PyObject *__pyx_n_s_setstate_cython; +static PyObject *__pyx_n_s_shape; +static PyObject *__pyx_n_s_size; +static PyObject *__pyx_n_s_sqrt; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_step; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_strided_and_direct; +static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; +static PyObject *__pyx_kp_s_strided_and_indirect; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_struct; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_triclinic_vectors; +static PyObject *__pyx_kp_s_unable_to_allocate_array_data; +static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; +static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; +static PyObject *__pyx_n_s_unpack; +static PyObject *__pyx_n_s_update; +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_box, int __pyx_v_periodic); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_2update(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_box); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_cutoff, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_searchcoords); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_2get_pairs(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_4get_pair_distances(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_6get_indices(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_8get_distances(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_6cutoff___get__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_10__reduce_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_12__setstate_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, PyObject *__pyx_v_ncoords, PyObject *__pyx_v_cutoff, struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_box, PyObject *__pyx_v_max_size, PyObject *__pyx_v_force); /* proto */ +static void __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_2__dealloc__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_6cutoff___get__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_coords, PyObject *__pyx_v_box, PyObject *__pyx_v_max_gridsize, PyObject *__pyx_v_pbc); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_2search(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self, PyObject *__pyx_v_search_coords); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_4self_search(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_6cutoff___get__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_6__reduce_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_8__setstate_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_2__pyx_unpickle_FastNS(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_PBCBox(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_NSResults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_NSGrid(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_FastNS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_float_0_0; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_5000; +static PyObject *__pyx_int_43303570; +static PyObject *__pyx_int_184977713; +static PyObject *__pyx_int_221827040; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_slice__6; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_slice__35; +static PyObject *__pyx_slice__36; +static PyObject *__pyx_slice__37; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__46; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__48; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__50; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__51; +/* Late includes */ + +/* "MDAnalysis/lib/nsgrid.pyx":99 + * + * # Useful Functions + * cdef real rvec_norm2(const rvec a) nogil: # <<<<<<<<<<<<<< + * return a[XX]*a[XX] + a[YY]*a[YY] + a[ZZ]*a[ZZ] + * + */ + +static __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_f_10MDAnalysis_3lib_6nsgrid_rvec_norm2(__pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_a) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_r; + + /* "MDAnalysis/lib/nsgrid.pyx":100 + * # Useful Functions + * cdef real rvec_norm2(const rvec a) nogil: + * return a[XX]*a[XX] + a[YY]*a[YY] + a[ZZ]*a[ZZ] # <<<<<<<<<<<<<< + * + * cdef void rvec_clear(rvec a) nogil: + */ + __pyx_r = ((((__pyx_v_a[0]) * (__pyx_v_a[0])) + ((__pyx_v_a[1]) * (__pyx_v_a[1]))) + ((__pyx_v_a[2]) * (__pyx_v_a[2]))); + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":99 + * + * # Useful Functions + * cdef real rvec_norm2(const rvec a) nogil: # <<<<<<<<<<<<<< + * return a[XX]*a[XX] + a[YY]*a[YY] + a[ZZ]*a[ZZ] + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":102 + * return a[XX]*a[XX] + a[YY]*a[YY] + a[ZZ]*a[ZZ] + * + * cdef void rvec_clear(rvec a) nogil: # <<<<<<<<<<<<<< + * a[XX] = 0.0 + * a[YY] = 0.0 + */ + +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_rvec_clear(__pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_a) { + + /* "MDAnalysis/lib/nsgrid.pyx":103 + * + * cdef void rvec_clear(rvec a) nogil: + * a[XX] = 0.0 # <<<<<<<<<<<<<< + * a[YY] = 0.0 + * a[ZZ] = 0.0 + */ + (__pyx_v_a[0]) = 0.0; + + /* "MDAnalysis/lib/nsgrid.pyx":104 + * cdef void rvec_clear(rvec a) nogil: + * a[XX] = 0.0 + * a[YY] = 0.0 # <<<<<<<<<<<<<< + * a[ZZ] = 0.0 + * + */ + (__pyx_v_a[1]) = 0.0; + + /* "MDAnalysis/lib/nsgrid.pyx":105 + * a[XX] = 0.0 + * a[YY] = 0.0 + * a[ZZ] = 0.0 # <<<<<<<<<<<<<< + * + * ############################### + */ + (__pyx_v_a[2]) = 0.0; + + /* "MDAnalysis/lib/nsgrid.pyx":102 + * return a[XX]*a[XX] + a[YY]*a[YY] + a[ZZ]*a[ZZ] + * + * cdef void rvec_clear(rvec a) nogil: # <<<<<<<<<<<<<< + * a[XX] = 0.0 + * a[YY] = 0.0 + */ + + /* function exit code */ +} + +/* "MDAnalysis/lib/nsgrid.pyx":143 + * cdef bint periodic + * + * def __init__(self, real[:, ::1] box, bint periodic): # <<<<<<<<<<<<<< + * """ + * Parameters + */ + +/* Python wrapper */ +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__[] = "\n Parameters\n ----------\n box : numpy.ndarray\n box vectors of shape ``(3, 3)`` or\n as returned by ``MDAnalysis.lib.mdamath.triclinic_vectors``\n ``dtype`` must be ``numpy.float32``\n periodic : boolean\n ``True`` for PBC-aware calculations\n ``False`` for non PBC aware calculations\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__; +#endif +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __Pyx_memviewslice __pyx_v_box = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_v_periodic; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_box,&__pyx_n_s_periodic,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_periodic)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 143, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 143, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_box = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_box.memview)) __PYX_ERR(0, 143, __pyx_L3_error) + __pyx_v_periodic = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_periodic == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 143, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.PBCBox.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self), __pyx_v_box, __pyx_v_periodic); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_box, int __pyx_v_periodic) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":156 + * """ + * + * self.periodic = periodic # <<<<<<<<<<<<<< + * self.update(box) + * + */ + __pyx_v_self->periodic = __pyx_v_periodic; + + /* "MDAnalysis/lib/nsgrid.pyx":157 + * + * self.periodic = periodic + * self.update(box) # <<<<<<<<<<<<<< + * + * cdef void fast_update(self, real[:, ::1] box) nogil: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_box, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":143 + * cdef bint periodic + * + * def __init__(self, real[:, ::1] box, bint periodic): # <<<<<<<<<<<<<< + * """ + * Parameters + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.PBCBox.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_box, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":159 + * self.update(box) + * + * cdef void fast_update(self, real[:, ::1] box) nogil: # <<<<<<<<<<<<<< + * """ + * Updates the internal box parameters for + */ + +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_update(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_box) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_j; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_min_hv2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_min_ss; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_tmp; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_1; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + Py_ssize_t __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + double __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + double __pyx_t_15; + double __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_30; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_31; + Py_ssize_t __pyx_t_32; + Py_ssize_t __pyx_t_33; + + /* "MDAnalysis/lib/nsgrid.pyx":171 + * + * # Update matrix + * self.is_triclinic = False # <<<<<<<<<<<<<< + * for i in range(DIM): + * for j in range(DIM): + */ + __pyx_v_self->is_triclinic = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":172 + * # Update matrix + * self.is_triclinic = False + * for i in range(DIM): # <<<<<<<<<<<<<< + * for j in range(DIM): + * self.c_pbcbox.box[i][j] = box[i, j] + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":173 + * self.is_triclinic = False + * for i in range(DIM): + * for j in range(DIM): # <<<<<<<<<<<<<< + * self.c_pbcbox.box[i][j] = box[i, j] + * + */ + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_j = __pyx_t_2; + + /* "MDAnalysis/lib/nsgrid.pyx":174 + * for i in range(DIM): + * for j in range(DIM): + * self.c_pbcbox.box[i][j] = box[i, j] # <<<<<<<<<<<<<< + * + * if i != j: + */ + __pyx_t_3 = __pyx_v_i; + __pyx_t_4 = __pyx_v_j; + if (__pyx_t_3 < 0) __pyx_t_3 += __pyx_v_box.shape[0]; + if (__pyx_t_4 < 0) __pyx_t_4 += __pyx_v_box.shape[1]; + ((__pyx_v_self->c_pbcbox.box[__pyx_v_i])[__pyx_v_j]) = (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_3 * __pyx_v_box.strides[0]) )) + __pyx_t_4)) ))); + + /* "MDAnalysis/lib/nsgrid.pyx":176 + * self.c_pbcbox.box[i][j] = box[i, j] + * + * if i != j: # <<<<<<<<<<<<<< + * if box[i, j] > EPSILON: + * self.is_triclinic = True + */ + __pyx_t_5 = ((__pyx_v_i != __pyx_v_j) != 0); + if (__pyx_t_5) { + + /* "MDAnalysis/lib/nsgrid.pyx":177 + * + * if i != j: + * if box[i, j] > EPSILON: # <<<<<<<<<<<<<< + * self.is_triclinic = True + * + */ + __pyx_t_6 = __pyx_v_i; + __pyx_t_7 = __pyx_v_j; + if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_v_box.shape[0]; + if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_box.shape[1]; + __pyx_t_5 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_6 * __pyx_v_box.strides[0]) )) + __pyx_t_7)) ))) > 1e-05) != 0); + if (__pyx_t_5) { + + /* "MDAnalysis/lib/nsgrid.pyx":178 + * if i != j: + * if box[i, j] > EPSILON: + * self.is_triclinic = True # <<<<<<<<<<<<<< + * + * # Update diagonals + */ + __pyx_v_self->is_triclinic = 1; + + /* "MDAnalysis/lib/nsgrid.pyx":177 + * + * if i != j: + * if box[i, j] > EPSILON: # <<<<<<<<<<<<<< + * self.is_triclinic = True + * + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":176 + * self.c_pbcbox.box[i][j] = box[i, j] + * + * if i != j: # <<<<<<<<<<<<<< + * if box[i, j] > EPSILON: + * self.is_triclinic = True + */ + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":181 + * + * # Update diagonals + * for i in range(DIM): # <<<<<<<<<<<<<< + * self.c_pbcbox.fbox_diag[i] = box[i, i] + * self.c_pbcbox.hbox_diag[i] = self.c_pbcbox.fbox_diag[i] * 0.5 + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":182 + * # Update diagonals + * for i in range(DIM): + * self.c_pbcbox.fbox_diag[i] = box[i, i] # <<<<<<<<<<<<<< + * self.c_pbcbox.hbox_diag[i] = self.c_pbcbox.fbox_diag[i] * 0.5 + * self.c_pbcbox.mhbox_diag[i] = - self.c_pbcbox.hbox_diag[i] + */ + __pyx_t_8 = __pyx_v_i; + __pyx_t_9 = __pyx_v_i; + if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_box.shape[0]; + if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_box.shape[1]; + (__pyx_v_self->c_pbcbox.fbox_diag[__pyx_v_i]) = (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_8 * __pyx_v_box.strides[0]) )) + __pyx_t_9)) ))); + + /* "MDAnalysis/lib/nsgrid.pyx":183 + * for i in range(DIM): + * self.c_pbcbox.fbox_diag[i] = box[i, i] + * self.c_pbcbox.hbox_diag[i] = self.c_pbcbox.fbox_diag[i] * 0.5 # <<<<<<<<<<<<<< + * self.c_pbcbox.mhbox_diag[i] = - self.c_pbcbox.hbox_diag[i] + * + */ + (__pyx_v_self->c_pbcbox.hbox_diag[__pyx_v_i]) = ((__pyx_v_self->c_pbcbox.fbox_diag[__pyx_v_i]) * 0.5); + + /* "MDAnalysis/lib/nsgrid.pyx":184 + * self.c_pbcbox.fbox_diag[i] = box[i, i] + * self.c_pbcbox.hbox_diag[i] = self.c_pbcbox.fbox_diag[i] * 0.5 + * self.c_pbcbox.mhbox_diag[i] = - self.c_pbcbox.hbox_diag[i] # <<<<<<<<<<<<<< + * + * # Update maximum cutoff + */ + (__pyx_v_self->c_pbcbox.mhbox_diag[__pyx_v_i]) = (-(__pyx_v_self->c_pbcbox.hbox_diag[__pyx_v_i])); + } + + /* "MDAnalysis/lib/nsgrid.pyx":190 + * # Physical limitation of the cut-off + * # by half the length of the shortest box vector. + * min_hv2 = min(0.25 * rvec_norm2(&box[XX, XX]), 0.25 * rvec_norm2(&box[YY, XX])) # <<<<<<<<<<<<<< + * min_hv2 = min(min_hv2, 0.25 * rvec_norm2(&box[ZZ, XX])) + * + */ + __pyx_t_10 = 1; + __pyx_t_11 = 0; + if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_box.shape[0]; + if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_box.shape[1]; + __pyx_t_12 = (0.25 * __pyx_f_10MDAnalysis_3lib_6nsgrid_rvec_norm2((&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_10 * __pyx_v_box.strides[0]) )) + __pyx_t_11)) )))))); + __pyx_t_13 = 0; + __pyx_t_14 = 0; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_box.shape[0]; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_box.shape[1]; + __pyx_t_15 = (0.25 * __pyx_f_10MDAnalysis_3lib_6nsgrid_rvec_norm2((&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_13 * __pyx_v_box.strides[0]) )) + __pyx_t_14)) )))))); + if (((__pyx_t_12 < __pyx_t_15) != 0)) { + __pyx_t_16 = __pyx_t_12; + } else { + __pyx_t_16 = __pyx_t_15; + } + __pyx_v_min_hv2 = __pyx_t_16; + + /* "MDAnalysis/lib/nsgrid.pyx":191 + * # by half the length of the shortest box vector. + * min_hv2 = min(0.25 * rvec_norm2(&box[XX, XX]), 0.25 * rvec_norm2(&box[YY, XX])) + * min_hv2 = min(min_hv2, 0.25 * rvec_norm2(&box[ZZ, XX])) # <<<<<<<<<<<<<< + * + * # Limitation to the smallest diagonal element due to optimizations: + */ + __pyx_t_17 = 2; + __pyx_t_18 = 0; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_box.shape[0]; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_box.shape[1]; + __pyx_t_16 = (0.25 * __pyx_f_10MDAnalysis_3lib_6nsgrid_rvec_norm2((&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_17 * __pyx_v_box.strides[0]) )) + __pyx_t_18)) )))))); + __pyx_t_19 = __pyx_v_min_hv2; + if (((__pyx_t_16 < __pyx_t_19) != 0)) { + __pyx_t_12 = __pyx_t_16; + } else { + __pyx_t_12 = __pyx_t_19; + } + __pyx_v_min_hv2 = __pyx_t_12; + + /* "MDAnalysis/lib/nsgrid.pyx":197 + * # in the grid search and pbc_dx is a lot faster + * # than checking all possible combinations. + * tmp = box[YY, YY] # <<<<<<<<<<<<<< + * if box[ZZ, YY] < 0: + * tmp -= box[ZZ, YY] + */ + __pyx_t_20 = 1; + __pyx_t_21 = 1; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_box.shape[0]; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_box.shape[1]; + __pyx_v_tmp = (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_20 * __pyx_v_box.strides[0]) )) + __pyx_t_21)) ))); + + /* "MDAnalysis/lib/nsgrid.pyx":198 + * # than checking all possible combinations. + * tmp = box[YY, YY] + * if box[ZZ, YY] < 0: # <<<<<<<<<<<<<< + * tmp -= box[ZZ, YY] + * else: + */ + __pyx_t_22 = 2; + __pyx_t_23 = 1; + if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_box.shape[0]; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_box.shape[1]; + __pyx_t_5 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_22 * __pyx_v_box.strides[0]) )) + __pyx_t_23)) ))) < 0.0) != 0); + if (__pyx_t_5) { + + /* "MDAnalysis/lib/nsgrid.pyx":199 + * tmp = box[YY, YY] + * if box[ZZ, YY] < 0: + * tmp -= box[ZZ, YY] # <<<<<<<<<<<<<< + * else: + * tmp += box[ZZ, YY] + */ + __pyx_t_24 = 2; + __pyx_t_25 = 1; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_box.shape[0]; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_box.shape[1]; + __pyx_v_tmp = (__pyx_v_tmp - (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_24 * __pyx_v_box.strides[0]) )) + __pyx_t_25)) )))); + + /* "MDAnalysis/lib/nsgrid.pyx":198 + * # than checking all possible combinations. + * tmp = box[YY, YY] + * if box[ZZ, YY] < 0: # <<<<<<<<<<<<<< + * tmp -= box[ZZ, YY] + * else: + */ + goto __pyx_L11; + } + + /* "MDAnalysis/lib/nsgrid.pyx":201 + * tmp -= box[ZZ, YY] + * else: + * tmp += box[ZZ, YY] # <<<<<<<<<<<<<< + * + * min_ss = min(box[XX, XX], min(tmp, box[ZZ, ZZ])) + */ + /*else*/ { + __pyx_t_26 = 2; + __pyx_t_27 = 1; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_box.shape[0]; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_box.shape[1]; + __pyx_v_tmp = (__pyx_v_tmp + (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_26 * __pyx_v_box.strides[0]) )) + __pyx_t_27)) )))); + } + __pyx_L11:; + + /* "MDAnalysis/lib/nsgrid.pyx":203 + * tmp += box[ZZ, YY] + * + * min_ss = min(box[XX, XX], min(tmp, box[ZZ, ZZ])) # <<<<<<<<<<<<<< + * self.c_pbcbox.max_cutoff2 = min(min_hv2, min_ss * min_ss) + * + */ + __pyx_t_28 = 2; + __pyx_t_29 = 2; + if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_v_box.shape[0]; + if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_v_box.shape[1]; + __pyx_t_19 = (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_28 * __pyx_v_box.strides[0]) )) + __pyx_t_29)) ))); + __pyx_t_30 = __pyx_v_tmp; + if (((__pyx_t_19 < __pyx_t_30) != 0)) { + __pyx_t_31 = __pyx_t_19; + } else { + __pyx_t_31 = __pyx_t_30; + } + __pyx_t_19 = __pyx_t_31; + __pyx_t_32 = 0; + __pyx_t_33 = 0; + if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_v_box.shape[0]; + if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_v_box.shape[1]; + __pyx_t_31 = (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_32 * __pyx_v_box.strides[0]) )) + __pyx_t_33)) ))); + if (((__pyx_t_19 < __pyx_t_31) != 0)) { + __pyx_t_30 = __pyx_t_19; + } else { + __pyx_t_30 = __pyx_t_31; + } + __pyx_v_min_ss = __pyx_t_30; + + /* "MDAnalysis/lib/nsgrid.pyx":204 + * + * min_ss = min(box[XX, XX], min(tmp, box[ZZ, ZZ])) + * self.c_pbcbox.max_cutoff2 = min(min_hv2, min_ss * min_ss) # <<<<<<<<<<<<<< + * + * def update(self, real[:, ::1] box): + */ + __pyx_t_30 = (__pyx_v_min_ss * __pyx_v_min_ss); + __pyx_t_19 = __pyx_v_min_hv2; + if (((__pyx_t_30 < __pyx_t_19) != 0)) { + __pyx_t_31 = __pyx_t_30; + } else { + __pyx_t_31 = __pyx_t_19; + } + __pyx_v_self->c_pbcbox.max_cutoff2 = __pyx_t_31; + + /* "MDAnalysis/lib/nsgrid.pyx":159 + * self.update(box) + * + * cdef void fast_update(self, real[:, ::1] box) nogil: # <<<<<<<<<<<<<< + * """ + * Updates the internal box parameters for + */ + + /* function exit code */ +} + +/* "MDAnalysis/lib/nsgrid.pyx":206 + * self.c_pbcbox.max_cutoff2 = min(min_hv2, min_ss * min_ss) + * + * def update(self, real[:, ::1] box): # <<<<<<<<<<<<<< + * """ + * Updates internal MD box representation and parameters used for calculations. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_3update(PyObject *__pyx_v_self, PyObject *__pyx_arg_box); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox_2update[] = "PBCBox.update(self, __Pyx_memviewslice box)\n\n Updates internal MD box representation and parameters used for calculations.\n\n Parameters\n ----------\n box : numpy.ndarray\n Describes the MD box vectors as returned by\n :func:`MDAnalysis.lib.mdamath.triclinic_vectors`.\n `dtype` must be :class:`numpy.float32`\n\n Note\n ----\n Call to this method is only needed when the MD box is changed\n as it always called when class is instantiated.\n\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_3update(PyObject *__pyx_v_self, PyObject *__pyx_arg_box) { + __Pyx_memviewslice __pyx_v_box = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("update (wrapper)", 0); + assert(__pyx_arg_box); { + __pyx_v_box = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_arg_box, PyBUF_WRITABLE); if (unlikely(!__pyx_v_box.memview)) __PYX_ERR(0, 206, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.PBCBox.update", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_2update(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self), __pyx_v_box); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_2update(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_box) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + __Pyx_RefNannySetupContext("update", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":224 + * """ + * + * if box.shape[0] != DIM or box.shape[1] != DIM: # <<<<<<<<<<<<<< + * raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( + * DIM, DIM, box.shape[0], box.shape[1])) + */ + __pyx_t_2 = (((__pyx_v_box.shape[0]) != 3) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_box.shape[1]) != 3) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "MDAnalysis/lib/nsgrid.pyx":225 + * + * if box.shape[0] != DIM or box.shape[1] != DIM: + * raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( # <<<<<<<<<<<<<< + * DIM, DIM, box.shape[0], box.shape[1])) + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Box_must_be_a_x_matrix_Got_x, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "MDAnalysis/lib/nsgrid.pyx":226 + * if box.shape[0] != DIM or box.shape[1] != DIM: + * raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( + * DIM, DIM, box.shape[0], box.shape[1])) # <<<<<<<<<<<<<< + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): + * raise ValueError("Box does not correspond to PBC=xyz") + */ + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_box.shape[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_box.shape[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_int_3, __pyx_int_3, __pyx_t_5, __pyx_t_6}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_int_3, __pyx_int_3, __pyx_t_5, __pyx_t_6}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_int_3); + __Pyx_INCREF(__pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_int_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_6); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":225 + * + * if box.shape[0] != DIM or box.shape[1] != DIM: + * raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( # <<<<<<<<<<<<<< + * DIM, DIM, box.shape[0], box.shape[1])) + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 225, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":224 + * """ + * + * if box.shape[0] != DIM or box.shape[1] != DIM: # <<<<<<<<<<<<<< + * raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( + * DIM, DIM, box.shape[0], box.shape[1])) + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":227 + * raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( + * DIM, DIM, box.shape[0], box.shape[1])) + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): # <<<<<<<<<<<<<< + * raise ValueError("Box does not correspond to PBC=xyz") + * self.fast_update(box) + */ + __pyx_t_10 = 0; + __pyx_t_11 = 0; + if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_box.shape[0]; + if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_box.shape[1]; + __pyx_t_2 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_10 * __pyx_v_box.strides[0]) )) + __pyx_t_11)) ))) == 0.0) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_12 = 1; + __pyx_t_13 = 1; + if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_box.shape[0]; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_box.shape[1]; + __pyx_t_2 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_12 * __pyx_v_box.strides[0]) )) + __pyx_t_13)) ))) == 0.0) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_14 = 2; + __pyx_t_15 = 2; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_box.shape[0]; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_box.shape[1]; + __pyx_t_2 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_box.data + __pyx_t_14 * __pyx_v_box.strides[0]) )) + __pyx_t_15)) ))) == 0.0) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "MDAnalysis/lib/nsgrid.pyx":228 + * DIM, DIM, box.shape[0], box.shape[1])) + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): + * raise ValueError("Box does not correspond to PBC=xyz") # <<<<<<<<<<<<<< + * self.fast_update(box) + * + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 228, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":227 + * raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( + * DIM, DIM, box.shape[0], box.shape[1])) + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): # <<<<<<<<<<<<<< + * raise ValueError("Box does not correspond to PBC=xyz") + * self.fast_update(box) + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":229 + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): + * raise ValueError("Box does not correspond to PBC=xyz") + * self.fast_update(box) # <<<<<<<<<<<<<< + * + * cdef void fast_pbc_dx(self, rvec ref, rvec other, rvec dx) nogil: + */ + ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self->__pyx_vtab)->fast_update(__pyx_v_self, __pyx_v_box); + + /* "MDAnalysis/lib/nsgrid.pyx":206 + * self.c_pbcbox.max_cutoff2 = min(min_hv2, min_ss * min_ss) + * + * def update(self, real[:, ::1] box): # <<<<<<<<<<<<<< + * """ + * Updates internal MD box representation and parameters used for calculations. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.PBCBox.update", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_box, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":231 + * self.fast_update(box) + * + * cdef void fast_pbc_dx(self, rvec ref, rvec other, rvec dx) nogil: # <<<<<<<<<<<<<< + * """Dislacement between two points for both + * PBC and non-PBC conditions + */ + +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_pbc_dx(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_ref, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_other, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_dx) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_j; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_1; + int __pyx_t_2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_3; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_4; + + /* "MDAnalysis/lib/nsgrid.pyx":244 + * cdef ns_int i, j + * + * for i in range(DIM): # <<<<<<<<<<<<<< + * dx[i] = other[i] - ref[i] + * + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":245 + * + * for i in range(DIM): + * dx[i] = other[i] - ref[i] # <<<<<<<<<<<<<< + * + * if self.periodic: + */ + (__pyx_v_dx[__pyx_v_i]) = ((__pyx_v_other[__pyx_v_i]) - (__pyx_v_ref[__pyx_v_i])); + } + + /* "MDAnalysis/lib/nsgrid.pyx":247 + * dx[i] = other[i] - ref[i] + * + * if self.periodic: # <<<<<<<<<<<<<< + * for i in range(DIM-1, -1, -1): + * while dx[i] > self.c_pbcbox.hbox_diag[i]: + */ + __pyx_t_2 = (__pyx_v_self->periodic != 0); + if (__pyx_t_2) { + + /* "MDAnalysis/lib/nsgrid.pyx":248 + * + * if self.periodic: + * for i in range(DIM-1, -1, -1): # <<<<<<<<<<<<<< + * while dx[i] > self.c_pbcbox.hbox_diag[i]: + * for j in range(i, -1, -1): + */ + for (__pyx_t_1 = 2; __pyx_t_1 > -1L; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":249 + * if self.periodic: + * for i in range(DIM-1, -1, -1): + * while dx[i] > self.c_pbcbox.hbox_diag[i]: # <<<<<<<<<<<<<< + * for j in range(i, -1, -1): + * dx[j] -= self.c_pbcbox.box[i][j] + */ + while (1) { + __pyx_t_2 = (((__pyx_v_dx[__pyx_v_i]) > (__pyx_v_self->c_pbcbox.hbox_diag[__pyx_v_i])) != 0); + if (!__pyx_t_2) break; + + /* "MDAnalysis/lib/nsgrid.pyx":250 + * for i in range(DIM-1, -1, -1): + * while dx[i] > self.c_pbcbox.hbox_diag[i]: + * for j in range(i, -1, -1): # <<<<<<<<<<<<<< + * dx[j] -= self.c_pbcbox.box[i][j] + * + */ + for (__pyx_t_3 = __pyx_v_i; __pyx_t_3 > -1L; __pyx_t_3-=1) { + __pyx_v_j = __pyx_t_3; + + /* "MDAnalysis/lib/nsgrid.pyx":251 + * while dx[i] > self.c_pbcbox.hbox_diag[i]: + * for j in range(i, -1, -1): + * dx[j] -= self.c_pbcbox.box[i][j] # <<<<<<<<<<<<<< + * + * while dx[i] <= self.c_pbcbox.mhbox_diag[i]: + */ + __pyx_t_4 = __pyx_v_j; + (__pyx_v_dx[__pyx_t_4]) = ((__pyx_v_dx[__pyx_t_4]) - ((__pyx_v_self->c_pbcbox.box[__pyx_v_i])[__pyx_v_j])); + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":253 + * dx[j] -= self.c_pbcbox.box[i][j] + * + * while dx[i] <= self.c_pbcbox.mhbox_diag[i]: # <<<<<<<<<<<<<< + * for j in range(i, -1, -1): + * dx[j] += self.c_pbcbox.box[i][j] + */ + while (1) { + __pyx_t_2 = (((__pyx_v_dx[__pyx_v_i]) <= (__pyx_v_self->c_pbcbox.mhbox_diag[__pyx_v_i])) != 0); + if (!__pyx_t_2) break; + + /* "MDAnalysis/lib/nsgrid.pyx":254 + * + * while dx[i] <= self.c_pbcbox.mhbox_diag[i]: + * for j in range(i, -1, -1): # <<<<<<<<<<<<<< + * dx[j] += self.c_pbcbox.box[i][j] + * + */ + for (__pyx_t_3 = __pyx_v_i; __pyx_t_3 > -1L; __pyx_t_3-=1) { + __pyx_v_j = __pyx_t_3; + + /* "MDAnalysis/lib/nsgrid.pyx":255 + * while dx[i] <= self.c_pbcbox.mhbox_diag[i]: + * for j in range(i, -1, -1): + * dx[j] += self.c_pbcbox.box[i][j] # <<<<<<<<<<<<<< + * + * cdef real fast_distance2(self, rvec a, rvec b) nogil: + */ + __pyx_t_4 = __pyx_v_j; + (__pyx_v_dx[__pyx_t_4]) = ((__pyx_v_dx[__pyx_t_4]) + ((__pyx_v_self->c_pbcbox.box[__pyx_v_i])[__pyx_v_j])); + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":247 + * dx[i] = other[i] - ref[i] + * + * if self.periodic: # <<<<<<<<<<<<<< + * for i in range(DIM-1, -1, -1): + * while dx[i] > self.c_pbcbox.hbox_diag[i]: + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":231 + * self.fast_update(box) + * + * cdef void fast_pbc_dx(self, rvec ref, rvec other, rvec dx) nogil: # <<<<<<<<<<<<<< + * """Dislacement between two points for both + * PBC and non-PBC conditions + */ + + /* function exit code */ +} + +/* "MDAnalysis/lib/nsgrid.pyx":257 + * dx[j] += self.c_pbcbox.box[i][j] + * + * cdef real fast_distance2(self, rvec a, rvec b) nogil: # <<<<<<<<<<<<<< + * """Distance calculation between two points + * for both PBC and non-PBC aware calculations + */ + +static __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_distance2(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_a, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_b) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_rvec __pyx_v_dx; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_r; + + /* "MDAnalysis/lib/nsgrid.pyx":267 + * + * cdef rvec dx + * self.fast_pbc_dx(a, b, dx) # <<<<<<<<<<<<<< + * return rvec_norm2(dx) + * + */ + ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self->__pyx_vtab)->fast_pbc_dx(__pyx_v_self, __pyx_v_a, __pyx_v_b, __pyx_v_dx); + + /* "MDAnalysis/lib/nsgrid.pyx":268 + * cdef rvec dx + * self.fast_pbc_dx(a, b, dx) + * return rvec_norm2(dx) # <<<<<<<<<<<<<< + * + * cdef real[:, ::1]fast_put_atoms_in_bbox(self, real[:, ::1] coords) nogil: + */ + __pyx_r = __pyx_f_10MDAnalysis_3lib_6nsgrid_rvec_norm2(__pyx_v_dx); + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":257 + * dx[j] += self.c_pbcbox.box[i][j] + * + * cdef real fast_distance2(self, rvec a, rvec b) nogil: # <<<<<<<<<<<<<< + * """Distance calculation between two points + * for both PBC and non-PBC aware calculations + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":270 + * return rvec_norm2(dx) + * + * cdef real[:, ::1]fast_put_atoms_in_bbox(self, real[:, ::1] coords) nogil: # <<<<<<<<<<<<<< + * """Shifts all ``coords`` to an orthogonal brick shaped box + * + */ + +static __Pyx_memviewslice __pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_put_atoms_in_bbox(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, __Pyx_memviewslice __pyx_v_coords) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_m; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_d; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_natoms; + __Pyx_memviewslice __pyx_v_bbox_coords = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_r = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_t_2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_3; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_4; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_5; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_9; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_10; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + Py_ssize_t __pyx_t_21; + Py_ssize_t __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("fast_put_atoms_in_bbox", 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + + /* "MDAnalysis/lib/nsgrid.pyx":271 + * + * cdef real[:, ::1]fast_put_atoms_in_bbox(self, real[:, ::1] coords) nogil: + * """Shifts all ``coords`` to an orthogonal brick shaped box # <<<<<<<<<<<<<< + * + * All the coordinates are brought into an orthogonal + */ + /*try:*/ { + + /* "MDAnalysis/lib/nsgrid.pyx":282 + * cdef real[:, ::1] bbox_coords + * + * natoms = coords.shape[0] # <<<<<<<<<<<<<< + * with gil: + * bbox_coords = coords.copy() + */ + __pyx_v_natoms = (__pyx_v_coords.shape[0]); + + /* "MDAnalysis/lib/nsgrid.pyx":283 + * + * natoms = coords.shape[0] + * with gil: # <<<<<<<<<<<<<< + * bbox_coords = coords.copy() + * + */ + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + /*try:*/ { + + /* "MDAnalysis/lib/nsgrid.pyx":284 + * natoms = coords.shape[0] + * with gil: + * bbox_coords = coords.copy() # <<<<<<<<<<<<<< + * + * if self.periodic: + */ + __pyx_t_1 = __pyx_memoryview_copy_slice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real_c(__pyx_v_coords); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 284, __pyx_L7_error) + __pyx_v_bbox_coords = __pyx_t_1; + __pyx_t_1.memview = NULL; + __pyx_t_1.data = NULL; + } + + /* "MDAnalysis/lib/nsgrid.pyx":283 + * + * natoms = coords.shape[0] + * with gil: # <<<<<<<<<<<<<< + * bbox_coords = coords.copy() + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L8; + } + __pyx_L7_error: { + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + goto __pyx_L4_error; + } + __pyx_L8:; + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":286 + * bbox_coords = coords.copy() + * + * if self.periodic: # <<<<<<<<<<<<<< + * if self.is_triclinic: + * for i in range(natoms): + */ + __pyx_t_2 = (__pyx_v_self->periodic != 0); + if (__pyx_t_2) { + + /* "MDAnalysis/lib/nsgrid.pyx":287 + * + * if self.periodic: + * if self.is_triclinic: # <<<<<<<<<<<<<< + * for i in range(natoms): + * for m in range(DIM - 1, -1, -1): + */ + __pyx_t_2 = (__pyx_v_self->is_triclinic != 0); + if (__pyx_t_2) { + + /* "MDAnalysis/lib/nsgrid.pyx":288 + * if self.periodic: + * if self.is_triclinic: + * for i in range(natoms): # <<<<<<<<<<<<<< + * for m in range(DIM - 1, -1, -1): + * while bbox_coords[i, m] < 0: + */ + __pyx_t_3 = __pyx_v_natoms; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "MDAnalysis/lib/nsgrid.pyx":289 + * if self.is_triclinic: + * for i in range(natoms): + * for m in range(DIM - 1, -1, -1): # <<<<<<<<<<<<<< + * while bbox_coords[i, m] < 0: + * for d in range(m+1): + */ + for (__pyx_t_6 = 2; __pyx_t_6 > -1L; __pyx_t_6-=1) { + __pyx_v_m = __pyx_t_6; + + /* "MDAnalysis/lib/nsgrid.pyx":290 + * for i in range(natoms): + * for m in range(DIM - 1, -1, -1): + * while bbox_coords[i, m] < 0: # <<<<<<<<<<<<<< + * for d in range(m+1): + * bbox_coords[i, d] += self.c_pbcbox.box[m][d] + */ + while (1) { + __pyx_t_7 = __pyx_v_i; + __pyx_t_8 = __pyx_v_m; + if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_bbox_coords.shape[1]; + __pyx_t_2 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_7 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_8)) ))) < 0.0) != 0); + if (!__pyx_t_2) break; + + /* "MDAnalysis/lib/nsgrid.pyx":291 + * for m in range(DIM - 1, -1, -1): + * while bbox_coords[i, m] < 0: + * for d in range(m+1): # <<<<<<<<<<<<<< + * bbox_coords[i, d] += self.c_pbcbox.box[m][d] + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + */ + __pyx_t_9 = (__pyx_v_m + 1); + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_d = __pyx_t_11; + + /* "MDAnalysis/lib/nsgrid.pyx":292 + * while bbox_coords[i, m] < 0: + * for d in range(m+1): + * bbox_coords[i, d] += self.c_pbcbox.box[m][d] # <<<<<<<<<<<<<< + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + * for d in range(m+1): + */ + __pyx_t_12 = __pyx_v_i; + __pyx_t_13 = __pyx_v_d; + if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_bbox_coords.shape[1]; + *((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_12 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_13)) )) += ((__pyx_v_self->c_pbcbox.box[__pyx_v_m])[__pyx_v_d]); + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":293 + * for d in range(m+1): + * bbox_coords[i, d] += self.c_pbcbox.box[m][d] + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * for d in range(m+1): + * bbox_coords[i, d] -= self.c_pbcbox.box[m][d] + */ + while (1) { + __pyx_t_14 = __pyx_v_i; + __pyx_t_15 = __pyx_v_m; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_bbox_coords.shape[1]; + __pyx_t_2 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_14 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_15)) ))) >= ((__pyx_v_self->c_pbcbox.box[__pyx_v_m])[__pyx_v_m])) != 0); + if (!__pyx_t_2) break; + + /* "MDAnalysis/lib/nsgrid.pyx":294 + * bbox_coords[i, d] += self.c_pbcbox.box[m][d] + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + * for d in range(m+1): # <<<<<<<<<<<<<< + * bbox_coords[i, d] -= self.c_pbcbox.box[m][d] + * else: + */ + __pyx_t_9 = (__pyx_v_m + 1); + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_d = __pyx_t_11; + + /* "MDAnalysis/lib/nsgrid.pyx":295 + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + * for d in range(m+1): + * bbox_coords[i, d] -= self.c_pbcbox.box[m][d] # <<<<<<<<<<<<<< + * else: + * for i in range(natoms): + */ + __pyx_t_16 = __pyx_v_i; + __pyx_t_17 = __pyx_v_d; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_bbox_coords.shape[1]; + *((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_16 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_17)) )) -= ((__pyx_v_self->c_pbcbox.box[__pyx_v_m])[__pyx_v_d]); + } + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":287 + * + * if self.periodic: + * if self.is_triclinic: # <<<<<<<<<<<<<< + * for i in range(natoms): + * for m in range(DIM - 1, -1, -1): + */ + goto __pyx_L10; + } + + /* "MDAnalysis/lib/nsgrid.pyx":297 + * bbox_coords[i, d] -= self.c_pbcbox.box[m][d] + * else: + * for i in range(natoms): # <<<<<<<<<<<<<< + * for m in range(DIM): + * while bbox_coords[i, m] < 0: + */ + /*else*/ { + __pyx_t_3 = __pyx_v_natoms; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "MDAnalysis/lib/nsgrid.pyx":298 + * else: + * for i in range(natoms): + * for m in range(DIM): # <<<<<<<<<<<<<< + * while bbox_coords[i, m] < 0: + * bbox_coords[i, m] += self.c_pbcbox.box[m][m] + */ + for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) { + __pyx_v_m = __pyx_t_6; + + /* "MDAnalysis/lib/nsgrid.pyx":299 + * for i in range(natoms): + * for m in range(DIM): + * while bbox_coords[i, m] < 0: # <<<<<<<<<<<<<< + * bbox_coords[i, m] += self.c_pbcbox.box[m][m] + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + */ + while (1) { + __pyx_t_18 = __pyx_v_i; + __pyx_t_19 = __pyx_v_m; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_bbox_coords.shape[1]; + __pyx_t_2 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_18 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_19)) ))) < 0.0) != 0); + if (!__pyx_t_2) break; + + /* "MDAnalysis/lib/nsgrid.pyx":300 + * for m in range(DIM): + * while bbox_coords[i, m] < 0: + * bbox_coords[i, m] += self.c_pbcbox.box[m][m] # <<<<<<<<<<<<<< + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + * bbox_coords[i, m] -= self.c_pbcbox.box[m][m] + */ + __pyx_t_20 = __pyx_v_i; + __pyx_t_21 = __pyx_v_m; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_v_bbox_coords.shape[1]; + *((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_20 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_21)) )) += ((__pyx_v_self->c_pbcbox.box[__pyx_v_m])[__pyx_v_m]); + } + + /* "MDAnalysis/lib/nsgrid.pyx":301 + * while bbox_coords[i, m] < 0: + * bbox_coords[i, m] += self.c_pbcbox.box[m][m] + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * bbox_coords[i, m] -= self.c_pbcbox.box[m][m] + * + */ + while (1) { + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = __pyx_v_m; + if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_bbox_coords.shape[1]; + __pyx_t_2 = (((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_22 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_23)) ))) >= ((__pyx_v_self->c_pbcbox.box[__pyx_v_m])[__pyx_v_m])) != 0); + if (!__pyx_t_2) break; + + /* "MDAnalysis/lib/nsgrid.pyx":302 + * bbox_coords[i, m] += self.c_pbcbox.box[m][m] + * while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + * bbox_coords[i, m] -= self.c_pbcbox.box[m][m] # <<<<<<<<<<<<<< + * + * return bbox_coords + */ + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = __pyx_v_m; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_bbox_coords.shape[0]; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_bbox_coords.shape[1]; + *((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_bbox_coords.data + __pyx_t_24 * __pyx_v_bbox_coords.strides[0]) )) + __pyx_t_25)) )) -= ((__pyx_v_self->c_pbcbox.box[__pyx_v_m])[__pyx_v_m]); + } + } + } + } + __pyx_L10:; + + /* "MDAnalysis/lib/nsgrid.pyx":286 + * bbox_coords = coords.copy() + * + * if self.periodic: # <<<<<<<<<<<<<< + * if self.is_triclinic: + * for i in range(natoms): + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":304 + * bbox_coords[i, m] -= self.c_pbcbox.box[m][m] + * + * return bbox_coords # <<<<<<<<<<<<<< + * + * ######################### + */ + __PYX_INC_MEMVIEW(&__pyx_v_bbox_coords, 1); + __pyx_r = __pyx_v_bbox_coords; + goto __pyx_L3_return; + } + + /* "MDAnalysis/lib/nsgrid.pyx":271 + * + * cdef real[:, ::1]fast_put_atoms_in_bbox(self, real[:, ::1] coords) nogil: + * """Shifts all ``coords`` to an orthogonal brick shaped box # <<<<<<<<<<<<<< + * + * All the coordinates are brought into an orthogonal + */ + /*finally:*/ { + __pyx_L3_return: { + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + goto __pyx_L0; + } + __pyx_L4_error: { + #ifdef WITH_THREAD + __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + goto __pyx_L1_error; + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":270 + * return rvec_norm2(dx) + * + * cdef real[:, ::1]fast_put_atoms_in_bbox(self, real[:, ::1] coords) nogil: # <<<<<<<<<<<<<< + * """Shifts all ``coords`` to an orthogonal brick shaped box + * + */ + + /* function exit code */ + __Pyx_pretend_to_initialize(&__pyx_r); + goto __pyx_L0; + __pyx_L1_error:; + __PYX_XDEC_MEMVIEW(&__pyx_t_1, 0); + __pyx_r.data = NULL; + __pyx_r.memview = NULL; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.PBCBox.fast_put_atoms_in_bbox", __pyx_clineno, __pyx_lineno, __pyx_filename); + + goto __pyx_L2; + __pyx_L0:; + if (unlikely(!__pyx_r.memview)) { + PyErr_SetString(PyExc_TypeError, "Memoryview return value is not initialized"); + } + __pyx_L2:; + __PYX_XDEC_MEMVIEW(&__pyx_v_bbox_coords, 0); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox_4__reduce_cython__[] = "PBCBox.__reduce_cython__(self)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_4__reduce_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.PBCBox.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox_6__setstate_cython__[] = "PBCBox.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_6__setstate_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6PBCBox_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.PBCBox.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":331 + * cdef vector[real] pair_distances2_buffer + * + * def __init__(self, real cutoff, real[:, ::1]coords, real[:, ::1]searchcoords): # <<<<<<<<<<<<<< + * """ + * Parameters + */ + +/* Python wrapper */ +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults___init__[] = "\n Parameters\n ----------\n cutoff : float\n Specified cutoff distance\n coords : numpy.ndarray\n Array with coordinates of atoms of shape ``(N, 3)`` for\n ``N`` particles. ``dtype`` must be ``numpy.float32``\n searchcoords : numpy.ndarray\n Array with query coordinates. Shape must be ``(M, 3)``\n for ``M`` queries. ``dtype`` must be ``numpy.float32``\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_9NSResults___init__; +#endif +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_cutoff; + __Pyx_memviewslice __pyx_v_coords = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_searchcoords = { 0, 0, { 0 }, { 0 }, { 0 } }; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cutoff,&__pyx_n_s_coords,&__pyx_n_s_searchcoords,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 331, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_searchcoords)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 331, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 331, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_cutoff = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_cutoff == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L3_error) + __pyx_v_coords = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_coords.memview)) __PYX_ERR(0, 331, __pyx_L3_error) + __pyx_v_searchcoords = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_searchcoords.memview)) __PYX_ERR(0, 331, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 331, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults___init__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_coords, __pyx_v_searchcoords); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_cutoff, __Pyx_memviewslice __pyx_v_coords, __Pyx_memviewslice __pyx_v_searchcoords) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":345 + * """ + * + * self.cutoff = cutoff # <<<<<<<<<<<<<< + * self.coords = coords + * self.searchcoords = searchcoords + */ + __pyx_v_self->cutoff = __pyx_v_cutoff; + + /* "MDAnalysis/lib/nsgrid.pyx":346 + * + * self.cutoff = cutoff + * self.coords = coords # <<<<<<<<<<<<<< + * self.searchcoords = searchcoords + * + */ + __PYX_XDEC_MEMVIEW(&__pyx_v_self->coords, 0); + __PYX_INC_MEMVIEW(&__pyx_v_coords, 0); + __pyx_v_self->coords = __pyx_v_coords; + + /* "MDAnalysis/lib/nsgrid.pyx":347 + * self.cutoff = cutoff + * self.coords = coords + * self.searchcoords = searchcoords # <<<<<<<<<<<<<< + * + * self.npairs = 0 + */ + __PYX_XDEC_MEMVIEW(&__pyx_v_self->searchcoords, 0); + __PYX_INC_MEMVIEW(&__pyx_v_searchcoords, 0); + __pyx_v_self->searchcoords = __pyx_v_searchcoords; + + /* "MDAnalysis/lib/nsgrid.pyx":349 + * self.searchcoords = searchcoords + * + * self.npairs = 0 # <<<<<<<<<<<<<< + * + * cdef void add_neighbors(self, ns_int beadid_i, ns_int beadid_j, real distance2) nogil: + */ + __pyx_v_self->npairs = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":331 + * cdef vector[real] pair_distances2_buffer + * + * def __init__(self, real cutoff, real[:, ::1]coords, real[:, ::1]searchcoords): # <<<<<<<<<<<<<< + * """ + * Parameters + */ + + /* function exit code */ + __pyx_r = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_coords, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_searchcoords, 1); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":351 + * self.npairs = 0 + * + * cdef void add_neighbors(self, ns_int beadid_i, ns_int beadid_j, real distance2) nogil: # <<<<<<<<<<<<<< + * """Internal function to add pairs and distances to buffers + * + */ + +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_9NSResults_add_neighbors(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_beadid_i, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_beadid_j, __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_distance2) { + + /* "MDAnalysis/lib/nsgrid.pyx":361 + * """ + * + * self.pairs_buffer.push_back(beadid_i) # <<<<<<<<<<<<<< + * self.pairs_buffer.push_back(beadid_j) + * self.pair_distances2_buffer.push_back(distance2) + */ + try { + __pyx_v_self->pairs_buffer.push_back(__pyx_v_beadid_i); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 361, __pyx_L1_error) + } + + /* "MDAnalysis/lib/nsgrid.pyx":362 + * + * self.pairs_buffer.push_back(beadid_i) + * self.pairs_buffer.push_back(beadid_j) # <<<<<<<<<<<<<< + * self.pair_distances2_buffer.push_back(distance2) + * self.npairs += 1 + */ + try { + __pyx_v_self->pairs_buffer.push_back(__pyx_v_beadid_j); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 362, __pyx_L1_error) + } + + /* "MDAnalysis/lib/nsgrid.pyx":363 + * self.pairs_buffer.push_back(beadid_i) + * self.pairs_buffer.push_back(beadid_j) + * self.pair_distances2_buffer.push_back(distance2) # <<<<<<<<<<<<<< + * self.npairs += 1 + * + */ + try { + __pyx_v_self->pair_distances2_buffer.push_back(__pyx_v_distance2); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 363, __pyx_L1_error) + } + + /* "MDAnalysis/lib/nsgrid.pyx":364 + * self.pairs_buffer.push_back(beadid_j) + * self.pair_distances2_buffer.push_back(distance2) + * self.npairs += 1 # <<<<<<<<<<<<<< + * + * def get_pairs(self): + */ + __pyx_v_self->npairs = (__pyx_v_self->npairs + 1); + + /* "MDAnalysis/lib/nsgrid.pyx":351 + * self.npairs = 0 + * + * cdef void add_neighbors(self, ns_int beadid_i, ns_int beadid_j, real distance2) nogil: # <<<<<<<<<<<<<< + * """Internal function to add pairs and distances to buffers + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("MDAnalysis.lib.nsgrid.NSResults.add_neighbors", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; +} + +/* "MDAnalysis/lib/nsgrid.pyx":366 + * self.npairs += 1 + * + * def get_pairs(self): # <<<<<<<<<<<<<< + * """Returns all the pairs within the desired cutoff distance + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_3get_pairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_2get_pairs[] = "NSResults.get_pairs(self)\nReturns all the pairs within the desired cutoff distance\n\n Returns an array of shape ``(N, 2)``, where N is the number of pairs\n between ``reference`` and ``configuration`` within the specified distance.\n For every pair ``(i, j)``, ``reference[i]`` and ``configuration[j]`` are\n atom positions such that ``reference`` is the position of query\n atoms while ``configuration`` coontains the position of group of\n atoms used to search against the query atoms.\n\n Returns\n -------\n pairs : numpy.ndarray\n pairs of atom indices of neighbors from query\n and initial atom coordinates of shape ``(N, 2)``\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_3get_pairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pairs (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_2get_pairs(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_2get_pairs(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("get_pairs", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":383 + * """ + * + * return np.asarray(self.pairs_buffer, dtype=np.int64).reshape(self.npairs, 2) # <<<<<<<<<<<<<< + * + * def get_pair_distances(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(__pyx_v_self->pairs_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyInt_From_npy_long(__pyx_v_self->npairs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_int_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_int_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_t_6); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_int_2); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":366 + * self.npairs += 1 + * + * def get_pairs(self): # <<<<<<<<<<<<<< + * """Returns all the pairs within the desired cutoff distance + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.get_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":385 + * return np.asarray(self.pairs_buffer, dtype=np.int64).reshape(self.npairs, 2) + * + * def get_pair_distances(self): # <<<<<<<<<<<<<< + * """Returns all the distances corresponding to each pair of neighbors + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_5get_pair_distances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_4get_pair_distances[] = "NSResults.get_pair_distances(self)\nReturns all the distances corresponding to each pair of neighbors\n\n Returns an array of shape ``N`` where N is the number of pairs\n among the query atoms and initial atoms within a specified distance.\n Every element ``[i]`` corresponds to the distance between\n ``pairs[i, 0]`` and ``pairs[i, 1]``, where pairs is the array\n obtained from ``get_pairs()``\n\n Returns\n -------\n distances : numpy.ndarray\n distances between pairs of query and initial\n atom coordinates of shape ``N``\n\n See Also\n --------\n MDAnalysis.lib.nsgrid.NSResults.get_pairs\n\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_5get_pair_distances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_pair_distances (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_4get_pair_distances(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_4get_pair_distances(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> __pyx_t_6; + __Pyx_RefNannySetupContext("get_pair_distances", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":406 + * """ + * + * self.pair_distances_buffer = np.sqrt(self.pair_distances2_buffer) # <<<<<<<<<<<<<< + * return np.asarray(self.pair_distances_buffer) + * + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_v_self->pair_distances2_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_4) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->pair_distances_buffer = __pyx_t_6; + + /* "MDAnalysis/lib/nsgrid.pyx":407 + * + * self.pair_distances_buffer = np.sqrt(self.pair_distances2_buffer) + * return np.asarray(self.pair_distances_buffer) # <<<<<<<<<<<<<< + * + * cdef void create_buffers(self) nogil: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_v_self->pair_distances_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":385 + * return np.asarray(self.pairs_buffer, dtype=np.int64).reshape(self.npairs, 2) + * + * def get_pair_distances(self): # <<<<<<<<<<<<<< + * """Returns all the distances corresponding to each pair of neighbors + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.get_pair_distances", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":409 + * return np.asarray(self.pair_distances_buffer) + * + * cdef void create_buffers(self) nogil: # <<<<<<<<<<<<<< + * """ + * Creates buffers to get individual neighbour list and distances + */ + +static void __pyx_f_10MDAnalysis_3lib_6nsgrid_9NSResults_create_buffers(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_beadid_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_beadid_j; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_nsearch; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_dist2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_dist; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> __pyx_t_1; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> __pyx_t_2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_3; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_4; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_5; + __pyx_t_10MDAnalysis_3lib_6nsgrid_intvec __pyx_t_6; + __pyx_t_10MDAnalysis_3lib_6nsgrid_realvec __pyx_t_7; + + /* "MDAnalysis/lib/nsgrid.pyx":420 + * cdef real dist2, dist + * + * nsearch = self.searchcoords.shape[0] # <<<<<<<<<<<<<< + * + * self.indices_buffer = vector[intvec]() + */ + __pyx_v_nsearch = (__pyx_v_self->searchcoords.shape[0]); + + /* "MDAnalysis/lib/nsgrid.pyx":422 + * nsearch = self.searchcoords.shape[0] + * + * self.indices_buffer = vector[intvec]() # <<<<<<<<<<<<<< + * self.distances_buffer = vector[realvec]() + * + */ + try { + __pyx_t_1 = std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> (); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 422, __pyx_L1_error) + } + __pyx_v_self->indices_buffer = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":423 + * + * self.indices_buffer = vector[intvec]() + * self.distances_buffer = vector[realvec]() # <<<<<<<<<<<<<< + * + * # initialize rows corresponding to search + */ + try { + __pyx_t_2 = std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> (); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 423, __pyx_L1_error) + } + __pyx_v_self->distances_buffer = __pyx_t_2; + + /* "MDAnalysis/lib/nsgrid.pyx":426 + * + * # initialize rows corresponding to search + * for i in range(nsearch): # <<<<<<<<<<<<<< + * self.indices_buffer.push_back(intvec()) + * self.distances_buffer.push_back(realvec()) + */ + __pyx_t_3 = __pyx_v_nsearch; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "MDAnalysis/lib/nsgrid.pyx":427 + * # initialize rows corresponding to search + * for i in range(nsearch): + * self.indices_buffer.push_back(intvec()) # <<<<<<<<<<<<<< + * self.distances_buffer.push_back(realvec()) + * + */ + try { + __pyx_t_6 = __pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 427, __pyx_L1_error) + } + try { + __pyx_v_self->indices_buffer.push_back(__pyx_t_6); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 427, __pyx_L1_error) + } + + /* "MDAnalysis/lib/nsgrid.pyx":428 + * for i in range(nsearch): + * self.indices_buffer.push_back(intvec()) + * self.distances_buffer.push_back(realvec()) # <<<<<<<<<<<<<< + * + * for i in range(0, 2*self.npairs, 2): + */ + try { + __pyx_t_7 = __pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 428, __pyx_L1_error) + } + try { + __pyx_v_self->distances_buffer.push_back(__pyx_t_7); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 428, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":430 + * self.distances_buffer.push_back(realvec()) + * + * for i in range(0, 2*self.npairs, 2): # <<<<<<<<<<<<<< + * beadid_i = self.pairs_buffer[i] + * beadid_j = self.pairs_buffer[i + 1] + */ + __pyx_t_3 = (2 * __pyx_v_self->npairs); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=2) { + __pyx_v_i = __pyx_t_5; + + /* "MDAnalysis/lib/nsgrid.pyx":431 + * + * for i in range(0, 2*self.npairs, 2): + * beadid_i = self.pairs_buffer[i] # <<<<<<<<<<<<<< + * beadid_j = self.pairs_buffer[i + 1] + * + */ + __pyx_v_beadid_i = (__pyx_v_self->pairs_buffer[__pyx_v_i]); + + /* "MDAnalysis/lib/nsgrid.pyx":432 + * for i in range(0, 2*self.npairs, 2): + * beadid_i = self.pairs_buffer[i] + * beadid_j = self.pairs_buffer[i + 1] # <<<<<<<<<<<<<< + * + * dist2 = self.pair_distances2_buffer[i//2] + */ + __pyx_v_beadid_j = (__pyx_v_self->pairs_buffer[(__pyx_v_i + 1)]); + + /* "MDAnalysis/lib/nsgrid.pyx":434 + * beadid_j = self.pairs_buffer[i + 1] + * + * dist2 = self.pair_distances2_buffer[i//2] # <<<<<<<<<<<<<< + * + * self.indices_buffer[beadid_i].push_back(beadid_j) + */ + __pyx_v_dist2 = (__pyx_v_self->pair_distances2_buffer[(__pyx_v_i / 2)]); + + /* "MDAnalysis/lib/nsgrid.pyx":436 + * dist2 = self.pair_distances2_buffer[i//2] + * + * self.indices_buffer[beadid_i].push_back(beadid_j) # <<<<<<<<<<<<<< + * + * dist = sqrt(dist2) + */ + try { + (__pyx_v_self->indices_buffer[__pyx_v_beadid_i]).push_back(__pyx_v_beadid_j); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 436, __pyx_L1_error) + } + + /* "MDAnalysis/lib/nsgrid.pyx":438 + * self.indices_buffer[beadid_i].push_back(beadid_j) + * + * dist = sqrt(dist2) # <<<<<<<<<<<<<< + * + * self.distances_buffer[beadid_i].push_back(dist) + */ + __pyx_v_dist = sqrt(__pyx_v_dist2); + + /* "MDAnalysis/lib/nsgrid.pyx":440 + * dist = sqrt(dist2) + * + * self.distances_buffer[beadid_i].push_back(dist) # <<<<<<<<<<<<<< + * + * def get_indices(self): + */ + try { + (__pyx_v_self->distances_buffer[__pyx_v_beadid_i]).push_back(__pyx_v_dist); + } catch(...) { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_CppExn2PyErr(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + __PYX_ERR(0, 440, __pyx_L1_error) + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":409 + * return np.asarray(self.pair_distances_buffer) + * + * cdef void create_buffers(self) nogil: # <<<<<<<<<<<<<< + * """ + * Creates buffers to get individual neighbour list and distances + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("MDAnalysis.lib.nsgrid.NSResults.create_buffers", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); + __pyx_L0:; +} + +/* "MDAnalysis/lib/nsgrid.pyx":442 + * self.distances_buffer[beadid_i].push_back(dist) + * + * def get_indices(self): # <<<<<<<<<<<<<< + * """Individual neighbours of query atom + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_7get_indices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_6get_indices[] = "NSResults.get_indices(self)\nIndividual neighbours of query atom\n\n For every queried atom ``i``, an array of all its neighbors\n indices can be obtained from ``get_indices()[i]``\n\n Returns\n -------\n indices : list\n Indices of neighboring atoms.\n Every element i.e. ``indices[i]`` will be a list of\n size ``m`` where m is the number of neighbours of\n query atom[i].\n\n .. code-block:: python\n\n results = NSResults()\n indices = results.get_indices()\n\n ``indices[i]`` will output a list of neighboring\n atoms of ``atom[i]`` from query atoms ``atom``.\n ``indices[i][j]`` will give the atom-id of initial coordinates\n such that ``initial_atom[indices[i][j]]`` is a neighbor of ``atom[i]``\n\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_7get_indices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_indices (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_6get_indices(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_6get_indices(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_indices", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":468 + * """ + * + * if self.indices_buffer.empty(): # <<<<<<<<<<<<<< + * self.create_buffers() + * return list(self.indices_buffer) + */ + __pyx_t_1 = (__pyx_v_self->indices_buffer.empty() != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":469 + * + * if self.indices_buffer.empty(): + * self.create_buffers() # <<<<<<<<<<<<<< + * return list(self.indices_buffer) + * + */ + ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self->__pyx_vtab)->create_buffers(__pyx_v_self); + + /* "MDAnalysis/lib/nsgrid.pyx":468 + * """ + * + * if self.indices_buffer.empty(): # <<<<<<<<<<<<<< + * self.create_buffers() + * return list(self.indices_buffer) + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":470 + * if self.indices_buffer.empty(): + * self.create_buffers() + * return list(self.indices_buffer) # <<<<<<<<<<<<<< + * + * def get_distances(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(__pyx_v_self->indices_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":442 + * self.distances_buffer[beadid_i].push_back(dist) + * + * def get_indices(self): # <<<<<<<<<<<<<< + * """Individual neighbours of query atom + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.get_indices", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":472 + * return list(self.indices_buffer) + * + * def get_distances(self): # <<<<<<<<<<<<<< + * """Distance corresponding to individual neighbors of query atom + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_9get_distances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_8get_distances[] = "NSResults.get_distances(self)\nDistance corresponding to individual neighbors of query atom\n\n For every queried atom ``i``, a list of all the distances\n from its neighboring atoms can be obtained from ``get_distances()[i]``.\n Every ``distance[i][j]`` will correspond\n to the distance between atoms ``atom[i]`` from the query\n atoms and ``atom[indices[j]]`` from the initialized\n set of coordinates, where ``indices`` can be obtained\n by ``get_indices()``\n\n Returns\n -------\n distances : np.ndarray\n Every element i.e. ``distances[i]`` will be an array of\n shape ``m`` where m is the number of neighbours of\n query atom[i].\n\n .. code-block:: python\n\n results = NSResults()\n distances = results.get_distances()\n\n\n atoms of ``atom[i]`` and query atoms ``atom``.\n ``indices[i][j]`` will give the atom-id of initial coordinates\n such that ``initial_atom[indices[i][j]]`` is a neighbor of ``atom[i]``\n\n See Also\n --------\n MDAnalysis.lib.nsgrid.NSResults.get_indices\n\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_9get_distances(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_distances (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_8get_distances(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_8get_distances(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_distances", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":506 + * """ + * + * if self.distances_buffer.empty(): # <<<<<<<<<<<<<< + * self.create_buffers() + * return list(self.distances_buffer) + */ + __pyx_t_1 = (__pyx_v_self->distances_buffer.empty() != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":507 + * + * if self.distances_buffer.empty(): + * self.create_buffers() # <<<<<<<<<<<<<< + * return list(self.distances_buffer) + * + */ + ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self->__pyx_vtab)->create_buffers(__pyx_v_self); + + /* "MDAnalysis/lib/nsgrid.pyx":506 + * """ + * + * if self.distances_buffer.empty(): # <<<<<<<<<<<<<< + * self.create_buffers() + * return list(self.distances_buffer) + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":508 + * if self.distances_buffer.empty(): + * self.create_buffers() + * return list(self.distances_buffer) # <<<<<<<<<<<<<< + * + * cdef class NSGrid(object): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(__pyx_v_self->distances_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":472 + * return list(self.indices_buffer) + * + * def get_distances(self): # <<<<<<<<<<<<<< + * """Distance corresponding to individual neighbors of query atom + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.get_distances", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":319 + * """ + * + * cdef readonly real cutoff # <<<<<<<<<<<<<< + * cdef ns_int npairs + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_6cutoff_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_6cutoff_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_6cutoff___get__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_6cutoff___get__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.cutoff.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.coords, self.cutoff, self.distances_buffer, self.indices_buffer, self.npairs, self.pair_distances2_buffer, self.pair_distances_buffer, self.pairs_buffer, self.searchcoords) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_10__reduce_cython__[] = "NSResults.__reduce_cython__(self)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_10__reduce_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_10__reduce_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.coords, self.cutoff, self.distances_buffer, self.indices_buffer, self.npairs, self.pair_distances2_buffer, self.pair_distances_buffer, self.pairs_buffer, self.searchcoords) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(__pyx_v_self->distances_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(__pyx_v_self->indices_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_From_npy_long(__pyx_v_self->npairs); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_v_self->pair_distances2_buffer); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_v_self->pair_distances_buffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(__pyx_v_self->pairs_buffer); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_self->searchcoords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_9); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_v_state = ((PyObject*)__pyx_t_10); + __pyx_t_10 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.coords, self.cutoff, self.distances_buffer, self.indices_buffer, self.npairs, self.pair_distances2_buffer, self.pair_distances_buffer, self.pairs_buffer, self.searchcoords) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_v__dict = __pyx_t_10; + __pyx_t_10 = 0; + + /* "(tree fragment)":5 + * state = (self.coords, self.cutoff, self.distances_buffer, self.indices_buffer, self.npairs, self.pair_distances2_buffer, self.pair_distances_buffer, self.pairs_buffer, self.searchcoords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_11 = (__pyx_v__dict != Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict); + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_9)); + __pyx_t_9 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = False + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":5 + * state = (self.coords, self.cutoff, self.distances_buffer, self.indices_buffer, self.npairs, self.pair_distances2_buffer, self.pair_distances_buffer, self.pairs_buffer, self.searchcoords) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = False # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, None), state + */ + /*else*/ { + __pyx_v_use_setstate = 0; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, None), state + * else: + */ + __pyx_t_12 = (__pyx_v_use_setstate != 0); + if (__pyx_t_12) { + + /* "(tree fragment)":11 + * use_setstate = False + * if use_setstate: + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_NSResults); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_43303570); + __Pyx_GIVEREF(__pyx_int_43303570); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_43303570); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state); + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = False + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, None), state + * else: + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_NSResults__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_NSResults); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_43303570); + __Pyx_GIVEREF(__pyx_int_43303570); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_43303570); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.coords, self.cutoff, self.distances_buffer, self.indices_buffer, self.npairs, self.pair_distances2_buffer, self.pair_distances_buffer, self.pairs_buffer, self.searchcoords) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_NSResults__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_12__setstate_cython__[] = "NSResults.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_12__setstate_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_9NSResults_12__setstate_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":15 + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_NSResults__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_NSResults, (type(self), 0x294c292, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_NSResults__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSResults.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":549 + * cdef bint force # To negate the effects of optimized cutoff + * + * def __init__(self, ncoords, cutoff, PBCBox box, max_size, force=False): # <<<<<<<<<<<<<< + * """ + * Parameters + */ + +/* Python wrapper */ +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__[] = "\n Parameters\n ----------\n ncoords : int\n Number of coordinates to fill inside the brick shaped box\n cutoff : float\n Desired cutoff radius\n box : PBCBox\n Instance of :class:`PBCBox`\n max_size : int\n Maximum total number of cells\n force : boolean\n Optimizes cutoff if set to ``False`` [False]\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__; +#endif +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ncoords = 0; + PyObject *__pyx_v_cutoff = 0; + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_box = 0; + PyObject *__pyx_v_max_size = 0; + PyObject *__pyx_v_force = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ncoords,&__pyx_n_s_cutoff,&__pyx_n_s_box,&__pyx_n_s_max_size,&__pyx_n_s_force,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ncoords)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 549, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 549, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_size)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 549, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_force); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 549, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ncoords = values[0]; + __pyx_v_cutoff = values[1]; + __pyx_v_box = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)values[2]); + __pyx_v_max_size = values[3]; + __pyx_v_force = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 549, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSGrid.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_box), __pyx_ptype_10MDAnalysis_3lib_6nsgrid_PBCBox, 1, "box", 0))) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self), __pyx_v_ncoords, __pyx_v_cutoff, __pyx_v_box, __pyx_v_max_size, __pyx_v_force); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, PyObject *__pyx_v_ncoords, PyObject *__pyx_v_cutoff, struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *__pyx_v_box, PyObject *__pyx_v_max_size, PyObject *__pyx_v_force) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_size; + CYTHON_UNUSED __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_nbeadspercell; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_bbox_vol; + int __pyx_r; + __Pyx_RefNannyDeclarations + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_1; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_10; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_11; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":570 + * cdef real bbox_vol + * + * self.ncoords = ncoords # <<<<<<<<<<<<<< + * + * # Calculate best cutoff + */ + __pyx_t_1 = __Pyx_PyInt_As_npy_long(__pyx_v_ncoords); if (unlikely((__pyx_t_1 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_v_self->ncoords = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":573 + * + * # Calculate best cutoff + * self.cutoff = cutoff # <<<<<<<<<<<<<< + * if not force: + * bbox_vol = box.c_pbcbox.box[XX][XX] * box.c_pbcbox.box[YY][YY] * box.c_pbcbox.box[YY][YY] + */ + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_cutoff); if (unlikely((__pyx_t_2 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_v_self->cutoff = __pyx_t_2; + + /* "MDAnalysis/lib/nsgrid.pyx":574 + * # Calculate best cutoff + * self.cutoff = cutoff + * if not force: # <<<<<<<<<<<<<< + * bbox_vol = box.c_pbcbox.box[XX][XX] * box.c_pbcbox.box[YY][YY] * box.c_pbcbox.box[YY][YY] + * size = bbox_vol/cutoff**3 + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (__pyx_t_4) { + + /* "MDAnalysis/lib/nsgrid.pyx":575 + * self.cutoff = cutoff + * if not force: + * bbox_vol = box.c_pbcbox.box[XX][XX] * box.c_pbcbox.box[YY][YY] * box.c_pbcbox.box[YY][YY] # <<<<<<<<<<<<<< + * size = bbox_vol/cutoff**3 + * nbeadspercell = ncoords/size + */ + __pyx_v_bbox_vol = ((((__pyx_v_box->c_pbcbox.box[0])[0]) * ((__pyx_v_box->c_pbcbox.box[1])[1])) * ((__pyx_v_box->c_pbcbox.box[1])[1])); + + /* "MDAnalysis/lib/nsgrid.pyx":576 + * if not force: + * bbox_vol = box.c_pbcbox.box[XX][XX] * box.c_pbcbox.box[YY][YY] * box.c_pbcbox.box[YY][YY] + * size = bbox_vol/cutoff**3 # <<<<<<<<<<<<<< + * nbeadspercell = ncoords/size + * while bbox_vol/self.cutoff**3 > max_size: + */ + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_bbox_vol); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyNumber_Power(__pyx_v_cutoff, __pyx_int_3, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyInt_As_npy_long(__pyx_t_7); if (unlikely((__pyx_t_1 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_size = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":577 + * bbox_vol = box.c_pbcbox.box[XX][XX] * box.c_pbcbox.box[YY][YY] * box.c_pbcbox.box[YY][YY] + * size = bbox_vol/cutoff**3 + * nbeadspercell = ncoords/size # <<<<<<<<<<<<<< + * while bbox_vol/self.cutoff**3 > max_size: + * self.cutoff *= 1.2 + */ + __pyx_t_7 = __Pyx_PyInt_From_npy_long(__pyx_v_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_ncoords, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyInt_As_npy_long(__pyx_t_6); if (unlikely((__pyx_t_1 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_nbeadspercell = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":578 + * size = bbox_vol/cutoff**3 + * nbeadspercell = ncoords/size + * while bbox_vol/self.cutoff**3 > max_size: # <<<<<<<<<<<<<< + * self.cutoff *= 1.2 + * + */ + while (1) { + __pyx_t_6 = PyFloat_FromDouble((__pyx_v_bbox_vol / powf(__pyx_v_self->cutoff, 3.0))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_v_max_size, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_4) break; + + /* "MDAnalysis/lib/nsgrid.pyx":579 + * nbeadspercell = ncoords/size + * while bbox_vol/self.cutoff**3 > max_size: + * self.cutoff *= 1.2 # <<<<<<<<<<<<<< + * + * for i in range(DIM): + */ + __pyx_v_self->cutoff = (__pyx_v_self->cutoff * 1.2); + } + + /* "MDAnalysis/lib/nsgrid.pyx":574 + * # Calculate best cutoff + * self.cutoff = cutoff + * if not force: # <<<<<<<<<<<<<< + * bbox_vol = box.c_pbcbox.box[XX][XX] * box.c_pbcbox.box[YY][YY] * box.c_pbcbox.box[YY][YY] + * size = bbox_vol/cutoff**3 + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":581 + * self.cutoff *= 1.2 + * + * for i in range(DIM): # <<<<<<<<<<<<<< + * self.ncells[i] = (box.c_pbcbox.box[i][i] / self.cutoff) + * self.cellsize[i] = box.c_pbcbox.box[i][i] / self.ncells[i] + */ + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":582 + * + * for i in range(DIM): + * self.ncells[i] = (box.c_pbcbox.box[i][i] / self.cutoff) # <<<<<<<<<<<<<< + * self.cellsize[i] = box.c_pbcbox.box[i][i] / self.ncells[i] + * self.size = self.ncells[XX] * self.ncells[YY] * self.ncells[ZZ] + */ + (__pyx_v_self->ncells[__pyx_v_i]) = ((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)(((__pyx_v_box->c_pbcbox.box[__pyx_v_i])[__pyx_v_i]) / __pyx_v_self->cutoff)); + + /* "MDAnalysis/lib/nsgrid.pyx":583 + * for i in range(DIM): + * self.ncells[i] = (box.c_pbcbox.box[i][i] / self.cutoff) + * self.cellsize[i] = box.c_pbcbox.box[i][i] / self.ncells[i] # <<<<<<<<<<<<<< + * self.size = self.ncells[XX] * self.ncells[YY] * self.ncells[ZZ] + * + */ + (__pyx_v_self->cellsize[__pyx_v_i]) = (((__pyx_v_box->c_pbcbox.box[__pyx_v_i])[__pyx_v_i]) / (__pyx_v_self->ncells[__pyx_v_i])); + } + + /* "MDAnalysis/lib/nsgrid.pyx":584 + * self.ncells[i] = (box.c_pbcbox.box[i][i] / self.cutoff) + * self.cellsize[i] = box.c_pbcbox.box[i][i] / self.ncells[i] + * self.size = self.ncells[XX] * self.ncells[YY] * self.ncells[ZZ] # <<<<<<<<<<<<<< + * + * self.cell_offsets[XX] = 0 + */ + __pyx_v_self->size = (((__pyx_v_self->ncells[0]) * (__pyx_v_self->ncells[1])) * (__pyx_v_self->ncells[2])); + + /* "MDAnalysis/lib/nsgrid.pyx":586 + * self.size = self.ncells[XX] * self.ncells[YY] * self.ncells[ZZ] + * + * self.cell_offsets[XX] = 0 # <<<<<<<<<<<<<< + * self.cell_offsets[YY] = self.ncells[XX] + * self.cell_offsets[ZZ] = self.ncells[XX] * self.ncells[YY] + */ + (__pyx_v_self->cell_offsets[0]) = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":587 + * + * self.cell_offsets[XX] = 0 + * self.cell_offsets[YY] = self.ncells[XX] # <<<<<<<<<<<<<< + * self.cell_offsets[ZZ] = self.ncells[XX] * self.ncells[YY] + * + */ + (__pyx_v_self->cell_offsets[1]) = (__pyx_v_self->ncells[0]); + + /* "MDAnalysis/lib/nsgrid.pyx":588 + * self.cell_offsets[XX] = 0 + * self.cell_offsets[YY] = self.ncells[XX] + * self.cell_offsets[ZZ] = self.ncells[XX] * self.ncells[YY] # <<<<<<<<<<<<<< + * + * # Allocate memory + */ + (__pyx_v_self->cell_offsets[2]) = ((__pyx_v_self->ncells[0]) * (__pyx_v_self->ncells[1])); + + /* "MDAnalysis/lib/nsgrid.pyx":592 + * # Allocate memory + * # Number of beads in every cell + * self.nbeads = PyMem_Malloc(sizeof(ns_int) * self.size) # <<<<<<<<<<<<<< + * if not self.nbeads: + * raise MemoryError("Could not allocate memory from NSGrid.nbeads ({} bits requested)".format(sizeof(ns_int) * self.size)) + */ + __pyx_v_self->nbeads = ((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *)PyMem_Malloc(((sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)) * __pyx_v_self->size))); + + /* "MDAnalysis/lib/nsgrid.pyx":593 + * # Number of beads in every cell + * self.nbeads = PyMem_Malloc(sizeof(ns_int) * self.size) + * if not self.nbeads: # <<<<<<<<<<<<<< + * raise MemoryError("Could not allocate memory from NSGrid.nbeads ({} bits requested)".format(sizeof(ns_int) * self.size)) + * self.beadids = NULL + */ + __pyx_t_4 = ((!(__pyx_v_self->nbeads != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "MDAnalysis/lib/nsgrid.pyx":594 + * self.nbeads = PyMem_Malloc(sizeof(ns_int) * self.size) + * if not self.nbeads: + * raise MemoryError("Could not allocate memory from NSGrid.nbeads ({} bits requested)".format(sizeof(ns_int) * self.size)) # <<<<<<<<<<<<<< + * self.beadids = NULL + * # Cellindex of every bead + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_allocate_memory_from_N, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_FromSize_t(((sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)) * __pyx_v_self->size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + if (!__pyx_t_8) { + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(0, 594, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":593 + * # Number of beads in every cell + * self.nbeads = PyMem_Malloc(sizeof(ns_int) * self.size) + * if not self.nbeads: # <<<<<<<<<<<<<< + * raise MemoryError("Could not allocate memory from NSGrid.nbeads ({} bits requested)".format(sizeof(ns_int) * self.size)) + * self.beadids = NULL + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":595 + * if not self.nbeads: + * raise MemoryError("Could not allocate memory from NSGrid.nbeads ({} bits requested)".format(sizeof(ns_int) * self.size)) + * self.beadids = NULL # <<<<<<<<<<<<<< + * # Cellindex of every bead + * self.cellids = PyMem_Malloc(sizeof(ns_int) * self.ncoords) + */ + __pyx_v_self->beadids = NULL; + + /* "MDAnalysis/lib/nsgrid.pyx":597 + * self.beadids = NULL + * # Cellindex of every bead + * self.cellids = PyMem_Malloc(sizeof(ns_int) * self.ncoords) # <<<<<<<<<<<<<< + * if not self.cellids: + * raise MemoryError("Could not allocate memory from NSGrid.cellids ({} bits requested)".format(sizeof(ns_int) * self.ncoords)) + */ + __pyx_v_self->cellids = ((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *)PyMem_Malloc(((sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)) * __pyx_v_self->ncoords))); + + /* "MDAnalysis/lib/nsgrid.pyx":598 + * # Cellindex of every bead + * self.cellids = PyMem_Malloc(sizeof(ns_int) * self.ncoords) + * if not self.cellids: # <<<<<<<<<<<<<< + * raise MemoryError("Could not allocate memory from NSGrid.cellids ({} bits requested)".format(sizeof(ns_int) * self.ncoords)) + * self.nbeads_per_cell = 0 + */ + __pyx_t_4 = ((!(__pyx_v_self->cellids != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + /* "MDAnalysis/lib/nsgrid.pyx":599 + * self.cellids = PyMem_Malloc(sizeof(ns_int) * self.ncoords) + * if not self.cellids: + * raise MemoryError("Could not allocate memory from NSGrid.cellids ({} bits requested)".format(sizeof(ns_int) * self.ncoords)) # <<<<<<<<<<<<<< + * self.nbeads_per_cell = 0 + * + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_allocate_memory_from_N_2, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyInt_FromSize_t(((sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)) * __pyx_v_self->ncoords)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (!__pyx_t_5) { + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_6); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_9}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_9}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 599, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":598 + * # Cellindex of every bead + * self.cellids = PyMem_Malloc(sizeof(ns_int) * self.ncoords) + * if not self.cellids: # <<<<<<<<<<<<<< + * raise MemoryError("Could not allocate memory from NSGrid.cellids ({} bits requested)".format(sizeof(ns_int) * self.ncoords)) + * self.nbeads_per_cell = 0 + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":600 + * if not self.cellids: + * raise MemoryError("Could not allocate memory from NSGrid.cellids ({} bits requested)".format(sizeof(ns_int) * self.ncoords)) + * self.nbeads_per_cell = 0 # <<<<<<<<<<<<<< + * + * for i in range(self.size): + */ + __pyx_v_self->nbeads_per_cell = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":602 + * self.nbeads_per_cell = 0 + * + * for i in range(self.size): # <<<<<<<<<<<<<< + * self.nbeads[i] = 0 + * + */ + __pyx_t_1 = __pyx_v_self->size; + __pyx_t_10 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "MDAnalysis/lib/nsgrid.pyx":603 + * + * for i in range(self.size): + * self.nbeads[i] = 0 # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + (__pyx_v_self->nbeads[__pyx_v_i]) = 0; + } + + /* "MDAnalysis/lib/nsgrid.pyx":549 + * cdef bint force # To negate the effects of optimized cutoff + * + * def __init__(self, ncoords, cutoff, PBCBox box, max_size, force=False): # <<<<<<<<<<<<<< + * """ + * Parameters + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSGrid.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":605 + * self.nbeads[i] = 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * PyMem_Free(self.nbeads) + * PyMem_Free(self.beadids) + */ + +/* Python wrapper */ +static void __pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_2__dealloc__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_2__dealloc__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":606 + * + * def __dealloc__(self): + * PyMem_Free(self.nbeads) # <<<<<<<<<<<<<< + * PyMem_Free(self.beadids) + * PyMem_Free(self.cellids) + */ + PyMem_Free(__pyx_v_self->nbeads); + + /* "MDAnalysis/lib/nsgrid.pyx":607 + * def __dealloc__(self): + * PyMem_Free(self.nbeads) + * PyMem_Free(self.beadids) # <<<<<<<<<<<<<< + * PyMem_Free(self.cellids) + * + */ + PyMem_Free(__pyx_v_self->beadids); + + /* "MDAnalysis/lib/nsgrid.pyx":608 + * PyMem_Free(self.nbeads) + * PyMem_Free(self.beadids) + * PyMem_Free(self.cellids) # <<<<<<<<<<<<<< + * + * cdef ns_int coord2cellid(self, rvec coord) nogil: + */ + PyMem_Free(__pyx_v_self->cellids); + + /* "MDAnalysis/lib/nsgrid.pyx":605 + * self.nbeads[i] = 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * PyMem_Free(self.nbeads) + * PyMem_Free(self.beadids) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "MDAnalysis/lib/nsgrid.pyx":610 + * PyMem_Free(self.cellids) + * + * cdef ns_int coord2cellid(self, rvec coord) nogil: # <<<<<<<<<<<<<< + * """Finds the cell-id for the given coordinate inside the brick shaped box + * + */ + +static __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_coord2cellid(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *__pyx_v_coord) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_r; + + /* "MDAnalysis/lib/nsgrid.pyx":619 + * """ + * return (coord[ZZ] / self.cellsize[ZZ]) * (self.cell_offsets[ZZ]) +\ + * (coord[YY] / self.cellsize[YY]) * self.cell_offsets[YY] + \ # <<<<<<<<<<<<<< + * (coord[XX] / self.cellsize[XX]) + * + */ + __pyx_r = (((((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)((__pyx_v_coord[2]) / (__pyx_v_self->cellsize[2]))) * (__pyx_v_self->cell_offsets[2])) + (((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)((__pyx_v_coord[1]) / (__pyx_v_self->cellsize[1]))) * (__pyx_v_self->cell_offsets[1]))) + ((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)((__pyx_v_coord[0]) / (__pyx_v_self->cellsize[0])))); + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":610 + * PyMem_Free(self.cellids) + * + * cdef ns_int coord2cellid(self, rvec coord) nogil: # <<<<<<<<<<<<<< + * """Finds the cell-id for the given coordinate inside the brick shaped box + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":622 + * (coord[XX] / self.cellsize[XX]) + * + * cdef bint cellid2cellxyz(self, ns_int cellid, ivec cellxyz) nogil: # <<<<<<<<<<<<<< + * """Finds actual cell position `(x, y, z)` from a cell-id + * """ + */ + +static int __pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_cellid2cellxyz(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_cellid, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *__pyx_v_cellxyz) { + int __pyx_r; + int __pyx_t_1; + + /* "MDAnalysis/lib/nsgrid.pyx":626 + * """ + * + * if cellid < 0: # <<<<<<<<<<<<<< + * return False + * if cellid >= self.size: + */ + __pyx_t_1 = ((__pyx_v_cellid < 0) != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":627 + * + * if cellid < 0: + * return False # <<<<<<<<<<<<<< + * if cellid >= self.size: + * return False + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":626 + * """ + * + * if cellid < 0: # <<<<<<<<<<<<<< + * return False + * if cellid >= self.size: + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":628 + * if cellid < 0: + * return False + * if cellid >= self.size: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_1 = ((__pyx_v_cellid >= __pyx_v_self->size) != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":629 + * return False + * if cellid >= self.size: + * return False # <<<<<<<<<<<<<< + * + * cellxyz[ZZ] = (cellid / self.cell_offsets[ZZ]) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":628 + * if cellid < 0: + * return False + * if cellid >= self.size: # <<<<<<<<<<<<<< + * return False + * + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":631 + * return False + * + * cellxyz[ZZ] = (cellid / self.cell_offsets[ZZ]) # <<<<<<<<<<<<<< + * cellid -= cellxyz[ZZ] * self.cell_offsets[ZZ] + * + */ + (__pyx_v_cellxyz[2]) = ((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)(__pyx_v_cellid / (__pyx_v_self->cell_offsets[2]))); + + /* "MDAnalysis/lib/nsgrid.pyx":632 + * + * cellxyz[ZZ] = (cellid / self.cell_offsets[ZZ]) + * cellid -= cellxyz[ZZ] * self.cell_offsets[ZZ] # <<<<<<<<<<<<<< + * + * cellxyz[YY] = (cellid / self.cell_offsets[YY]) + */ + __pyx_v_cellid = (__pyx_v_cellid - ((__pyx_v_cellxyz[2]) * (__pyx_v_self->cell_offsets[2]))); + + /* "MDAnalysis/lib/nsgrid.pyx":634 + * cellid -= cellxyz[ZZ] * self.cell_offsets[ZZ] + * + * cellxyz[YY] = (cellid / self.cell_offsets[YY]) # <<<<<<<<<<<<<< + * cellxyz[XX] = cellid - cellxyz[YY] * self.cell_offsets[YY] + * + */ + (__pyx_v_cellxyz[1]) = ((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)(__pyx_v_cellid / (__pyx_v_self->cell_offsets[1]))); + + /* "MDAnalysis/lib/nsgrid.pyx":635 + * + * cellxyz[YY] = (cellid / self.cell_offsets[YY]) + * cellxyz[XX] = cellid - cellxyz[YY] * self.cell_offsets[YY] # <<<<<<<<<<<<<< + * + * return True + */ + (__pyx_v_cellxyz[0]) = (__pyx_v_cellid - ((__pyx_v_cellxyz[1]) * (__pyx_v_self->cell_offsets[1]))); + + /* "MDAnalysis/lib/nsgrid.pyx":637 + * cellxyz[XX] = cellid - cellxyz[YY] * self.cell_offsets[YY] + * + * return True # <<<<<<<<<<<<<< + * + * cdef fill_grid(self, real[:, ::1] coords): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":622 + * (coord[XX] / self.cellsize[XX]) + * + * cdef bint cellid2cellxyz(self, ns_int cellid, ivec cellxyz) nogil: # <<<<<<<<<<<<<< + * """Finds actual cell position `(x, y, z)` from a cell-id + * """ + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":639 + * return True + * + * cdef fill_grid(self, real[:, ::1] coords): # <<<<<<<<<<<<<< + * """Sorts atoms into cells based on their position in the brick shaped box + * + */ + +static PyObject *__pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_fill_grid(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, __Pyx_memviewslice __pyx_v_coords) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_cellindex; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_ncoords; + __Pyx_memviewslice __pyx_v_beadcounts = { 0, 0, { 0 }, { 0 }, { 0 } }; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_7; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_8; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_9; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_13; + int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + __Pyx_RefNannySetupContext("fill_grid", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":652 + * """ + * + * cdef ns_int i, cellindex = -1 # <<<<<<<<<<<<<< + * cdef ns_int ncoords = coords.shape[0] + * cdef ns_int[:] beadcounts = np.empty(self.size, dtype=np.int) + */ + __pyx_v_cellindex = -1L; + + /* "MDAnalysis/lib/nsgrid.pyx":653 + * + * cdef ns_int i, cellindex = -1 + * cdef ns_int ncoords = coords.shape[0] # <<<<<<<<<<<<<< + * cdef ns_int[:] beadcounts = np.empty(self.size, dtype=np.int) + * + */ + __pyx_v_ncoords = (__pyx_v_coords.shape[0]); + + /* "MDAnalysis/lib/nsgrid.pyx":654 + * cdef ns_int i, cellindex = -1 + * cdef ns_int ncoords = coords.shape[0] + * cdef ns_int[:] beadcounts = np.empty(self.size, dtype=np.int) # <<<<<<<<<<<<<< + * + * with nogil: + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_npy_long(__pyx_v_self->size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_beadcounts = __pyx_t_6; + __pyx_t_6.memview = NULL; + __pyx_t_6.data = NULL; + + /* "MDAnalysis/lib/nsgrid.pyx":656 + * cdef ns_int[:] beadcounts = np.empty(self.size, dtype=np.int) + * + * with nogil: # <<<<<<<<<<<<<< + * # Initialize buffers + * for i in range(self.size): + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "MDAnalysis/lib/nsgrid.pyx":658 + * with nogil: + * # Initialize buffers + * for i in range(self.size): # <<<<<<<<<<<<<< + * beadcounts[i] = 0 + * + */ + __pyx_t_7 = __pyx_v_self->size; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "MDAnalysis/lib/nsgrid.pyx":659 + * # Initialize buffers + * for i in range(self.size): + * beadcounts[i] = 0 # <<<<<<<<<<<<<< + * + * # First loop: find cellindex for each bead + */ + __pyx_t_10 = __pyx_v_i; + if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_beadcounts.shape[0]; + *((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *) ( /* dim=0 */ (__pyx_v_beadcounts.data + __pyx_t_10 * __pyx_v_beadcounts.strides[0]) )) = 0; + } + + /* "MDAnalysis/lib/nsgrid.pyx":662 + * + * # First loop: find cellindex for each bead + * for i in range(ncoords): # <<<<<<<<<<<<<< + * cellindex = self.coord2cellid(&coords[i, 0]) + * + */ + __pyx_t_7 = __pyx_v_ncoords; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "MDAnalysis/lib/nsgrid.pyx":663 + * # First loop: find cellindex for each bead + * for i in range(ncoords): + * cellindex = self.coord2cellid(&coords[i, 0]) # <<<<<<<<<<<<<< + * + * self.nbeads[cellindex] += 1 + */ + __pyx_t_11 = __pyx_v_i; + __pyx_t_12 = 0; + if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_coords.shape[0]; + if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_coords.shape[1]; + __pyx_v_cellindex = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self->__pyx_vtab)->coord2cellid(__pyx_v_self, (&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_coords.data + __pyx_t_11 * __pyx_v_coords.strides[0]) )) + __pyx_t_12)) ))))); + + /* "MDAnalysis/lib/nsgrid.pyx":665 + * cellindex = self.coord2cellid(&coords[i, 0]) + * + * self.nbeads[cellindex] += 1 # <<<<<<<<<<<<<< + * self.cellids[i] = cellindex + * + */ + __pyx_t_13 = __pyx_v_cellindex; + (__pyx_v_self->nbeads[__pyx_t_13]) = ((__pyx_v_self->nbeads[__pyx_t_13]) + 1); + + /* "MDAnalysis/lib/nsgrid.pyx":666 + * + * self.nbeads[cellindex] += 1 + * self.cellids[i] = cellindex # <<<<<<<<<<<<<< + * + * if self.nbeads[cellindex] > self.nbeads_per_cell: + */ + (__pyx_v_self->cellids[__pyx_v_i]) = __pyx_v_cellindex; + + /* "MDAnalysis/lib/nsgrid.pyx":668 + * self.cellids[i] = cellindex + * + * if self.nbeads[cellindex] > self.nbeads_per_cell: # <<<<<<<<<<<<<< + * self.nbeads_per_cell = self.nbeads[cellindex] + * + */ + __pyx_t_14 = (((__pyx_v_self->nbeads[__pyx_v_cellindex]) > __pyx_v_self->nbeads_per_cell) != 0); + if (__pyx_t_14) { + + /* "MDAnalysis/lib/nsgrid.pyx":669 + * + * if self.nbeads[cellindex] > self.nbeads_per_cell: + * self.nbeads_per_cell = self.nbeads[cellindex] # <<<<<<<<<<<<<< + * + * # Allocate memory + */ + __pyx_v_self->nbeads_per_cell = (__pyx_v_self->nbeads[__pyx_v_cellindex]); + + /* "MDAnalysis/lib/nsgrid.pyx":668 + * self.cellids[i] = cellindex + * + * if self.nbeads[cellindex] > self.nbeads_per_cell: # <<<<<<<<<<<<<< + * self.nbeads_per_cell = self.nbeads[cellindex] + * + */ + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":656 + * cdef ns_int[:] beadcounts = np.empty(self.size, dtype=np.int) + * + * with nogil: # <<<<<<<<<<<<<< + * # Initialize buffers + * for i in range(self.size): + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":672 + * + * # Allocate memory + * self.beadids = PyMem_Malloc(sizeof(ns_int) * self.size * self.nbeads_per_cell) # np.empty((self.size, nbeads_max), dtype=np.int) # <<<<<<<<<<<<<< + * if not self.beadids: + * raise MemoryError("Could not allocate memory for NSGrid.beadids ({} bits requested)".format(sizeof(ns_int) * self.size * self.nbeads_per_cell)) + */ + __pyx_v_self->beadids = ((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *)PyMem_Malloc((((sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)) * __pyx_v_self->size) * __pyx_v_self->nbeads_per_cell))); + + /* "MDAnalysis/lib/nsgrid.pyx":673 + * # Allocate memory + * self.beadids = PyMem_Malloc(sizeof(ns_int) * self.size * self.nbeads_per_cell) # np.empty((self.size, nbeads_max), dtype=np.int) + * if not self.beadids: # <<<<<<<<<<<<<< + * raise MemoryError("Could not allocate memory for NSGrid.beadids ({} bits requested)".format(sizeof(ns_int) * self.size * self.nbeads_per_cell)) + * + */ + __pyx_t_14 = ((!(__pyx_v_self->beadids != 0)) != 0); + if (unlikely(__pyx_t_14)) { + + /* "MDAnalysis/lib/nsgrid.pyx":674 + * self.beadids = PyMem_Malloc(sizeof(ns_int) * self.size * self.nbeads_per_cell) # np.empty((self.size, nbeads_max), dtype=np.int) + * if not self.beadids: + * raise MemoryError("Could not allocate memory for NSGrid.beadids ({} bits requested)".format(sizeof(ns_int) * self.size * self.nbeads_per_cell)) # <<<<<<<<<<<<<< + * + * with nogil: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Could_not_allocate_memory_for_NS, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_FromSize_t((((sizeof(__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)) * __pyx_v_self->size) * __pyx_v_self->nbeads_per_cell)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (!__pyx_t_2) { + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 674, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":673 + * # Allocate memory + * self.beadids = PyMem_Malloc(sizeof(ns_int) * self.size * self.nbeads_per_cell) # np.empty((self.size, nbeads_max), dtype=np.int) + * if not self.beadids: # <<<<<<<<<<<<<< + * raise MemoryError("Could not allocate memory for NSGrid.beadids ({} bits requested)".format(sizeof(ns_int) * self.size * self.nbeads_per_cell)) + * + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":676 + * raise MemoryError("Could not allocate memory for NSGrid.beadids ({} bits requested)".format(sizeof(ns_int) * self.size * self.nbeads_per_cell)) + * + * with nogil: # <<<<<<<<<<<<<< + * # Second loop: fill grid + * for i in range(ncoords): + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "MDAnalysis/lib/nsgrid.pyx":678 + * with nogil: + * # Second loop: fill grid + * for i in range(ncoords): # <<<<<<<<<<<<<< + * + * # Add bead to grid cell + */ + __pyx_t_7 = __pyx_v_ncoords; + __pyx_t_8 = __pyx_t_7; + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { + __pyx_v_i = __pyx_t_9; + + /* "MDAnalysis/lib/nsgrid.pyx":681 + * + * # Add bead to grid cell + * cellindex = self.cellids[i] # <<<<<<<<<<<<<< + * self.beadids[cellindex * self.nbeads_per_cell + beadcounts[cellindex]] = i + * beadcounts[cellindex] += 1 + */ + __pyx_v_cellindex = (__pyx_v_self->cellids[__pyx_v_i]); + + /* "MDAnalysis/lib/nsgrid.pyx":682 + * # Add bead to grid cell + * cellindex = self.cellids[i] + * self.beadids[cellindex * self.nbeads_per_cell + beadcounts[cellindex]] = i # <<<<<<<<<<<<<< + * beadcounts[cellindex] += 1 + * + */ + __pyx_t_15 = __pyx_v_cellindex; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_beadcounts.shape[0]; + (__pyx_v_self->beadids[((__pyx_v_cellindex * __pyx_v_self->nbeads_per_cell) + (*((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *) ( /* dim=0 */ (__pyx_v_beadcounts.data + __pyx_t_15 * __pyx_v_beadcounts.strides[0]) ))))]) = __pyx_v_i; + + /* "MDAnalysis/lib/nsgrid.pyx":683 + * cellindex = self.cellids[i] + * self.beadids[cellindex * self.nbeads_per_cell + beadcounts[cellindex]] = i + * beadcounts[cellindex] += 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_16 = __pyx_v_cellindex; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_beadcounts.shape[0]; + *((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *) ( /* dim=0 */ (__pyx_v_beadcounts.data + __pyx_t_16 * __pyx_v_beadcounts.strides[0]) )) += 1; + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":676 + * raise MemoryError("Could not allocate memory for NSGrid.beadids ({} bits requested)".format(sizeof(ns_int) * self.size * self.nbeads_per_cell)) + * + * with nogil: # <<<<<<<<<<<<<< + * # Second loop: fill grid + * for i in range(ncoords): + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L14; + } + __pyx_L14:; + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":639 + * return True + * + * cdef fill_grid(self, real[:, ::1] coords): # <<<<<<<<<<<<<< + * """Sorts atoms into cells based on their position in the brick shaped box + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSGrid.fill_grid", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __PYX_XDEC_MEMVIEW(&__pyx_v_beadcounts, 1); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":537 + * """ + * + * cdef readonly real cutoff # cutoff # <<<<<<<<<<<<<< + * cdef ns_int size # total cells + * cdef ns_int ncoords # number of coordinates + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_6cutoff_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_6cutoff_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_6cutoff___get__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_6cutoff___get__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSGrid.cutoff.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6NSGrid_4__reduce_cython__[] = "NSGrid.__reduce_cython__(self)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_4__reduce_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSGrid.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6NSGrid_6__setstate_cython__[] = "NSGrid.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_6__setstate_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6NSGrid_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.NSGrid.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":704 + * cdef bint periodic + * + * def __init__(self, cutoff, coords, box, max_gridsize=5000, pbc=True): # <<<<<<<<<<<<<< + * """ + * Initialize the grid and sort the coordinates in respective + */ + +/* Python wrapper */ +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS___init__[] = "\n Initialize the grid and sort the coordinates in respective\n cells by shifting the coordinates in a brick shaped box.\n The brick shaped box is defined by :class:`PBCBox`\n and cuboidal grid is initialize by :class:`NSGrid`.\n If box is supplied, periodic shifts along box vectors are used\n to contain all the coordinates inside the brick shaped box.\n If box is not supplied, the range of coordinates i.e.\n ``[xmax, ymax, zmax] - [xmin, ymin, zmin]`` should be used\n to construct a pseudo box. Subsequently, the origin should also be\n shifted to ``[xmin, ymin, zmin]``. These arguments must be provided\n to the function.\n\n Parameters\n ----------\n cutoff : float\n Desired cutoff distance\n coords : numpy.ndarray\n atom coordinates of shape ``(N, 3)`` for ``N`` atoms.\n ``dtype=numpy.float32``. For Non-PBC calculations,\n all the coords must be within the bounding box specified\n by ``box``\n box : numpy.ndarray\n Box dimension of shape (6, ). The dimensions must be\n provided in the same format as returned\n by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`:\n ``[lx, ly, lz, alpha, beta, gamma]``. For non-PBC\n evaluations, provide an orthogonal bounding box\n (dtype = numpy.float32)\n max_gridsize : int\n maximum number of cells in the grid. This parameter\n can be tuned for superior performance.\n pbc : boolean\n Handle to switch periodic boundary conditions on/off [True]\n\n Note\n ----\n * ``pbc=False`` Only works for orthogonal boxes.\n * Care must be taken such that all particles are inside\n the bounding box as defined by the box argument for non-PBC\n calculations.\n * In case of Non-PBC calculations, a bounding box mu""st be provided\n to encompass all the coordinates as well as the search coordinates.\n The dimension should be similar to ``box`` argument but for\n an orthogonal box. For instance, one valid set of argument\n for ``box`` for the case of no PBC could be\n ``[10, 10, 10, 90, 90, 90]``\n * Following operations are advisable for non-PBC calculations\n\n ..code-block:: python\n\n lmax = all_coords.max(axis=0)\n lmin = all_coords.min(axis=0)\n pseudobox[:3] = 1.1*(lmax - lmin)\n pseudobox[3:] = 90.\n shift = all_coords.copy()\n shift -= lmin\n gridsearch = FastNS(max_cutoff, shift, box=pseudobox, pbc=False)\n\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6FastNS___init__; +#endif +static int __pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cutoff = 0; + PyObject *__pyx_v_coords = 0; + PyObject *__pyx_v_box = 0; + PyObject *__pyx_v_max_gridsize = 0; + PyObject *__pyx_v_pbc = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cutoff,&__pyx_n_s_coords,&__pyx_n_s_box,&__pyx_n_s_max_gridsize,&__pyx_n_s_pbc,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_int_5000); + values[4] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 704, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_box)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 704, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_gridsize); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pbc); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 704, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_cutoff = values[0]; + __pyx_v_coords = values[1]; + __pyx_v_box = values[2]; + __pyx_v_max_gridsize = values[3]; + __pyx_v_pbc = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 704, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.FastNS.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS___init__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)__pyx_v_self), __pyx_v_cutoff, __pyx_v_coords, __pyx_v_box, __pyx_v_max_gridsize, __pyx_v_pbc); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS___init__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_coords, PyObject *__pyx_v_box, PyObject *__pyx_v_max_gridsize, PyObject *__pyx_v_pbc) { + PyObject *__pyx_v_triclinic_vectors = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_10; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_11; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_box); + + /* "MDAnalysis/lib/nsgrid.pyx":766 + * """ + * + * from MDAnalysis.lib.mdamath import triclinic_vectors # <<<<<<<<<<<<<< + * + * if (coords.ndim != 2 or coords.shape[1] != 3): + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_triclinic_vectors); + __Pyx_GIVEREF(__pyx_n_s_triclinic_vectors); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_triclinic_vectors); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_MDAnalysis_lib_mdamath, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_triclinic_vectors); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_triclinic_vectors = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":768 + * from MDAnalysis.lib.mdamath import triclinic_vectors + * + * if (coords.ndim != 2 or coords.shape[1] != 3): # <<<<<<<<<<<<<< + * raise ValueError("coords must have a shape of (n, 3), got {}." + * "".format(coords.shape)) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_4) { + } else { + __pyx_t_3 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_3)) { + + /* "MDAnalysis/lib/nsgrid.pyx":770 + * if (coords.ndim != 2 or coords.shape[1] != 3): + * raise ValueError("coords must have a shape of (n, 3), got {}." + * "".format(coords.shape)) # <<<<<<<<<<<<<< + * + * if np.allclose(box[:3], 0.0): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_coords_must_have_a_shape_of_n_3, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":769 + * + * if (coords.ndim != 2 or coords.shape[1] != 3): + * raise ValueError("coords must have a shape of (n, 3), got {}." # <<<<<<<<<<<<<< + * "".format(coords.shape)) + * + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 769, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":768 + * from MDAnalysis.lib.mdamath import triclinic_vectors + * + * if (coords.ndim != 2 or coords.shape[1] != 3): # <<<<<<<<<<<<<< + * raise ValueError("coords must have a shape of (n, 3), got {}." + * "".format(coords.shape)) + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":772 + * "".format(coords.shape)) + * + * if np.allclose(box[:3], 0.0): # <<<<<<<<<<<<<< + * raise ValueError("Any of the box dimensions cannot be 0") + * + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_allclose); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_box, 0, 3, NULL, NULL, &__pyx_slice__6, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_float_0_0}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_float_0_0}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_t_1); + __Pyx_INCREF(__pyx_float_0_0); + __Pyx_GIVEREF(__pyx_float_0_0); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_float_0_0); + __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3)) { + + /* "MDAnalysis/lib/nsgrid.pyx":773 + * + * if np.allclose(box[:3], 0.0): + * raise ValueError("Any of the box dimensions cannot be 0") # <<<<<<<<<<<<<< + * + * self.periodic = pbc + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 773, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":772 + * "".format(coords.shape)) + * + * if np.allclose(box[:3], 0.0): # <<<<<<<<<<<<<< + * raise ValueError("Any of the box dimensions cannot be 0") + * + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":775 + * raise ValueError("Any of the box dimensions cannot be 0") + * + * self.periodic = pbc # <<<<<<<<<<<<<< + * self.coords = coords.astype(np.float32, order='C', copy=True) + * + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_pbc); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 775, __pyx_L1_error) + __pyx_v_self->periodic = __pyx_t_3; + + /* "MDAnalysis/lib/nsgrid.pyx":776 + * + * self.periodic = pbc + * self.coords = coords.astype(np.float32, order='C', copy=True) # <<<<<<<<<<<<<< + * + * if box.shape != (3, 3): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 776, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_XDEC_MEMVIEW(&__pyx_v_self->coords, 0); + __pyx_v_self->coords = __pyx_t_9; + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + + /* "MDAnalysis/lib/nsgrid.pyx":778 + * self.coords = coords.astype(np.float32, order='C', copy=True) + * + * if box.shape != (3, 3): # <<<<<<<<<<<<<< + * box = triclinic_vectors(box) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_box, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__8, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_3) { + + /* "MDAnalysis/lib/nsgrid.pyx":779 + * + * if box.shape != (3, 3): + * box = triclinic_vectors(box) # <<<<<<<<<<<<<< + * + * self.box = PBCBox(box, self.periodic) + */ + __Pyx_INCREF(__pyx_v_triclinic_vectors); + __pyx_t_1 = __pyx_v_triclinic_vectors; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + if (!__pyx_t_7) { + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_box); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_box}; + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_6); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_box}; + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_6); + } else + #endif + { + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL; + __Pyx_INCREF(__pyx_v_box); + __Pyx_GIVEREF(__pyx_v_box); + PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_box); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_box, __pyx_t_6); + __pyx_t_6 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":778 + * self.coords = coords.astype(np.float32, order='C', copy=True) + * + * if box.shape != (3, 3): # <<<<<<<<<<<<<< + * box = triclinic_vectors(box) + * + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":781 + * box = triclinic_vectors(box) + * + * self.box = PBCBox(box, self.periodic) # <<<<<<<<<<<<<< + * + * if cutoff < 0: + */ + __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->periodic); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_box); + __Pyx_GIVEREF(__pyx_v_box); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_box); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10MDAnalysis_3lib_6nsgrid_PBCBox), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->box); + __Pyx_DECREF(((PyObject *)__pyx_v_self->box)); + __pyx_v_self->box = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":783 + * self.box = PBCBox(box, self.periodic) + * + * if cutoff < 0: # <<<<<<<<<<<<<< + * raise ValueError("Cutoff must be positive!") + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: + */ + __pyx_t_6 = PyObject_RichCompare(__pyx_v_cutoff, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 783, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 783, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_t_3)) { + + /* "MDAnalysis/lib/nsgrid.pyx":784 + * + * if cutoff < 0: + * raise ValueError("Cutoff must be positive!") # <<<<<<<<<<<<<< + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: + * raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(0, 784, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":783 + * self.box = PBCBox(box, self.periodic) + * + * if cutoff < 0: # <<<<<<<<<<<<<< + * raise ValueError("Cutoff must be positive!") + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":785 + * if cutoff < 0: + * raise ValueError("Cutoff must be positive!") + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: # <<<<<<<<<<<<<< + * raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") + * + */ + __pyx_t_6 = PyNumber_Multiply(__pyx_v_cutoff, __pyx_v_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->box->c_pbcbox.max_cutoff2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 785, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3)) { + + /* "MDAnalysis/lib/nsgrid.pyx":786 + * raise ValueError("Cutoff must be positive!") + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: + * raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") # <<<<<<<<<<<<<< + * + * self.coords_bbox = self.box.fast_put_atoms_in_bbox(self.coords) + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 786, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":785 + * if cutoff < 0: + * raise ValueError("Cutoff must be positive!") + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: # <<<<<<<<<<<<<< + * raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") + * + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":788 + * raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") + * + * self.coords_bbox = self.box.fast_put_atoms_in_bbox(self.coords) # <<<<<<<<<<<<<< + * + * self.cutoff = cutoff + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self->box->__pyx_vtab)->fast_put_atoms_in_bbox(__pyx_v_self->box, __pyx_v_self->coords); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 788, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v_self->coords_bbox, 0); + __pyx_v_self->coords_bbox = __pyx_t_9; + __pyx_t_9.memview = NULL; + __pyx_t_9.data = NULL; + + /* "MDAnalysis/lib/nsgrid.pyx":790 + * self.coords_bbox = self.box.fast_put_atoms_in_bbox(self.coords) + * + * self.cutoff = cutoff # <<<<<<<<<<<<<< + * self.max_gridsize = max_gridsize + * # Note that self.cutoff might be different from self.grid.cutoff + */ + __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_v_cutoff); if (unlikely((__pyx_t_10 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_v_self->cutoff = __pyx_t_10; + + /* "MDAnalysis/lib/nsgrid.pyx":791 + * + * self.cutoff = cutoff + * self.max_gridsize = max_gridsize # <<<<<<<<<<<<<< + * # Note that self.cutoff might be different from self.grid.cutoff + * # due to optimization + */ + __pyx_t_11 = __Pyx_PyInt_As_npy_long(__pyx_v_max_gridsize); if (unlikely((__pyx_t_11 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_v_self->max_gridsize = __pyx_t_11; + + /* "MDAnalysis/lib/nsgrid.pyx":794 + * # Note that self.cutoff might be different from self.grid.cutoff + * # due to optimization + * self.grid = NSGrid(self.coords_bbox.shape[0], self.cutoff, self.box, self.max_gridsize) # <<<<<<<<<<<<<< + * + * self.grid.fill_grid(self.coords_bbox) + */ + __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_self->coords_bbox.shape[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyInt_From_npy_long(__pyx_v_self->max_gridsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->box)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->box)); + PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_self->box)); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSGrid), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->grid); + __Pyx_DECREF(((PyObject *)__pyx_v_self->grid)); + __pyx_v_self->grid = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_t_6); + __pyx_t_6 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":796 + * self.grid = NSGrid(self.coords_bbox.shape[0], self.cutoff, self.box, self.max_gridsize) + * + * self.grid.fill_grid(self.coords_bbox) # <<<<<<<<<<<<<< + * + * def search(self, search_coords): + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self->grid->__pyx_vtab)->fill_grid(__pyx_v_self->grid, __pyx_v_self->coords_bbox); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":704 + * cdef bint periodic + * + * def __init__(self, cutoff, coords, box, max_gridsize=5000, pbc=True): # <<<<<<<<<<<<<< + * """ + * Initialize the grid and sort the coordinates in respective + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.FastNS.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_triclinic_vectors); + __Pyx_XDECREF(__pyx_v_box); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":798 + * self.grid.fill_grid(self.coords_bbox) + * + * def search(self, search_coords): # <<<<<<<<<<<<<< + * """Search a group of atoms against initialized coordinates + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_3search(PyObject *__pyx_v_self, PyObject *__pyx_v_search_coords); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_2search[] = "FastNS.search(self, search_coords)\nSearch a group of atoms against initialized coordinates\n\n Creates a new grid with the query atoms and searches\n against the initialized coordinates. The search is exclusive\n i.e. only the pairs ``(i, j)`` such that ``atom[i]`` from query atoms\n and ``atom[j]`` from the initialized set of coordinates is stored as\n neighbors.\n\n PBC-aware/non PBC-aware calculations are automatically enabled during\n the instantiation of :class:FastNS.\n\n Parameters\n ----------\n search_coords : numpy.ndarray\n Query coordinates of shape ``(N, 3)`` where\n ``N`` is the number of queries\n\n Returns\n -------\n results : NSResults object\n The object from :class:NSResults\n contains ``get_indices``, ``get_distances``.\n ``get_pairs``, ``get_pair_distances``\n\n Note\n ----\n For non-PBC aware calculations, the current implementation doesn't work\n if any of the query coordinates is beyond the range specified in\n ``box`` in :func:`MDAnalysis.lib.nsgrid.FastNS`.\n\n See Also\n --------\n MDAnalysis.lib.nsgrid.NSResults\n\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_3search(PyObject *__pyx_v_self, PyObject *__pyx_v_search_coords) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("search (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_2search(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)__pyx_v_self), ((PyObject *)__pyx_v_search_coords)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_2search(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self, PyObject *__pyx_v_search_coords) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_j; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_size_search; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_d; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_m; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_current_beadid; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_bid; + CYTHON_UNUSED __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_cellindex; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_cellindex_probe; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_xi; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_yi; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_zi; + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_results = 0; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_d2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_rvec __pyx_v_probe; + __Pyx_memviewslice __pyx_v_searchcoords = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_memviewslice __pyx_v_searchcoords_bbox = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *__pyx_v_searchgrid = 0; + int __pyx_v_check; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_cutoff2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_npairs; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_9; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_10; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_11; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_12; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_13; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + Py_ssize_t __pyx_t_17; + Py_ssize_t __pyx_t_18; + Py_ssize_t __pyx_t_19; + Py_ssize_t __pyx_t_20; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_21; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_22; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_23; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_24; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_25; + Py_ssize_t __pyx_t_26; + Py_ssize_t __pyx_t_27; + Py_ssize_t __pyx_t_28; + Py_ssize_t __pyx_t_29; + __Pyx_RefNannySetupContext("search", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":851 + * cdef bint check + * + * cdef real cutoff2 = self.cutoff * self.cutoff # <<<<<<<<<<<<<< + * cdef ns_int npairs = 0 + * + */ + __pyx_v_cutoff2 = (__pyx_v_self->cutoff * __pyx_v_self->cutoff); + + /* "MDAnalysis/lib/nsgrid.pyx":852 + * + * cdef real cutoff2 = self.cutoff * self.cutoff + * cdef ns_int npairs = 0 # <<<<<<<<<<<<<< + * + * if (search_coords.ndim != 2 or search_coords.shape[1] != 3): + */ + __pyx_v_npairs = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":854 + * cdef ns_int npairs = 0 + * + * if (search_coords.ndim != 2 or search_coords.shape[1] != 3): # <<<<<<<<<<<<<< + * raise ValueError("search_coords must have a shape of (n, 3), got " + * "{}.".format(search_coords.shape)) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_search_coords, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_4) { + } else { + __pyx_t_1 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_search_coords, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "MDAnalysis/lib/nsgrid.pyx":856 + * if (search_coords.ndim != 2 or search_coords.shape[1] != 3): + * raise ValueError("search_coords must have a shape of (n, 3), got " + * "{}.".format(search_coords.shape)) # <<<<<<<<<<<<<< + * + * # Generate another grid to search + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_search_coords_must_have_a_shape, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_search_coords, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_6) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":855 + * + * if (search_coords.ndim != 2 or search_coords.shape[1] != 3): + * raise ValueError("search_coords must have a shape of (n, 3), got " # <<<<<<<<<<<<<< + * "{}.".format(search_coords.shape)) + * + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 855, __pyx_L1_error) + + /* "MDAnalysis/lib/nsgrid.pyx":854 + * cdef ns_int npairs = 0 + * + * if (search_coords.ndim != 2 or search_coords.shape[1] != 3): # <<<<<<<<<<<<<< + * raise ValueError("search_coords must have a shape of (n, 3), got " + * "{}.".format(search_coords.shape)) + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":859 + * + * # Generate another grid to search + * searchcoords = search_coords.astype(np.float32, order='C', copy=False) # <<<<<<<<<<<<<< + * searchcoords_bbox = self.box.fast_put_atoms_in_bbox(searchcoords) + * searchgrid = NSGrid(searchcoords_bbox.shape[0], self.grid.cutoff, self.box, self.max_gridsize, force=True) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_search_coords, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 859, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_searchcoords = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "MDAnalysis/lib/nsgrid.pyx":860 + * # Generate another grid to search + * searchcoords = search_coords.astype(np.float32, order='C', copy=False) + * searchcoords_bbox = self.box.fast_put_atoms_in_bbox(searchcoords) # <<<<<<<<<<<<<< + * searchgrid = NSGrid(searchcoords_bbox.shape[0], self.grid.cutoff, self.box, self.max_gridsize, force=True) + * searchgrid.fill_grid(searchcoords_bbox) + */ + __pyx_t_8 = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self->box->__pyx_vtab)->fast_put_atoms_in_bbox(__pyx_v_self->box, __pyx_v_searchcoords); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_v_searchcoords_bbox = __pyx_t_8; + __pyx_t_8.memview = NULL; + __pyx_t_8.data = NULL; + + /* "MDAnalysis/lib/nsgrid.pyx":861 + * searchcoords = search_coords.astype(np.float32, order='C', copy=False) + * searchcoords_bbox = self.box.fast_put_atoms_in_bbox(searchcoords) + * searchgrid = NSGrid(searchcoords_bbox.shape[0], self.grid.cutoff, self.box, self.max_gridsize, force=True) # <<<<<<<<<<<<<< + * searchgrid.fill_grid(searchcoords_bbox) + * + */ + __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_searchcoords_bbox.shape[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->grid->cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyInt_From_npy_long(__pyx_v_self->max_gridsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_self->box)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->box)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_self->box)); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_7 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_force, Py_True) < 0) __PYX_ERR(0, 861, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSGrid), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_searchgrid = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_t_7); + __pyx_t_7 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":862 + * searchcoords_bbox = self.box.fast_put_atoms_in_bbox(searchcoords) + * searchgrid = NSGrid(searchcoords_bbox.shape[0], self.grid.cutoff, self.box, self.max_gridsize, force=True) + * searchgrid.fill_grid(searchcoords_bbox) # <<<<<<<<<<<<<< + * + * size_search = searchcoords.shape[0] + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_searchgrid->__pyx_vtab)->fill_grid(__pyx_v_searchgrid, __pyx_v_searchcoords_bbox); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":864 + * searchgrid.fill_grid(searchcoords_bbox) + * + * size_search = searchcoords.shape[0] # <<<<<<<<<<<<<< + * + * results = NSResults(self.cutoff, self.coords, searchcoords) + */ + __pyx_v_size_search = (__pyx_v_searchcoords.shape[0]); + + /* "MDAnalysis/lib/nsgrid.pyx":866 + * size_search = searchcoords.shape[0] + * + * results = NSResults(self.cutoff, self.coords, searchcoords) # <<<<<<<<<<<<<< + * + * with nogil: + */ + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_searchcoords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSResults), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_results = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":868 + * results = NSResults(self.cutoff, self.coords, searchcoords) + * + * with nogil: # <<<<<<<<<<<<<< + * for i in range(size_search): + * # Start with first search coordinate + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "MDAnalysis/lib/nsgrid.pyx":869 + * + * with nogil: + * for i in range(size_search): # <<<<<<<<<<<<<< + * # Start with first search coordinate + * current_beadid = i + */ + __pyx_t_9 = __pyx_v_size_search; + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "MDAnalysis/lib/nsgrid.pyx":871 + * for i in range(size_search): + * # Start with first search coordinate + * current_beadid = i # <<<<<<<<<<<<<< + * # find the cellindex of the coordinate + * cellindex = searchgrid.cellids[current_beadid] + */ + __pyx_v_current_beadid = __pyx_v_i; + + /* "MDAnalysis/lib/nsgrid.pyx":873 + * current_beadid = i + * # find the cellindex of the coordinate + * cellindex = searchgrid.cellids[current_beadid] # <<<<<<<<<<<<<< + * for xi in range(DIM): + * for yi in range(DIM): + */ + __pyx_v_cellindex = (__pyx_v_searchgrid->cellids[__pyx_v_current_beadid]); + + /* "MDAnalysis/lib/nsgrid.pyx":874 + * # find the cellindex of the coordinate + * cellindex = searchgrid.cellids[current_beadid] + * for xi in range(DIM): # <<<<<<<<<<<<<< + * for yi in range(DIM): + * for zi in range(DIM): + */ + for (__pyx_t_12 = 0; __pyx_t_12 < 3; __pyx_t_12+=1) { + __pyx_v_xi = __pyx_t_12; + + /* "MDAnalysis/lib/nsgrid.pyx":875 + * cellindex = searchgrid.cellids[current_beadid] + * for xi in range(DIM): + * for yi in range(DIM): # <<<<<<<<<<<<<< + * for zi in range(DIM): + * check = True + */ + for (__pyx_t_13 = 0; __pyx_t_13 < 3; __pyx_t_13+=1) { + __pyx_v_yi = __pyx_t_13; + + /* "MDAnalysis/lib/nsgrid.pyx":876 + * for xi in range(DIM): + * for yi in range(DIM): + * for zi in range(DIM): # <<<<<<<<<<<<<< + * check = True + * #Probe the search coordinates in a brick shaped box + */ + for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) { + __pyx_v_zi = __pyx_t_14; + + /* "MDAnalysis/lib/nsgrid.pyx":877 + * for yi in range(DIM): + * for zi in range(DIM): + * check = True # <<<<<<<<<<<<<< + * #Probe the search coordinates in a brick shaped box + * probe[XX] = searchcoords_bbox[current_beadid, XX] + (xi - 1) * searchgrid.cellsize[XX] + */ + __pyx_v_check = 1; + + /* "MDAnalysis/lib/nsgrid.pyx":879 + * check = True + * #Probe the search coordinates in a brick shaped box + * probe[XX] = searchcoords_bbox[current_beadid, XX] + (xi - 1) * searchgrid.cellsize[XX] # <<<<<<<<<<<<<< + * probe[YY] = searchcoords_bbox[current_beadid, YY] + (yi - 1) * searchgrid.cellsize[YY] + * probe[ZZ] = searchcoords_bbox[current_beadid, ZZ] + (zi - 1) * searchgrid.cellsize[ZZ] + */ + __pyx_t_15 = __pyx_v_current_beadid; + __pyx_t_16 = 0; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_searchcoords_bbox.shape[0]; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_searchcoords_bbox.shape[1]; + (__pyx_v_probe[0]) = ((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_searchcoords_bbox.data + __pyx_t_15 * __pyx_v_searchcoords_bbox.strides[0]) )) + __pyx_t_16)) ))) + ((__pyx_v_xi - 1) * (__pyx_v_searchgrid->cellsize[0]))); + + /* "MDAnalysis/lib/nsgrid.pyx":880 + * #Probe the search coordinates in a brick shaped box + * probe[XX] = searchcoords_bbox[current_beadid, XX] + (xi - 1) * searchgrid.cellsize[XX] + * probe[YY] = searchcoords_bbox[current_beadid, YY] + (yi - 1) * searchgrid.cellsize[YY] # <<<<<<<<<<<<<< + * probe[ZZ] = searchcoords_bbox[current_beadid, ZZ] + (zi - 1) * searchgrid.cellsize[ZZ] + * # Make sure the probe coordinates is inside the brick-shaped box + */ + __pyx_t_17 = __pyx_v_current_beadid; + __pyx_t_18 = 1; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_v_searchcoords_bbox.shape[0]; + if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_v_searchcoords_bbox.shape[1]; + (__pyx_v_probe[1]) = ((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_searchcoords_bbox.data + __pyx_t_17 * __pyx_v_searchcoords_bbox.strides[0]) )) + __pyx_t_18)) ))) + ((__pyx_v_yi - 1) * (__pyx_v_searchgrid->cellsize[1]))); + + /* "MDAnalysis/lib/nsgrid.pyx":881 + * probe[XX] = searchcoords_bbox[current_beadid, XX] + (xi - 1) * searchgrid.cellsize[XX] + * probe[YY] = searchcoords_bbox[current_beadid, YY] + (yi - 1) * searchgrid.cellsize[YY] + * probe[ZZ] = searchcoords_bbox[current_beadid, ZZ] + (zi - 1) * searchgrid.cellsize[ZZ] # <<<<<<<<<<<<<< + * # Make sure the probe coordinates is inside the brick-shaped box + * if self.periodic: + */ + __pyx_t_19 = __pyx_v_current_beadid; + __pyx_t_20 = 2; + if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_v_searchcoords_bbox.shape[0]; + if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_v_searchcoords_bbox.shape[1]; + (__pyx_v_probe[2]) = ((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_searchcoords_bbox.data + __pyx_t_19 * __pyx_v_searchcoords_bbox.strides[0]) )) + __pyx_t_20)) ))) + ((__pyx_v_zi - 1) * (__pyx_v_searchgrid->cellsize[2]))); + + /* "MDAnalysis/lib/nsgrid.pyx":883 + * probe[ZZ] = searchcoords_bbox[current_beadid, ZZ] + (zi - 1) * searchgrid.cellsize[ZZ] + * # Make sure the probe coordinates is inside the brick-shaped box + * if self.periodic: # <<<<<<<<<<<<<< + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: + */ + __pyx_t_1 = (__pyx_v_self->periodic != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":884 + * # Make sure the probe coordinates is inside the brick-shaped box + * if self.periodic: + * for m in range(DIM - 1, -1, -1): # <<<<<<<<<<<<<< + * while probe[m] < 0: + * for d in range(m+1): + */ + for (__pyx_t_21 = 2; __pyx_t_21 > -1L; __pyx_t_21-=1) { + __pyx_v_m = __pyx_t_21; + + /* "MDAnalysis/lib/nsgrid.pyx":885 + * if self.periodic: + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: # <<<<<<<<<<<<<< + * for d in range(m+1): + * probe[d] += self.box.c_pbcbox.box[m][d] + */ + while (1) { + __pyx_t_1 = (((__pyx_v_probe[__pyx_v_m]) < 0.0) != 0); + if (!__pyx_t_1) break; + + /* "MDAnalysis/lib/nsgrid.pyx":886 + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: + * for d in range(m+1): # <<<<<<<<<<<<<< + * probe[d] += self.box.c_pbcbox.box[m][d] + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + */ + __pyx_t_22 = (__pyx_v_m + 1); + __pyx_t_23 = __pyx_t_22; + for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { + __pyx_v_d = __pyx_t_24; + + /* "MDAnalysis/lib/nsgrid.pyx":887 + * while probe[m] < 0: + * for d in range(m+1): + * probe[d] += self.box.c_pbcbox.box[m][d] # <<<<<<<<<<<<<< + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + * for d in range(m+1): + */ + __pyx_t_25 = __pyx_v_d; + (__pyx_v_probe[__pyx_t_25]) = ((__pyx_v_probe[__pyx_t_25]) + ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_d])); + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":888 + * for d in range(m+1): + * probe[d] += self.box.c_pbcbox.box[m][d] + * while probe[m] >= self.box.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * for d in range(m+1): + * probe[d] -= self.box.c_pbcbox.box[m][d] + */ + while (1) { + __pyx_t_1 = (((__pyx_v_probe[__pyx_v_m]) >= ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_m])) != 0); + if (!__pyx_t_1) break; + + /* "MDAnalysis/lib/nsgrid.pyx":889 + * probe[d] += self.box.c_pbcbox.box[m][d] + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + * for d in range(m+1): # <<<<<<<<<<<<<< + * probe[d] -= self.box.c_pbcbox.box[m][d] + * else: + */ + __pyx_t_22 = (__pyx_v_m + 1); + __pyx_t_23 = __pyx_t_22; + for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) { + __pyx_v_d = __pyx_t_24; + + /* "MDAnalysis/lib/nsgrid.pyx":890 + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + * for d in range(m+1): + * probe[d] -= self.box.c_pbcbox.box[m][d] # <<<<<<<<<<<<<< + * else: + * for m in range(DIM -1, -1, -1): + */ + __pyx_t_25 = __pyx_v_d; + (__pyx_v_probe[__pyx_t_25]) = ((__pyx_v_probe[__pyx_t_25]) - ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_d])); + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":883 + * probe[ZZ] = searchcoords_bbox[current_beadid, ZZ] + (zi - 1) * searchgrid.cellsize[ZZ] + * # Make sure the probe coordinates is inside the brick-shaped box + * if self.periodic: # <<<<<<<<<<<<<< + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: + */ + goto __pyx_L17; + } + + /* "MDAnalysis/lib/nsgrid.pyx":892 + * probe[d] -= self.box.c_pbcbox.box[m][d] + * else: + * for m in range(DIM -1, -1, -1): # <<<<<<<<<<<<<< + * if probe[m] < 0: + * check = False + */ + /*else*/ { + for (__pyx_t_21 = 2; __pyx_t_21 > -1L; __pyx_t_21-=1) { + __pyx_v_m = __pyx_t_21; + + /* "MDAnalysis/lib/nsgrid.pyx":893 + * else: + * for m in range(DIM -1, -1, -1): + * if probe[m] < 0: # <<<<<<<<<<<<<< + * check = False + * break + */ + __pyx_t_1 = (((__pyx_v_probe[__pyx_v_m]) < 0.0) != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":894 + * for m in range(DIM -1, -1, -1): + * if probe[m] < 0: + * check = False # <<<<<<<<<<<<<< + * break + * if probe[m] > self.box.c_pbcbox.box[m][m]: + */ + __pyx_v_check = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":895 + * if probe[m] < 0: + * check = False + * break # <<<<<<<<<<<<<< + * if probe[m] > self.box.c_pbcbox.box[m][m]: + * check = False + */ + goto __pyx_L29_break; + + /* "MDAnalysis/lib/nsgrid.pyx":893 + * else: + * for m in range(DIM -1, -1, -1): + * if probe[m] < 0: # <<<<<<<<<<<<<< + * check = False + * break + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":896 + * check = False + * break + * if probe[m] > self.box.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * check = False + * break + */ + __pyx_t_1 = (((__pyx_v_probe[__pyx_v_m]) > ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_m])) != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":897 + * break + * if probe[m] > self.box.c_pbcbox.box[m][m]: + * check = False # <<<<<<<<<<<<<< + * break + * if not check: + */ + __pyx_v_check = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":898 + * if probe[m] > self.box.c_pbcbox.box[m][m]: + * check = False + * break # <<<<<<<<<<<<<< + * if not check: + * continue + */ + goto __pyx_L29_break; + + /* "MDAnalysis/lib/nsgrid.pyx":896 + * check = False + * break + * if probe[m] > self.box.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * check = False + * break + */ + } + } + __pyx_L29_break:; + } + __pyx_L17:; + + /* "MDAnalysis/lib/nsgrid.pyx":899 + * check = False + * break + * if not check: # <<<<<<<<<<<<<< + * continue + * # Get the cell index corresponding to the probe + */ + __pyx_t_1 = ((!(__pyx_v_check != 0)) != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":900 + * break + * if not check: + * continue # <<<<<<<<<<<<<< + * # Get the cell index corresponding to the probe + * cellindex_probe = self.grid.coord2cellid(probe) + */ + goto __pyx_L15_continue; + + /* "MDAnalysis/lib/nsgrid.pyx":899 + * check = False + * break + * if not check: # <<<<<<<<<<<<<< + * continue + * # Get the cell index corresponding to the probe + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":902 + * continue + * # Get the cell index corresponding to the probe + * cellindex_probe = self.grid.coord2cellid(probe) # <<<<<<<<<<<<<< + * # for this cellindex search in grid + * for j in range(self.grid.nbeads[cellindex_probe]): + */ + __pyx_v_cellindex_probe = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self->grid->__pyx_vtab)->coord2cellid(__pyx_v_self->grid, __pyx_v_probe); + + /* "MDAnalysis/lib/nsgrid.pyx":904 + * cellindex_probe = self.grid.coord2cellid(probe) + * # for this cellindex search in grid + * for j in range(self.grid.nbeads[cellindex_probe]): # <<<<<<<<<<<<<< + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + * # find distance between search coords[i] and coords[bid] + */ + __pyx_t_21 = (__pyx_v_self->grid->nbeads[__pyx_v_cellindex_probe]); + __pyx_t_22 = __pyx_t_21; + for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) { + __pyx_v_j = __pyx_t_23; + + /* "MDAnalysis/lib/nsgrid.pyx":905 + * # for this cellindex search in grid + * for j in range(self.grid.nbeads[cellindex_probe]): + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] # <<<<<<<<<<<<<< + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&searchcoords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + */ + __pyx_v_bid = (__pyx_v_self->grid->beadids[((__pyx_v_cellindex_probe * __pyx_v_self->grid->nbeads_per_cell) + __pyx_v_j)]); + + /* "MDAnalysis/lib/nsgrid.pyx":907 + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&searchcoords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) # <<<<<<<<<<<<<< + * if d2 < cutoff2: + * results.add_neighbors(current_beadid, bid, d2) + */ + __pyx_t_26 = __pyx_v_current_beadid; + __pyx_t_27 = 0; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_searchcoords_bbox.shape[0]; + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_v_searchcoords_bbox.shape[1]; + __pyx_t_28 = __pyx_v_bid; + __pyx_t_29 = 0; + if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_v_self->coords_bbox.shape[0]; + if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_v_self->coords_bbox.shape[1]; + __pyx_v_d2 = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self->box->__pyx_vtab)->fast_distance2(__pyx_v_self->box, (&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_searchcoords_bbox.data + __pyx_t_26 * __pyx_v_searchcoords_bbox.strides[0]) )) + __pyx_t_27)) )))), (&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_self->coords_bbox.data + __pyx_t_28 * __pyx_v_self->coords_bbox.strides[0]) )) + __pyx_t_29)) ))))); + + /* "MDAnalysis/lib/nsgrid.pyx":908 + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&searchcoords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + * if d2 < cutoff2: # <<<<<<<<<<<<<< + * results.add_neighbors(current_beadid, bid, d2) + * npairs += 1 + */ + __pyx_t_1 = ((__pyx_v_d2 < __pyx_v_cutoff2) != 0); + if (__pyx_t_1) { + + /* "MDAnalysis/lib/nsgrid.pyx":909 + * d2 = self.box.fast_distance2(&searchcoords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + * if d2 < cutoff2: + * results.add_neighbors(current_beadid, bid, d2) # <<<<<<<<<<<<<< + * npairs += 1 + * return results + */ + ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_results->__pyx_vtab)->add_neighbors(__pyx_v_results, __pyx_v_current_beadid, __pyx_v_bid, __pyx_v_d2); + + /* "MDAnalysis/lib/nsgrid.pyx":910 + * if d2 < cutoff2: + * results.add_neighbors(current_beadid, bid, d2) + * npairs += 1 # <<<<<<<<<<<<<< + * return results + * + */ + __pyx_v_npairs = (__pyx_v_npairs + 1); + + /* "MDAnalysis/lib/nsgrid.pyx":908 + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&searchcoords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + * if d2 < cutoff2: # <<<<<<<<<<<<<< + * results.add_neighbors(current_beadid, bid, d2) + * npairs += 1 + */ + } + } + __pyx_L15_continue:; + } + } + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":868 + * results = NSResults(self.cutoff, self.coords, searchcoords) + * + * with nogil: # <<<<<<<<<<<<<< + * for i in range(size_search): + * # Start with first search coordinate + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L8; + } + __pyx_L8:; + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":911 + * results.add_neighbors(current_beadid, bid, d2) + * npairs += 1 + * return results # <<<<<<<<<<<<<< + * + * def self_search(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_results)); + __pyx_r = ((PyObject *)__pyx_v_results); + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":798 + * self.grid.fill_grid(self.coords_bbox) + * + * def search(self, search_coords): # <<<<<<<<<<<<<< + * """Search a group of atoms against initialized coordinates + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.FastNS.search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_results); + __PYX_XDEC_MEMVIEW(&__pyx_v_searchcoords, 1); + __PYX_XDEC_MEMVIEW(&__pyx_v_searchcoords_bbox, 1); + __Pyx_XDECREF((PyObject *)__pyx_v_searchgrid); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":913 + * return results + * + * def self_search(self): # <<<<<<<<<<<<<< + * """Searches all the pairs within the initialized coordinates + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_5self_search(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_4self_search[] = "FastNS.self_search(self)\nSearches all the pairs within the initialized coordinates\n\n All the pairs among the initialized coordinates are registered\n in hald the time. Although the algorithm is still the same, but\n the distance checks can be reduced to half in this particular case\n as every pair need not be evaluated twice.\n\n Returns\n -------\n results : NSResults object\n The object from :class:NSResults\n contains ``get_indices``, ``get_distances``.\n ``get_pairs``, ``get_pair_distances``\n\n See Also\n --------\n MDAnalysis.lib.nsgrid.NSResults\n\n "; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_5self_search(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("self_search (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_4self_search(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_4self_search(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_i; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_j; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_size_search; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_d; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_m; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_current_beadid; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_bid; + CYTHON_UNUSED __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_cellindex; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_cellindex_probe; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_xi; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_yi; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_zi; + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v_results = 0; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_d2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_rvec __pyx_v_probe; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_v_cutoff2; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_v_npairs; + int __pyx_v_check; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_5; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_6; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_7; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_8; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_9; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + Py_ssize_t __pyx_t_13; + Py_ssize_t __pyx_t_14; + Py_ssize_t __pyx_t_15; + Py_ssize_t __pyx_t_16; + int __pyx_t_17; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_18; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_19; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_20; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_21; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_22; + Py_ssize_t __pyx_t_23; + Py_ssize_t __pyx_t_24; + Py_ssize_t __pyx_t_25; + Py_ssize_t __pyx_t_26; + int __pyx_t_27; + __Pyx_RefNannySetupContext("self_search", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":944 + * cdef rvec probe + * + * cdef real cutoff2 = self.cutoff * self.cutoff # <<<<<<<<<<<<<< + * cdef ns_int npairs = 0 + * cdef bint check + */ + __pyx_v_cutoff2 = (__pyx_v_self->cutoff * __pyx_v_self->cutoff); + + /* "MDAnalysis/lib/nsgrid.pyx":945 + * + * cdef real cutoff2 = self.cutoff * self.cutoff + * cdef ns_int npairs = 0 # <<<<<<<<<<<<<< + * cdef bint check + * + */ + __pyx_v_npairs = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":948 + * cdef bint check + * + * size_search = self.coords.shape[0] # <<<<<<<<<<<<<< + * + * results = NSResults(self.cutoff, self.coords, self.coords) + */ + __pyx_v_size_search = (__pyx_v_self->coords.shape[0]); + + /* "MDAnalysis/lib/nsgrid.pyx":950 + * size_search = self.coords.shape[0] + * + * results = NSResults(self.cutoff, self.coords, self.coords) # <<<<<<<<<<<<<< + * + * with nogil: + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_self->coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSResults), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_results = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":952 + * results = NSResults(self.cutoff, self.coords, self.coords) + * + * with nogil: # <<<<<<<<<<<<<< + * for i in range(size_search): + * # Start with first search coordinate + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "MDAnalysis/lib/nsgrid.pyx":953 + * + * with nogil: + * for i in range(size_search): # <<<<<<<<<<<<<< + * # Start with first search coordinate + * current_beadid = i + */ + __pyx_t_5 = __pyx_v_size_search; + __pyx_t_6 = __pyx_t_5; + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { + __pyx_v_i = __pyx_t_7; + + /* "MDAnalysis/lib/nsgrid.pyx":955 + * for i in range(size_search): + * # Start with first search coordinate + * current_beadid = i # <<<<<<<<<<<<<< + * # find the cellindex of the coordinate + * cellindex = self.grid.cellids[current_beadid] + */ + __pyx_v_current_beadid = __pyx_v_i; + + /* "MDAnalysis/lib/nsgrid.pyx":957 + * current_beadid = i + * # find the cellindex of the coordinate + * cellindex = self.grid.cellids[current_beadid] # <<<<<<<<<<<<<< + * for xi in range(DIM): + * for yi in range(DIM): + */ + __pyx_v_cellindex = (__pyx_v_self->grid->cellids[__pyx_v_current_beadid]); + + /* "MDAnalysis/lib/nsgrid.pyx":958 + * # find the cellindex of the coordinate + * cellindex = self.grid.cellids[current_beadid] + * for xi in range(DIM): # <<<<<<<<<<<<<< + * for yi in range(DIM): + * for zi in range(DIM): + */ + for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) { + __pyx_v_xi = __pyx_t_8; + + /* "MDAnalysis/lib/nsgrid.pyx":959 + * cellindex = self.grid.cellids[current_beadid] + * for xi in range(DIM): + * for yi in range(DIM): # <<<<<<<<<<<<<< + * for zi in range(DIM): + * check = True + */ + for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) { + __pyx_v_yi = __pyx_t_9; + + /* "MDAnalysis/lib/nsgrid.pyx":960 + * for xi in range(DIM): + * for yi in range(DIM): + * for zi in range(DIM): # <<<<<<<<<<<<<< + * check = True + * # Calculate and/or reinitialize shifted coordinates + */ + for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) { + __pyx_v_zi = __pyx_t_10; + + /* "MDAnalysis/lib/nsgrid.pyx":961 + * for yi in range(DIM): + * for zi in range(DIM): + * check = True # <<<<<<<<<<<<<< + * # Calculate and/or reinitialize shifted coordinates + * # Probe the search coordinates in a brick shaped box + */ + __pyx_v_check = 1; + + /* "MDAnalysis/lib/nsgrid.pyx":964 + * # Calculate and/or reinitialize shifted coordinates + * # Probe the search coordinates in a brick shaped box + * probe[XX] = self.coords_bbox[current_beadid, XX] + (xi - 1) * self.grid.cellsize[XX] # <<<<<<<<<<<<<< + * probe[YY] = self.coords_bbox[current_beadid, YY] + (yi - 1) * self.grid.cellsize[YY] + * probe[ZZ] = self.coords_bbox[current_beadid, ZZ] + (zi - 1) * self.grid.cellsize[ZZ] + */ + __pyx_t_11 = __pyx_v_current_beadid; + __pyx_t_12 = 0; + if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_self->coords_bbox.shape[0]; + if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_self->coords_bbox.shape[1]; + (__pyx_v_probe[0]) = ((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_self->coords_bbox.data + __pyx_t_11 * __pyx_v_self->coords_bbox.strides[0]) )) + __pyx_t_12)) ))) + ((__pyx_v_xi - 1) * (__pyx_v_self->grid->cellsize[0]))); + + /* "MDAnalysis/lib/nsgrid.pyx":965 + * # Probe the search coordinates in a brick shaped box + * probe[XX] = self.coords_bbox[current_beadid, XX] + (xi - 1) * self.grid.cellsize[XX] + * probe[YY] = self.coords_bbox[current_beadid, YY] + (yi - 1) * self.grid.cellsize[YY] # <<<<<<<<<<<<<< + * probe[ZZ] = self.coords_bbox[current_beadid, ZZ] + (zi - 1) * self.grid.cellsize[ZZ] + * # Make sure the shifted coordinates is inside the brick-shaped box + */ + __pyx_t_13 = __pyx_v_current_beadid; + __pyx_t_14 = 1; + if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_v_self->coords_bbox.shape[0]; + if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_self->coords_bbox.shape[1]; + (__pyx_v_probe[1]) = ((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_self->coords_bbox.data + __pyx_t_13 * __pyx_v_self->coords_bbox.strides[0]) )) + __pyx_t_14)) ))) + ((__pyx_v_yi - 1) * (__pyx_v_self->grid->cellsize[1]))); + + /* "MDAnalysis/lib/nsgrid.pyx":966 + * probe[XX] = self.coords_bbox[current_beadid, XX] + (xi - 1) * self.grid.cellsize[XX] + * probe[YY] = self.coords_bbox[current_beadid, YY] + (yi - 1) * self.grid.cellsize[YY] + * probe[ZZ] = self.coords_bbox[current_beadid, ZZ] + (zi - 1) * self.grid.cellsize[ZZ] # <<<<<<<<<<<<<< + * # Make sure the shifted coordinates is inside the brick-shaped box + * if self.periodic: + */ + __pyx_t_15 = __pyx_v_current_beadid; + __pyx_t_16 = 2; + if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_v_self->coords_bbox.shape[0]; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_self->coords_bbox.shape[1]; + (__pyx_v_probe[2]) = ((*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_self->coords_bbox.data + __pyx_t_15 * __pyx_v_self->coords_bbox.strides[0]) )) + __pyx_t_16)) ))) + ((__pyx_v_zi - 1) * (__pyx_v_self->grid->cellsize[2]))); + + /* "MDAnalysis/lib/nsgrid.pyx":968 + * probe[ZZ] = self.coords_bbox[current_beadid, ZZ] + (zi - 1) * self.grid.cellsize[ZZ] + * # Make sure the shifted coordinates is inside the brick-shaped box + * if self.periodic: # <<<<<<<<<<<<<< + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: + */ + __pyx_t_17 = (__pyx_v_self->periodic != 0); + if (__pyx_t_17) { + + /* "MDAnalysis/lib/nsgrid.pyx":969 + * # Make sure the shifted coordinates is inside the brick-shaped box + * if self.periodic: + * for m in range(DIM - 1, -1, -1): # <<<<<<<<<<<<<< + * while probe[m] < 0: + * for d in range(m+1): + */ + for (__pyx_t_18 = 2; __pyx_t_18 > -1L; __pyx_t_18-=1) { + __pyx_v_m = __pyx_t_18; + + /* "MDAnalysis/lib/nsgrid.pyx":970 + * if self.periodic: + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: # <<<<<<<<<<<<<< + * for d in range(m+1): + * probe[d] += self.box.c_pbcbox.box[m][d] + */ + while (1) { + __pyx_t_17 = (((__pyx_v_probe[__pyx_v_m]) < 0.0) != 0); + if (!__pyx_t_17) break; + + /* "MDAnalysis/lib/nsgrid.pyx":971 + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: + * for d in range(m+1): # <<<<<<<<<<<<<< + * probe[d] += self.box.c_pbcbox.box[m][d] + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + */ + __pyx_t_19 = (__pyx_v_m + 1); + __pyx_t_20 = __pyx_t_19; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_d = __pyx_t_21; + + /* "MDAnalysis/lib/nsgrid.pyx":972 + * while probe[m] < 0: + * for d in range(m+1): + * probe[d] += self.box.c_pbcbox.box[m][d] # <<<<<<<<<<<<<< + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + * for d in range(m+1): + */ + __pyx_t_22 = __pyx_v_d; + (__pyx_v_probe[__pyx_t_22]) = ((__pyx_v_probe[__pyx_t_22]) + ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_d])); + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":973 + * for d in range(m+1): + * probe[d] += self.box.c_pbcbox.box[m][d] + * while probe[m] >= self.box.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * for d in range(m+1): + * probe[d] -= self.box.c_pbcbox.box[m][d] + */ + while (1) { + __pyx_t_17 = (((__pyx_v_probe[__pyx_v_m]) >= ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_m])) != 0); + if (!__pyx_t_17) break; + + /* "MDAnalysis/lib/nsgrid.pyx":974 + * probe[d] += self.box.c_pbcbox.box[m][d] + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + * for d in range(m+1): # <<<<<<<<<<<<<< + * probe[d] -= self.box.c_pbcbox.box[m][d] + * else: + */ + __pyx_t_19 = (__pyx_v_m + 1); + __pyx_t_20 = __pyx_t_19; + for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) { + __pyx_v_d = __pyx_t_21; + + /* "MDAnalysis/lib/nsgrid.pyx":975 + * while probe[m] >= self.box.c_pbcbox.box[m][m]: + * for d in range(m+1): + * probe[d] -= self.box.c_pbcbox.box[m][d] # <<<<<<<<<<<<<< + * else: + * for m in range(DIM -1, -1, -1): + */ + __pyx_t_22 = __pyx_v_d; + (__pyx_v_probe[__pyx_t_22]) = ((__pyx_v_probe[__pyx_t_22]) - ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_d])); + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":968 + * probe[ZZ] = self.coords_bbox[current_beadid, ZZ] + (zi - 1) * self.grid.cellsize[ZZ] + * # Make sure the shifted coordinates is inside the brick-shaped box + * if self.periodic: # <<<<<<<<<<<<<< + * for m in range(DIM - 1, -1, -1): + * while probe[m] < 0: + */ + goto __pyx_L14; + } + + /* "MDAnalysis/lib/nsgrid.pyx":977 + * probe[d] -= self.box.c_pbcbox.box[m][d] + * else: + * for m in range(DIM -1, -1, -1): # <<<<<<<<<<<<<< + * if probe[m] < 0: + * check = False + */ + /*else*/ { + for (__pyx_t_18 = 2; __pyx_t_18 > -1L; __pyx_t_18-=1) { + __pyx_v_m = __pyx_t_18; + + /* "MDAnalysis/lib/nsgrid.pyx":978 + * else: + * for m in range(DIM -1, -1, -1): + * if probe[m] < 0: # <<<<<<<<<<<<<< + * check = False + * break + */ + __pyx_t_17 = (((__pyx_v_probe[__pyx_v_m]) < 0.0) != 0); + if (__pyx_t_17) { + + /* "MDAnalysis/lib/nsgrid.pyx":979 + * for m in range(DIM -1, -1, -1): + * if probe[m] < 0: + * check = False # <<<<<<<<<<<<<< + * break + * elif probe[m] >= self.box.c_pbcbox.box[m][m]: + */ + __pyx_v_check = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":980 + * if probe[m] < 0: + * check = False + * break # <<<<<<<<<<<<<< + * elif probe[m] >= self.box.c_pbcbox.box[m][m]: + * check = False + */ + goto __pyx_L26_break; + + /* "MDAnalysis/lib/nsgrid.pyx":978 + * else: + * for m in range(DIM -1, -1, -1): + * if probe[m] < 0: # <<<<<<<<<<<<<< + * check = False + * break + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":981 + * check = False + * break + * elif probe[m] >= self.box.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * check = False + * break + */ + __pyx_t_17 = (((__pyx_v_probe[__pyx_v_m]) >= ((__pyx_v_self->box->c_pbcbox.box[__pyx_v_m])[__pyx_v_m])) != 0); + if (__pyx_t_17) { + + /* "MDAnalysis/lib/nsgrid.pyx":982 + * break + * elif probe[m] >= self.box.c_pbcbox.box[m][m]: + * check = False # <<<<<<<<<<<<<< + * break + * if not check: + */ + __pyx_v_check = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":983 + * elif probe[m] >= self.box.c_pbcbox.box[m][m]: + * check = False + * break # <<<<<<<<<<<<<< + * if not check: + * continue + */ + goto __pyx_L26_break; + + /* "MDAnalysis/lib/nsgrid.pyx":981 + * check = False + * break + * elif probe[m] >= self.box.c_pbcbox.box[m][m]: # <<<<<<<<<<<<<< + * check = False + * break + */ + } + } + __pyx_L26_break:; + } + __pyx_L14:; + + /* "MDAnalysis/lib/nsgrid.pyx":984 + * check = False + * break + * if not check: # <<<<<<<<<<<<<< + * continue + * # Get the cell index corresponding to the probe + */ + __pyx_t_17 = ((!(__pyx_v_check != 0)) != 0); + if (__pyx_t_17) { + + /* "MDAnalysis/lib/nsgrid.pyx":985 + * break + * if not check: + * continue # <<<<<<<<<<<<<< + * # Get the cell index corresponding to the probe + * cellindex_probe = self.grid.coord2cellid(probe) + */ + goto __pyx_L12_continue; + + /* "MDAnalysis/lib/nsgrid.pyx":984 + * check = False + * break + * if not check: # <<<<<<<<<<<<<< + * continue + * # Get the cell index corresponding to the probe + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":987 + * continue + * # Get the cell index corresponding to the probe + * cellindex_probe = self.grid.coord2cellid(probe) # <<<<<<<<<<<<<< + * # for this cellindex search in grid + * for j in range(self.grid.nbeads[cellindex_probe]): + */ + __pyx_v_cellindex_probe = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_v_self->grid->__pyx_vtab)->coord2cellid(__pyx_v_self->grid, __pyx_v_probe); + + /* "MDAnalysis/lib/nsgrid.pyx":989 + * cellindex_probe = self.grid.coord2cellid(probe) + * # for this cellindex search in grid + * for j in range(self.grid.nbeads[cellindex_probe]): # <<<<<<<<<<<<<< + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + * if bid < current_beadid: + */ + __pyx_t_18 = (__pyx_v_self->grid->nbeads[__pyx_v_cellindex_probe]); + __pyx_t_19 = __pyx_t_18; + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; + + /* "MDAnalysis/lib/nsgrid.pyx":990 + * # for this cellindex search in grid + * for j in range(self.grid.nbeads[cellindex_probe]): + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] # <<<<<<<<<<<<<< + * if bid < current_beadid: + * continue + */ + __pyx_v_bid = (__pyx_v_self->grid->beadids[((__pyx_v_cellindex_probe * __pyx_v_self->grid->nbeads_per_cell) + __pyx_v_j)]); + + /* "MDAnalysis/lib/nsgrid.pyx":991 + * for j in range(self.grid.nbeads[cellindex_probe]): + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + * if bid < current_beadid: # <<<<<<<<<<<<<< + * continue + * # find distance between search coords[i] and coords[bid] + */ + __pyx_t_17 = ((__pyx_v_bid < __pyx_v_current_beadid) != 0); + if (__pyx_t_17) { + + /* "MDAnalysis/lib/nsgrid.pyx":992 + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + * if bid < current_beadid: + * continue # <<<<<<<<<<<<<< + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&self.coords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + */ + goto __pyx_L29_continue; + + /* "MDAnalysis/lib/nsgrid.pyx":991 + * for j in range(self.grid.nbeads[cellindex_probe]): + * bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + * if bid < current_beadid: # <<<<<<<<<<<<<< + * continue + * # find distance between search coords[i] and coords[bid] + */ + } + + /* "MDAnalysis/lib/nsgrid.pyx":994 + * continue + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&self.coords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) # <<<<<<<<<<<<<< + * if d2 < cutoff2 and d2 > EPSILON: + * results.add_neighbors(current_beadid, bid, d2) + */ + __pyx_t_23 = __pyx_v_current_beadid; + __pyx_t_24 = 0; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_v_self->coords_bbox.shape[0]; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_v_self->coords_bbox.shape[1]; + __pyx_t_25 = __pyx_v_bid; + __pyx_t_26 = 0; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_v_self->coords_bbox.shape[0]; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_v_self->coords_bbox.shape[1]; + __pyx_v_d2 = ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_v_self->box->__pyx_vtab)->fast_distance2(__pyx_v_self->box, (&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_self->coords_bbox.data + __pyx_t_23 * __pyx_v_self->coords_bbox.strides[0]) )) + __pyx_t_24)) )))), (&(*((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=1 */ ((char *) (((__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) ( /* dim=0 */ (__pyx_v_self->coords_bbox.data + __pyx_t_25 * __pyx_v_self->coords_bbox.strides[0]) )) + __pyx_t_26)) ))))); + + /* "MDAnalysis/lib/nsgrid.pyx":995 + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&self.coords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + * if d2 < cutoff2 and d2 > EPSILON: # <<<<<<<<<<<<<< + * results.add_neighbors(current_beadid, bid, d2) + * results.add_neighbors(bid, current_beadid, d2) + */ + __pyx_t_27 = ((__pyx_v_d2 < __pyx_v_cutoff2) != 0); + if (__pyx_t_27) { + } else { + __pyx_t_17 = __pyx_t_27; + goto __pyx_L33_bool_binop_done; + } + __pyx_t_27 = ((__pyx_v_d2 > 1e-05) != 0); + __pyx_t_17 = __pyx_t_27; + __pyx_L33_bool_binop_done:; + if (__pyx_t_17) { + + /* "MDAnalysis/lib/nsgrid.pyx":996 + * d2 = self.box.fast_distance2(&self.coords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + * if d2 < cutoff2 and d2 > EPSILON: + * results.add_neighbors(current_beadid, bid, d2) # <<<<<<<<<<<<<< + * results.add_neighbors(bid, current_beadid, d2) + * npairs += 2 + */ + ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_results->__pyx_vtab)->add_neighbors(__pyx_v_results, __pyx_v_current_beadid, __pyx_v_bid, __pyx_v_d2); + + /* "MDAnalysis/lib/nsgrid.pyx":997 + * if d2 < cutoff2 and d2 > EPSILON: + * results.add_neighbors(current_beadid, bid, d2) + * results.add_neighbors(bid, current_beadid, d2) # <<<<<<<<<<<<<< + * npairs += 2 + * return results + */ + ((struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v_results->__pyx_vtab)->add_neighbors(__pyx_v_results, __pyx_v_bid, __pyx_v_current_beadid, __pyx_v_d2); + + /* "MDAnalysis/lib/nsgrid.pyx":998 + * results.add_neighbors(current_beadid, bid, d2) + * results.add_neighbors(bid, current_beadid, d2) + * npairs += 2 # <<<<<<<<<<<<<< + * return results + */ + __pyx_v_npairs = (__pyx_v_npairs + 2); + + /* "MDAnalysis/lib/nsgrid.pyx":995 + * # find distance between search coords[i] and coords[bid] + * d2 = self.box.fast_distance2(&self.coords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + * if d2 < cutoff2 and d2 > EPSILON: # <<<<<<<<<<<<<< + * results.add_neighbors(current_beadid, bid, d2) + * results.add_neighbors(bid, current_beadid, d2) + */ + } + __pyx_L29_continue:; + } + __pyx_L12_continue:; + } + } + } + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":952 + * results = NSResults(self.cutoff, self.coords, self.coords) + * + * with nogil: # <<<<<<<<<<<<<< + * for i in range(size_search): + * # Start with first search coordinate + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "MDAnalysis/lib/nsgrid.pyx":999 + * results.add_neighbors(bid, current_beadid, d2) + * npairs += 2 + * return results # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_results)); + __pyx_r = ((PyObject *)__pyx_v_results); + goto __pyx_L0; + + /* "MDAnalysis/lib/nsgrid.pyx":913 + * return results + * + * def self_search(self): # <<<<<<<<<<<<<< + * """Searches all the pairs within the initialized coordinates + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.FastNS.self_search", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_results); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "MDAnalysis/lib/nsgrid.pyx":699 + * cdef real[:, ::1] coords + * cdef real[:, ::1] coords_bbox + * cdef readonly real cutoff # <<<<<<<<<<<<<< + * cdef NSGrid grid + * cdef ns_int max_gridsize + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_6cutoff_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_6cutoff_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_6cutoff___get__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_6cutoff___get__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.FastNS.cutoff.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.box, self.coords, self.coords_bbox, self.cutoff, self.grid, self.max_gridsize, self.periodic) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_6__reduce_cython__[] = "FastNS.__reduce_cython__(self)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_6__reduce_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_6__reduce_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.box, self.coords, self.coords_bbox, self.cutoff, self.grid, self.max_gridsize, self.periodic) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_self->coords_bbox, 2, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_npy_long(__pyx_v_self->max_gridsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->periodic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_v_self->box)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->box)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self->box)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->grid)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->grid)); + PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_self->grid)); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_5); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_v_state = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.box, self.coords, self.coords_bbox, self.cutoff, self.grid, self.max_gridsize, self.periodic) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_6 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v__dict = __pyx_t_6; + __pyx_t_6 = 0; + + /* "(tree fragment)":5 + * state = (self.box, self.coords, self.coords_bbox, self.cutoff, self.grid, self.max_gridsize, self.periodic) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_7 = (__pyx_v__dict != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v__dict); + __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.box is not None or self.grid is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":5 + * state = (self.box, self.coords, self.coords_bbox, self.cutoff, self.grid, self.max_gridsize, self.periodic) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = self.box is not None or self.grid is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, None), state + */ + /*else*/ { + __pyx_t_7 = (((PyObject *)__pyx_v_self->box) != Py_None); + __pyx_t_9 = (__pyx_t_7 != 0); + if (!__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_9 = (((PyObject *)__pyx_v_self->grid) != Py_None); + __pyx_t_7 = (__pyx_t_9 != 0); + __pyx_t_8 = __pyx_t_7; + __pyx_L4_bool_binop_done:; + __pyx_v_use_setstate = __pyx_t_8; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.box is not None or self.grid is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, None), state + * else: + */ + __pyx_t_8 = (__pyx_v_use_setstate != 0); + if (__pyx_t_8) { + + /* "(tree fragment)":11 + * use_setstate = self.box is not None or self.grid is not None + * if use_setstate: + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FastNS); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_221827040); + __Pyx_GIVEREF(__pyx_int_221827040); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_221827040); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.box is not None or self.grid is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, None), state + * else: + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FastNS__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_FastNS); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_221827040); + __Pyx_GIVEREF(__pyx_int_221827040); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_221827040); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __pyx_t_4 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.box, self.coords, self.coords_bbox, self.cutoff, self.grid, self.max_gridsize, self.periodic) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.FastNS.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FastNS__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_8__setstate_cython__[] = "FastNS.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_8__setstate_cython__(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_6FastNS_8__setstate_cython__(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":15 + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_FastNS__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_t_1 = __pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_FastNS__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_FastNS, (type(self), 0xd38cfe0, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_FastNS__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.FastNS.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x294c292: + * from pickle import PickleError as __pyx_PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_1__pyx_unpickle_NSResults(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults[] = "__pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state)"; +static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_6nsgrid_1__pyx_unpickle_NSResults = {"__pyx_unpickle_NSResults", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_1__pyx_unpickle_NSResults, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults}; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_1__pyx_unpickle_NSResults(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_NSResults (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_NSResults", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_NSResults", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_NSResults") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_NSResults", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.__pyx_unpickle_NSResults", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = NULL; + PyObject *__pyx_v___pyx_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_NSResults", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x294c292: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x294c292) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x294c292: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))" % __pyx_checksum) + * __pyx_result = NSResults.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * if __pyx_checksum != 0x294c292: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = NSResults.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x29, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_5) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":2 + * def __pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0x294c292: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))" % __pyx_checksum) + * __pyx_result = NSResults.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSResults), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_6) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_v___pyx_type); + __Pyx_GIVEREF(__pyx_v___pyx_type); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))" % __pyx_checksum) + * __pyx_result = NSResults.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * __pyx_result = NSResults.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults__set_state(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0x294c292 = (coords, cutoff, distances_buffer, indices_buffer, npairs, pair_distances2_buffer, pair_distances_buffer, pairs_buffer, searchcoords))" % __pyx_checksum) + * __pyx_result = NSResults.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x294c292: + * from pickle import PickleError as __pyx_PickleError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.__pyx_unpickle_NSResults", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] + * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_NSResults__set_state(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_2; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> __pyx_t_3; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> __pyx_t_4; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_5; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> __pyx_t_6; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> __pyx_t_7; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_NSResults__set_state", 0); + + /* "(tree fragment)":10 + * return __pyx_result + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[9]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->coords, 0); + __pyx_v___pyx_result->coords = __pyx_t_1; + __pyx_t_1.memview = NULL; + __pyx_t_1.data = NULL; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_2 = __pyx_PyFloat_AsFloat(PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); if (unlikely((__pyx_t_2 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->cutoff = __pyx_t_2; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_3 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->distances_buffer = __pyx_t_3; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_4 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(PyTuple_GET_ITEM(__pyx_v___pyx_state, 3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->indices_buffer = __pyx_t_4; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyInt_As_npy_long(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)); if (unlikely((__pyx_t_5 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->npairs = __pyx_t_5; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_6 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->pair_distances2_buffer = __pyx_t_6; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_6 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->pair_distances_buffer = __pyx_t_6; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_7 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->pairs_buffer = __pyx_t_7; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyTuple_GET_ITEM(__pyx_v___pyx_state, 8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->searchcoords, 0); + __pyx_v___pyx_result->searchcoords = __pyx_t_1; + __pyx_t_1.memview = NULL; + __pyx_t_1.data = NULL; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] + * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[9]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 11, __pyx_L1_error) + } + __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_10 = ((__pyx_t_9 > 9) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_8 = __pyx_t_10; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_10 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_11 = (__pyx_t_10 != 0); + __pyx_t_8 = __pyx_t_11; + __pyx_L4_bool_binop_done:; + if (__pyx_t_8) { + + /* "(tree fragment)":12 + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] + * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[9]) # <<<<<<<<<<<<<< + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_update); if (unlikely(!__pyx_t_14)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + if (!__pyx_t_13) { + __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_14, PyTuple_GET_ITEM(__pyx_v___pyx_state, 9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, PyTuple_GET_ITEM(__pyx_v___pyx_state, 9)}; + __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_12); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { + PyObject *__pyx_temp[2] = {__pyx_t_13, PyTuple_GET_ITEM(__pyx_v___pyx_state, 9)}; + __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GOTREF(__pyx_t_12); + } else + #endif + { + __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL; + __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v___pyx_state, 9)); + __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v___pyx_state, 9)); + PyTuple_SET_ITEM(__pyx_t_15, 0+1, PyTuple_GET_ITEM(__pyx_v___pyx_state, 9)); + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + } + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] + * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[9]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] + * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.__pyx_unpickle_NSResults__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_FastNS(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xd38cfe0: + * from pickle import PickleError as __pyx_PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_3__pyx_unpickle_FastNS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_10MDAnalysis_3lib_6nsgrid_2__pyx_unpickle_FastNS[] = "__pyx_unpickle_FastNS(__pyx_type, long __pyx_checksum, __pyx_state)"; +static PyMethodDef __pyx_mdef_10MDAnalysis_3lib_6nsgrid_3__pyx_unpickle_FastNS = {"__pyx_unpickle_FastNS", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_3__pyx_unpickle_FastNS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_2__pyx_unpickle_FastNS}; +static PyObject *__pyx_pw_10MDAnalysis_3lib_6nsgrid_3__pyx_unpickle_FastNS(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_FastNS (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastNS", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastNS", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_FastNS") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FastNS", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.__pyx_unpickle_FastNS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10MDAnalysis_3lib_6nsgrid_2__pyx_unpickle_FastNS(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10MDAnalysis_3lib_6nsgrid_2__pyx_unpickle_FastNS(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = NULL; + PyObject *__pyx_v___pyx_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_FastNS", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_FastNS(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xd38cfe0: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd38cfe0) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_FastNS(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xd38cfe0: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))" % __pyx_checksum) + * __pyx_result = FastNS.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * if __pyx_checksum != 0xd38cfe0: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = FastNS.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_5) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":2 + * def __pyx_unpickle_FastNS(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xd38cfe0: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))" % __pyx_checksum) + * __pyx_result = FastNS.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_FastNS__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10MDAnalysis_3lib_6nsgrid_FastNS), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_6) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_v___pyx_type); + __Pyx_GIVEREF(__pyx_v___pyx_type); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))" % __pyx_checksum) + * __pyx_result = FastNS.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FastNS__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * __pyx_result = FastNS.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_FastNS__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_FastNS__set_state(FastNS __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error) + __pyx_t_3 = __pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_FastNS__set_state(((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd38cfe0 = (box, coords, coords_bbox, cutoff, grid, max_gridsize, periodic))" % __pyx_checksum) + * __pyx_result = FastNS.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_FastNS__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_FastNS__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_FastNS__set_state(FastNS __pyx_result, tuple __pyx_state): + * __pyx_result.box = __pyx_state[0]; __pyx_result.coords = __pyx_state[1]; __pyx_result.coords_bbox = __pyx_state[2]; __pyx_result.cutoff = __pyx_state[3]; __pyx_result.grid = __pyx_state[4]; __pyx_result.max_gridsize = __pyx_state[5]; __pyx_result.periodic = __pyx_state[6] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_FastNS(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xd38cfe0: + * from pickle import PickleError as __pyx_PickleError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.__pyx_unpickle_FastNS", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_FastNS__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_FastNS__set_state(FastNS __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.box = __pyx_state[0]; __pyx_result.coords = __pyx_state[1]; __pyx_result.coords_bbox = __pyx_state[2]; __pyx_result.cutoff = __pyx_state[3]; __pyx_result.grid = __pyx_state[4]; __pyx_result.max_gridsize = __pyx_state[5]; __pyx_result.periodic = __pyx_state[6] + * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_f_10MDAnalysis_3lib_6nsgrid___pyx_unpickle_FastNS__set_state(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_3; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_FastNS__set_state", 0); + + /* "(tree fragment)":10 + * return __pyx_result + * cdef __pyx_unpickle_FastNS__set_state(FastNS __pyx_result, tuple __pyx_state): + * __pyx_result.box = __pyx_state[0]; __pyx_result.coords = __pyx_state[1]; __pyx_result.coords_bbox = __pyx_state[2]; __pyx_result.cutoff = __pyx_state[3]; __pyx_result.grid = __pyx_state[4]; __pyx_result.max_gridsize = __pyx_state[5]; __pyx_result.periodic = __pyx_state[6] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[7]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + if (!(likely(((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0), __pyx_ptype_10MDAnalysis_3lib_6nsgrid_PBCBox))))) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->box); + __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->box)); + __pyx_v___pyx_result->box = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)__pyx_t_1); + __pyx_t_1 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyTuple_GET_ITEM(__pyx_v___pyx_state, 1), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->coords, 0); + __pyx_v___pyx_result->coords = __pyx_t_2; + __pyx_t_2.memview = NULL; + __pyx_t_2.data = NULL; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error) + __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->coords_bbox, 0); + __pyx_v___pyx_result->coords_bbox = __pyx_t_2; + __pyx_t_2.memview = NULL; + __pyx_t_2.data = NULL; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_3 = __pyx_PyFloat_AsFloat(PyTuple_GET_ITEM(__pyx_v___pyx_state, 3)); if (unlikely((__pyx_t_3 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->cutoff = __pyx_t_3; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + if (!(likely(((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4), __pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSGrid))))) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->grid); + __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->grid)); + __pyx_v___pyx_result->grid = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)__pyx_t_1); + __pyx_t_1 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyInt_As_npy_long(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5)); if (unlikely((__pyx_t_4 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->max_gridsize = __pyx_t_4; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_v___pyx_result->periodic = __pyx_t_5; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FastNS__set_state(FastNS __pyx_result, tuple __pyx_state): + * __pyx_result.box = __pyx_state[0]; __pyx_result.coords = __pyx_state[1]; __pyx_result.coords_bbox = __pyx_state[2]; __pyx_result.cutoff = __pyx_state[3]; __pyx_result.grid = __pyx_state[4]; __pyx_result.max_gridsize = __pyx_state[5]; __pyx_result.periodic = __pyx_state[6] + * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[7]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 11, __pyx_L1_error) + } + __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_7 = ((__pyx_t_6 > 7) != 0); + if (__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 != 0); + __pyx_t_5 = __pyx_t_8; + __pyx_L4_bool_binop_done:; + if (__pyx_t_5) { + + /* "(tree fragment)":12 + * __pyx_result.box = __pyx_state[0]; __pyx_result.coords = __pyx_state[1]; __pyx_result.coords_bbox = __pyx_state[2]; __pyx_result.cutoff = __pyx_state[3]; __pyx_result.grid = __pyx_state[4]; __pyx_result.max_gridsize = __pyx_state[5]; __pyx_result.periodic = __pyx_state[6] + * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[7]) # <<<<<<<<<<<<<< + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + } + } + if (!__pyx_t_9) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_10)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { + PyObject *__pyx_temp[2] = {__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; + __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)); + __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)); + PyTuple_SET_ITEM(__pyx_t_11, 0+1, PyTuple_GET_ITEM(__pyx_v___pyx_state, 7)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_FastNS__set_state(FastNS __pyx_result, tuple __pyx_state): + * __pyx_result.box = __pyx_state[0]; __pyx_result.coords = __pyx_state[1]; __pyx_result.coords_bbox = __pyx_state[2]; __pyx_result.cutoff = __pyx_state[3]; __pyx_result.grid = __pyx_state[4]; __pyx_result.max_gridsize = __pyx_state[5]; __pyx_result.periodic = __pyx_state[6] + * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[7]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_FastNS__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_FastNS__set_state(FastNS __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.box = __pyx_state[0]; __pyx_result.coords = __pyx_state[1]; __pyx_result.coords_bbox = __pyx_state[2]; __pyx_result.cutoff = __pyx_state[3]; __pyx_result.grid = __pyx_state[4]; __pyx_result.max_gridsize = __pyx_state[5]; __pyx_result.periodic = __pyx_state[6] + * if len(__pyx_state) > 7 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("MDAnalysis.lib.nsgrid.__pyx_unpickle_FastNS__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fulfill the PEP. + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_i; + int __pyx_v_ndim; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + int __pyx_v_t; + char *__pyx_v_f; + PyArray_Descr *__pyx_v_descr = 0; + int __pyx_v_offset; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + * + * cdef int i, ndim + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + */ + __pyx_v_endian_detector = 1; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + * cdef int i, ndim + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * + * ndim = PyArray_NDIM(self) + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * + * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + */ + __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not C contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 229, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + * ndim = PyArray_NDIM(self) + * + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< + * raise ValueError(u"ndarray is not Fortran contiguous") + * + */ + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 233, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + * raise ValueError(u"ndarray is not C contiguous") + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + * raise ValueError(u"ndarray is not Fortran contiguous") + * + * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + * + * info.buf = PyArray_DATA(self) + * info.ndim = ndim # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * # Allocate new buffer for strides and shape info. + */ + __pyx_v_info->ndim = __pyx_v_ndim; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< + * info.shape = info.strides + ndim + * for i in range(ndim): + */ + __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + * # This is allocated as one block, strides first. + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) + * info.shape = info.strides + ndim # <<<<<<<<<<<<<< + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + */ + __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) + * info.shape = info.strides + ndim + * for i in range(ndim): # <<<<<<<<<<<<<< + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] + */ + __pyx_t_4 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + * info.shape = info.strides + ndim + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + */ + (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + * for i in range(ndim): + * info.strides[i] = PyArray_STRIDES(self)[i] + * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< + * else: + * info.strides = PyArray_STRIDES(self) + */ + (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + * info.buf = PyArray_DATA(self) + * info.ndim = ndim + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * # Allocate new buffer for strides and shape info. + * # This is allocated as one block, strides first. + */ + goto __pyx_L9; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + * info.shape[i] = PyArray_DIMS(self)[i] + * else: + * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + */ + /*else*/ { + __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + * else: + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + */ + __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); + } + __pyx_L9:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + * info.strides = PyArray_STRIDES(self) + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) + */ + __pyx_v_info->suboffsets = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + * info.shape = PyArray_DIMS(self) + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< + * info.readonly = not PyArray_ISWRITEABLE(self) + * + */ + __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + * info.suboffsets = NULL + * info.itemsize = PyArray_ITEMSIZE(self) + * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< + * + * cdef int t + */ + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + * + * cdef int t + * cdef char* f = NULL # <<<<<<<<<<<<<< + * cdef dtype descr = self.descr + * cdef int offset + */ + __pyx_v_f = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + * cdef int t + * cdef char* f = NULL + * cdef dtype descr = self.descr # <<<<<<<<<<<<<< + * cdef int offset + * + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + * cdef int offset + * + * info.obj = self # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(descr): + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self + * + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + * + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num # <<<<<<<<<<<<<< + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + */ + __pyx_t_4 = __pyx_v_descr->type_num; + __pyx_v_t = __pyx_t_4; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); + if (!__pyx_t_2) { + goto __pyx_L15_next_or; + } else { + } + __pyx_t_2 = (__pyx_v_little_endian != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L14_bool_binop_done; + } + __pyx_L15_next_or:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + */ + __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L14_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (unlikely(__pyx_t_1)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 263, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + * if not PyDataType_HASFIELDS(descr): + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + */ + switch (__pyx_v_t) { + case NPY_BYTE: + __pyx_v_f = ((char *)"b"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + * raise ValueError(u"Non-native byte order not supported") + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + */ + case NPY_UBYTE: + __pyx_v_f = ((char *)"B"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + */ + case NPY_SHORT: + __pyx_v_f = ((char *)"h"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + * elif t == NPY_UBYTE: f = "B" + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + */ + case NPY_USHORT: + __pyx_v_f = ((char *)"H"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + * elif t == NPY_SHORT: f = "h" + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + */ + case NPY_INT: + __pyx_v_f = ((char *)"i"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + * elif t == NPY_USHORT: f = "H" + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + */ + case NPY_UINT: + __pyx_v_f = ((char *)"I"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + * elif t == NPY_INT: f = "i" + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + */ + case NPY_LONG: + __pyx_v_f = ((char *)"l"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + * elif t == NPY_UINT: f = "I" + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + */ + case NPY_ULONG: + __pyx_v_f = ((char *)"L"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + * elif t == NPY_LONG: f = "l" + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + */ + case NPY_LONGLONG: + __pyx_v_f = ((char *)"q"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + * elif t == NPY_ULONG: f = "L" + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + */ + case NPY_ULONGLONG: + __pyx_v_f = ((char *)"Q"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + * elif t == NPY_LONGLONG: f = "q" + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + */ + case NPY_FLOAT: + __pyx_v_f = ((char *)"f"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + * elif t == NPY_ULONGLONG: f = "Q" + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + */ + case NPY_DOUBLE: + __pyx_v_f = ((char *)"d"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + * elif t == NPY_FLOAT: f = "f" + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + */ + case NPY_LONGDOUBLE: + __pyx_v_f = ((char *)"g"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + * elif t == NPY_DOUBLE: f = "d" + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + */ + case NPY_CFLOAT: + __pyx_v_f = ((char *)"Zf"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + * elif t == NPY_LONGDOUBLE: f = "g" + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" + */ + case NPY_CDOUBLE: + __pyx_v_f = ((char *)"Zd"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + * elif t == NPY_CFLOAT: f = "Zf" + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f = "O" + * else: + */ + case NPY_CLONGDOUBLE: + __pyx_v_f = ((char *)"Zg"); + break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + * elif t == NPY_CDOUBLE: f = "Zd" + * elif t == NPY_CLONGDOUBLE: f = "Zg" + * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + case NPY_OBJECT: + __pyx_v_f = ((char *)"O"); + break; + default: + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + * elif t == NPY_OBJECT: f = "O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * info.format = f + * return + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 282, __pyx_L1_error) + break; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f # <<<<<<<<<<<<<< + * return + * else: + */ + __pyx_v_info->format = __pyx_v_f; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * info.format = f + * return # <<<<<<<<<<<<<< + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + * info.obj = self + * + * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< + * t = descr.type_num + * if ((descr.byteorder == c'>' and little_endian) or + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + * return + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + */ + /*else*/ { + __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + * else: + * info.format = PyObject_Malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, + */ + (__pyx_v_info->format[0]) = '^'; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + * info.format = PyObject_Malloc(_buffer_format_string_len) + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 # <<<<<<<<<<<<<< + * f = _util_dtypestring(descr, info.format + 1, + * info.format + _buffer_format_string_len, + */ + __pyx_v_offset = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + * info.format[0] = c'^' # Native data types, manual alignment + * offset = 0 + * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< + * info.format + _buffer_format_string_len, + * &offset) + */ + __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(2, 289, __pyx_L1_error) + __pyx_v_f = __pyx_t_8; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + * info.format + _buffer_format_string_len, + * &offset) + * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + */ + (__pyx_v_f[0]) = '\x00'; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + * # experimental exception made for __getbuffer__ and __releasebuffer__ + * # -- the details of this may change. + * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< + * # This implementation of getbuffer is geared towards Cython + * # requirements, and does not yet fulfill the PEP. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_descr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + */ + +/* Python wrapper */ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); + __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__releasebuffer__", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) # <<<<<<<<<<<<<< + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * PyObject_Free(info.strides) + */ + PyObject_Free(__pyx_v_info->format); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + * + * def __releasebuffer__(ndarray self, Py_buffer* info): + * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * PyObject_Free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): + * PyObject_Free(info.strides) # <<<<<<<<<<<<<< + * # info.shape was stored after info.strides in the same block + * + */ + PyObject_Free(__pyx_v_info->strides); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< + * PyObject_Free(info.strides) + * # info.shape was stored after info.strides in the same block + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + * f[0] = c'\0' # Terminate format string + * + * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< + * if PyArray_HASFIELDS(self): + * PyObject_Free(info.format) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + * + * cdef inline object PyArray_MultiIterNew1(a): + * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< + * + * cdef inline object PyArray_MultiIterNew2(a, b): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + * ctypedef npy_cdouble complex_t + * + * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(1, a) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 779, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + * return PyArray_MultiIterNew(1, a) + * + * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(2, a, b) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 782, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + * return PyArray_MultiIterNew(2, a, b) + * + * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< + * return PyArray_MultiIterNew(3, a, b, c) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + * 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 */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + * 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) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + * + * 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); + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + * 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 */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape # <<<<<<<<<<<<<< + * else: + * return () + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape)); + __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + * + * cdef inline tuple PyDataType_SHAPE(dtype d): + * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< + * return d.subarray.shape + * else: + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + * return d.subarray.shape + * else: + * return () # <<<<<<<<<<<<<< + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + * return PyArray_MultiIterNew(5, a, b, c, d, e) + * + * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< + * if PyDataType_HASSUBARRAY(d): + * return d.subarray.shape + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * return () + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + +static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { + PyArray_Descr *__pyx_v_child = 0; + int __pyx_v_endian_detector; + int __pyx_v_little_endian; + PyObject *__pyx_v_fields = 0; + PyObject *__pyx_v_childname = NULL; + PyObject *__pyx_v_new_offset = NULL; + PyObject *__pyx_v_t = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + long __pyx_t_8; + char *__pyx_t_9; + __Pyx_RefNannySetupContext("_util_dtypestring", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + * + * cdef dtype child + * cdef int endian_detector = 1 # <<<<<<<<<<<<<< + * cdef bint little_endian = ((&endian_detector)[0] != 0) + * cdef tuple fields + */ + __pyx_v_endian_detector = 1; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + * cdef dtype child + * cdef int endian_detector = 1 + * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< + * cdef tuple fields + * + */ + __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + if (unlikely(__pyx_v_descr->names == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(2, 805, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 805, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + * + * for childname in descr.names: + * fields = descr.fields[childname] # <<<<<<<<<<<<<< + * child, new_offset = fields + * + */ + if (unlikely(__pyx_v_descr->fields == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(2, 806, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 806, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + * for childname in descr.names: + * fields = descr.fields[childname] + * child, new_offset = fields # <<<<<<<<<<<<<< + * + * if (end - f) - (new_offset - offset[0]) < 15: + */ + if (likely(__pyx_v_fields != Py_None)) { + PyObject* sequence = __pyx_v_fields; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(2, 807, __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_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 807, __pyx_L1_error) + } + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 807, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 810, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + * child, new_offset = fields + * + * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); + if (!__pyx_t_7) { + goto __pyx_L8_next_or; + } else { + } + __pyx_t_7 = (__pyx_v_little_endian != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_L8_next_or:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + * + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< + * raise ValueError(u"Non-native byte order not supported") + * # One could encode it in the format string and have Cython + */ + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L7_bool_binop_done:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(2, 814, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") + * + * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + * + * # Output padding bytes + * while offset[0] < new_offset: # <<<<<<<<<<<<<< + * f[0] = 120 # "x"; pad byte + * f += 1 + */ + while (1) { + __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 824, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 824, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) break; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + * # Output padding bytes + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< + * f += 1 + * offset[0] += 1 + */ + (__pyx_v_f[0]) = 0x78; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + * while offset[0] < new_offset: + * f[0] = 120 # "x"; pad byte + * f += 1 # <<<<<<<<<<<<<< + * offset[0] += 1 + * + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + * f[0] = 120 # "x"; pad byte + * f += 1 + * offset[0] += 1 # <<<<<<<<<<<<<< + * + * offset[0] += child.itemsize + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + * offset[0] += 1 + * + * offset[0] += child.itemsize # <<<<<<<<<<<<<< + * + * if not PyDataType_HASFIELDS(child): + */ + __pyx_t_8 = 0; + (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); + if (__pyx_t_6) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + * + * if not PyDataType_HASFIELDS(child): + * t = child.type_num # <<<<<<<<<<<<<< + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") + */ + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); + __pyx_t_4 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); + if (unlikely(__pyx_t_6)) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 834, __pyx_L1_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + * if not PyDataType_HASFIELDS(child): + * t = child.type_num + * if end - f < 5: # <<<<<<<<<<<<<< + * raise RuntimeError(u"Format string allocated too short.") + * + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + * + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 837, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 98; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + * # Until ticket #99 is fixed, use integers to avoid warnings + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 66; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + * if t == NPY_BYTE: f[0] = 98 #"b" + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x68; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + * elif t == NPY_UBYTE: f[0] = 66 #"B" + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 72; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + * elif t == NPY_SHORT: f[0] = 104 #"h" + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 841, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x69; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + * elif t == NPY_USHORT: f[0] = 72 #"H" + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 73; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + * elif t == NPY_INT: f[0] = 105 #"i" + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 843, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 843, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x6C; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + * elif t == NPY_UINT: f[0] = 73 #"I" + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 844, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 844, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 76; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + * elif t == NPY_LONG: f[0] = 108 #"l" + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 845, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 845, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x71; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + * elif t == NPY_ULONG: f[0] = 76 #"L" + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 81; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + * elif t == NPY_LONGLONG: f[0] = 113 #"q" + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x66; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 848, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 848, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 848, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x64; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + * elif t == NPY_FLOAT: f[0] = 102 #"f" + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 849, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 849, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 849, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 0x67; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + * elif t == NPY_DOUBLE: f[0] = 100 #"d" + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x66; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 851, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 851, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x64; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + */ + __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 852, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 852, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + (__pyx_v_f[0]) = 90; + (__pyx_v_f[1]) = 0x67; + __pyx_v_f = (__pyx_v_f + 1); + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd + * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg + * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + */ + __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 853, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(__pyx_t_6)) { + (__pyx_v_f[0]) = 79; + goto __pyx_L15; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + * elif t == NPY_OBJECT: f[0] = 79 #"O" + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< + * f += 1 + * else: + */ + /*else*/ { + __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(2, 855, __pyx_L1_error) + } + __pyx_L15:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + * else: + * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) + * f += 1 # <<<<<<<<<<<<<< + * else: + * # Cython ignores struct boundary information ("T{...}"), + */ + __pyx_v_f = (__pyx_v_f + 1); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + * offset[0] += child.itemsize + * + * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< + * t = child.type_num + * if end - f < 5: + */ + goto __pyx_L13; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + * # Cython ignores struct boundary information ("T{...}"), + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< + * return f + * + */ + /*else*/ { + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 860, __pyx_L1_error) + __pyx_v_f = __pyx_t_9; + } + __pyx_L13:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + * cdef tuple fields + * + * for childname in descr.names: # <<<<<<<<<<<<<< + * fields = descr.fields[childname] + * child, new_offset = fields + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + * # so don't output it + * f = _util_dtypestring(child, f, end, offset) + * return f # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_f; + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + * return () + * + * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< + * # Recursive utility function used in __getbuffer__ to get format + * # string. The new location in the format string is returned. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_child); + __Pyx_XDECREF(__pyx_v_fields); + __Pyx_XDECREF(__pyx_v_childname); + __Pyx_XDECREF(__pyx_v_new_offset); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + +static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { + PyObject *__pyx_v_baseptr; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("set_array_base", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + __pyx_t_1 = (__pyx_v_base == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + * cdef PyObject* baseptr + * if base is None: + * baseptr = NULL # <<<<<<<<<<<<<< + * else: + * Py_INCREF(base) # important to do this before decref below! + */ + __pyx_v_baseptr = NULL; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + * cdef inline void set_array_base(ndarray arr, object base): + * cdef PyObject* baseptr + * if base is None: # <<<<<<<<<<<<<< + * baseptr = NULL + * else: + */ + goto __pyx_L3; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + * baseptr = NULL + * else: + * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< + * baseptr = base + * Py_XDECREF(arr.base) + */ + /*else*/ { + Py_INCREF(__pyx_v_base); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + * else: + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base # <<<<<<<<<<<<<< + * Py_XDECREF(arr.base) + * arr.base = baseptr + */ + __pyx_v_baseptr = ((PyObject *)__pyx_v_base); + } + __pyx_L3:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + * Py_INCREF(base) # important to do this before decref below! + * baseptr = base + * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< + * arr.base = baseptr + * + */ + Py_XDECREF(__pyx_v_arr->base); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + * baseptr = base + * Py_XDECREF(arr.base) + * arr.base = baseptr # <<<<<<<<<<<<<< + * + * cdef inline object get_array_base(ndarray arr): + */ + __pyx_v_arr->base = __pyx_v_baseptr; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + * + * + * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< + * cdef PyObject* baseptr + * if base is None: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + +static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("get_array_base", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); + if (__pyx_t_1) { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: + * return None # <<<<<<<<<<<<<< + * else: + * return arr.base + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + * + * cdef inline object get_array_base(ndarray arr): + * if arr.base is NULL: # <<<<<<<<<<<<<< + * return None + * else: + */ + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + * return None + * else: + * return arr.base # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); + __pyx_r = ((PyObject *)__pyx_v_arr->base); + goto __pyx_L0; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + * arr.base = baseptr + * + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_array", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + * cdef inline int import_array() except -1: + * try: + * _import_array() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") + */ + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 998, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + * try: + * _import_array() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.multiarray failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 999, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * _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__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1000, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1000, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + * # Cython code. + * cdef inline int import_array() except -1: + * try: # <<<<<<<<<<<<<< + * _import_array() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + * # Versions of the import_* functions which are more suitable for + * # Cython code. + * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< + * try: + * _import_array() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_umath", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + * cdef inline int import_umath() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1004, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + * + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1005, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + * _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__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1006, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1006, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + * + * cdef inline int import_umath() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + * raise ImportError("numpy.core.multiarray failed to import") + * + * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + +static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("import_ufunc", 0); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + * cdef inline int import_ufunc() except -1: + * try: + * _import_umath() # <<<<<<<<<<<<<< + * except Exception: + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1010, __pyx_L3_error) + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + * try: + * _import_umath() + * except Exception: # <<<<<<<<<<<<<< + * raise ImportError("numpy.core.umath failed to import") + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + if (__pyx_t_4) { + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1011, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1012, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(2, 1012, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + * + * cdef inline int import_ufunc() except -1: + * try: # <<<<<<<<<<<<<< + * _import_umath() + * except Exception: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L8_try_end:; + } + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + * raise ImportError("numpy.core.umath failed to import") + * + * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< + * try: + * _import_umath() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real") + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyObject *__pyx_v_o) { + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + __pyx_t_10MDAnalysis_3lib_6nsgrid_real __pyx_t_5; + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real", 0); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v + * + */ + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_v_item); if (unlikely((__pyx_t_5 == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_v_v.push_back(((__pyx_t_10MDAnalysis_3lib_6nsgrid_real)__pyx_t_5)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real") + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(PyObject *__pyx_v_o) { + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + __pyx_t_10MDAnalysis_3lib_6nsgrid_realvec __pyx_t_5; + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec", 0); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v + * + */ + __pyx_t_5 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_real(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_v_v.push_back(((__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec)__pyx_t_5)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec") + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_realvec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = __Pyx_PyInt_From_npy_long((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(const std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec") + * cdef object __pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int") + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(PyObject *__pyx_v_o) { + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int __pyx_t_5; + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int", 0); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v + * + */ + __pyx_t_5 = __Pyx_PyInt_As_npy_long(__pyx_v_item); if (unlikely((__pyx_t_5 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_v_v.push_back(((__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int)__pyx_t_5)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int") + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(PyObject *__pyx_v_o) { + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> __pyx_v_v; + PyObject *__pyx_v_item = NULL; + std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + __pyx_t_10MDAnalysis_3lib_6nsgrid_intvec __pyx_t_5; + __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec", 0); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) { + __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 47, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + + /* "vector.from_py":48 + * cdef vector[X] v + * for item in o: + * v.push_back(item) # <<<<<<<<<<<<<< + * return v + * + */ + __pyx_t_5 = __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error) + __pyx_v_v.push_back(((__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec)__pyx_t_5)); + + /* "vector.from_py":47 + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(object o) except *: + * cdef vector[X] v + * for item in o: # <<<<<<<<<<<<<< + * v.push_back(item) + * return v + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "vector.from_py":49 + * for item in o: + * v.push_back(item) + * return v # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_v; + goto __pyx_L0; + + /* "vector.from_py":45 + * + * @cname("__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec") + * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec(object o) except *: # <<<<<<<<<<<<<< + * cdef vector[X] v + * for item in o: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py___pyx_t_10MDAnalysis_3lib_6nsgrid_intvec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_pretend_to_initialize(&__pyx_r); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + +/* Python wrapper */ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_shape = 0; + Py_ssize_t __pyx_v_itemsize; + PyObject *__pyx_v_format = 0; + PyObject *__pyx_v_mode = 0; + int __pyx_v_allocate_buffer; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)__pyx_n_s_c); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 121, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 121, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 121, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_shape = ((PyObject*)values[0]); + __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error) + __pyx_v_format = values[2]; + __pyx_v_mode = values[3]; + if (values[4]) { + __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error) + } else { + + /* "View.MemoryView":122 + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, + * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< + * + * cdef int idx + */ + __pyx_v_allocate_buffer = ((int)1); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 121, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 121, __pyx_L1_error) + if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { + PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 121, __pyx_L1_error) + } + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); + + /* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { + int __pyx_v_idx; + Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_dim; + PyObject **__pyx_v_p; + char __pyx_v_order; + int __pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_format); + + /* "View.MemoryView":128 + * 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()"); + __PYX_ERR(1, 128, __pyx_L1_error) + } + __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 128, __pyx_L1_error) + __pyx_v_self->ndim = ((int)__pyx_t_1); + + /* "View.MemoryView":129 + * + * self.ndim = len(shape) + * self.itemsize = itemsize # <<<<<<<<<<<<<< + * + * if not self.ndim: + */ + __pyx_v_self->itemsize = __pyx_v_itemsize; + + /* "View.MemoryView":131 + * 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":132 + * + * 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__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 132, __pyx_L1_error) + + /* "View.MemoryView":131 + * self.itemsize = itemsize + * + * if not self.ndim: # <<<<<<<<<<<<<< + * raise ValueError("Empty shape tuple for cython.array") + * + */ + } + + /* "View.MemoryView":134 + * 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":135 + * + * 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__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 135, __pyx_L1_error) + + /* "View.MemoryView":134 + * raise ValueError("Empty shape tuple for cython.array") + * + * if itemsize <= 0: # <<<<<<<<<<<<<< + * raise ValueError("itemsize <= 0 for cython.array") + * + */ + } + + /* "View.MemoryView":137 + * 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_4 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":138 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":137 + * 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 + */ + } + + /* "View.MemoryView":139 + * if not isinstance(format, bytes): + * format = format.encode('ASCII') + * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< + * self.format = self._format + * + */ + if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 139, __pyx_L1_error) + __pyx_t_5 = __pyx_v_format; + __Pyx_INCREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_v_self->_format); + __Pyx_DECREF(__pyx_v_self->_format); + __pyx_v_self->_format = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":140 + * 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"); + __PYX_ERR(1, 140, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error) + __pyx_v_self->format = __pyx_t_6; + + /* "View.MemoryView":143 + * + * + * 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":144 + * + * 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":146 + * 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":147 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 147, __pyx_L1_error) + + /* "View.MemoryView":146 + * self._strides = self._shape + self.ndim + * + * if not self._shape: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate shape and strides.") + * + */ + } + + /* "View.MemoryView":150 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + __pyx_t_7 = 0; + __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; + for (;;) { + if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 150, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_dim = __pyx_t_8; + __pyx_v_idx = __pyx_t_7; + __pyx_t_7 = (__pyx_t_7 + 1); + + /* "View.MemoryView":151 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":152 + * for idx, dim in enumerate(shape): + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< + * self._shape[idx] = dim + * + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); + __pyx_t_3 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 152, __pyx_L1_error) + + /* "View.MemoryView":151 + * + * for idx, dim in enumerate(shape): + * if dim <= 0: # <<<<<<<<<<<<<< + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + * self._shape[idx] = dim + */ + } + + /* "View.MemoryView":153 + * 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":150 + * + * + * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< + * if dim <= 0: + * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) + */ + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "View.MemoryView":156 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 156, __pyx_L1_error) + if (__pyx_t_4) { + + /* "View.MemoryView":157 + * cdef char order + * if mode == 'fortran': + * order = b'F' # <<<<<<<<<<<<<< + * self.mode = u'fortran' + * elif mode == 'c': + */ + __pyx_v_order = 'F'; + + /* "View.MemoryView":158 + * if mode == 'fortran': + * order = b'F' + * self.mode = u'fortran' # <<<<<<<<<<<<<< + * elif mode == 'c': + * order = b'C' + */ + __Pyx_INCREF(__pyx_n_u_fortran); + __Pyx_GIVEREF(__pyx_n_u_fortran); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_fortran; + + /* "View.MemoryView":156 + * + * cdef char order + * if mode == 'fortran': # <<<<<<<<<<<<<< + * order = b'F' + * self.mode = u'fortran' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":159 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error) + if (likely(__pyx_t_4)) { + + /* "View.MemoryView":160 + * self.mode = u'fortran' + * elif mode == 'c': + * order = b'C' # <<<<<<<<<<<<<< + * self.mode = u'c' + * else: + */ + __pyx_v_order = 'C'; + + /* "View.MemoryView":161 + * elif mode == 'c': + * order = b'C' + * self.mode = u'c' # <<<<<<<<<<<<<< + * else: + * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) + */ + __Pyx_INCREF(__pyx_n_u_c); + __Pyx_GIVEREF(__pyx_n_u_c); + __Pyx_GOTREF(__pyx_v_self->mode); + __Pyx_DECREF(__pyx_v_self->mode); + __pyx_v_self->mode = __pyx_n_u_c; + + /* "View.MemoryView":159 + * order = b'F' + * self.mode = u'fortran' + * elif mode == 'c': # <<<<<<<<<<<<<< + * order = b'C' + * self.mode = u'c' + */ + goto __pyx_L10; + } + + /* "View.MemoryView":163 + * 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*/ { + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 163, __pyx_L1_error) + } + __pyx_L10:; + + /* "View.MemoryView":165 + * 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":168 + * itemsize, self.ndim, order) + * + * self.free_data = allocate_buffer # <<<<<<<<<<<<<< + * self.dtype_is_object = format == b'O' + * if allocate_buffer: + */ + __pyx_v_self->free_data = __pyx_v_allocate_buffer; + + /* "View.MemoryView":169 + * + * 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(1, 169, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_self->dtype_is_object = __pyx_t_4; + + /* "View.MemoryView":170 + * 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":173 + * + * + * self.data = malloc(self.len) # <<<<<<<<<<<<<< + * if not self.data: + * raise MemoryError("unable to allocate array data.") + */ + __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); + + /* "View.MemoryView":174 + * + * 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)) { + + /* "View.MemoryView":175 + * 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__24, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_Raise(__pyx_t_10, 0, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __PYX_ERR(1, 175, __pyx_L1_error) + + /* "View.MemoryView":174 + * + * self.data = malloc(self.len) + * if not self.data: # <<<<<<<<<<<<<< + * raise MemoryError("unable to allocate array data.") + * + */ + } + + /* "View.MemoryView":177 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":178 + * + * if self.dtype_is_object: + * p = self.data # <<<<<<<<<<<<<< + * for i in range(self.len / itemsize): + * p[i] = Py_None + */ + __pyx_v_p = ((PyObject **)__pyx_v_self->data); + + /* "View.MemoryView":179 + * if self.dtype_is_object: + * p = self.data + * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< + * p[i] = Py_None + * Py_INCREF(Py_None) + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 179, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 179, __pyx_L1_error) + } + __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize); + __pyx_t_8 = __pyx_t_1; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) { + __pyx_v_i = __pyx_t_11; + + /* "View.MemoryView":180 + * p = self.data + * for i in range(self.len / itemsize): + * p[i] = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + (__pyx_v_p[__pyx_v_i]) = Py_None; + + /* "View.MemoryView":181 + * for i in range(self.len / itemsize): + * p[i] = Py_None + * Py_INCREF(Py_None) # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + Py_INCREF(Py_None); + } + + /* "View.MemoryView":177 + * raise MemoryError("unable to allocate array data.") + * + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * p = self.data + * for i in range(self.len / itemsize): + */ + } + + /* "View.MemoryView":170 + * self.free_data = allocate_buffer + * self.dtype_is_object = format == b'O' + * if allocate_buffer: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":121 + * cdef bint dtype_is_object + * + * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< + * mode="c", bint allocate_buffer=True): + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":184 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_v_bufmode; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t *__pyx_t_7; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":185 + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 # <<<<<<<<<<<<<< + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = -1; + + /* "View.MemoryView":186 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 186, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":187 + * cdef int bufmode = -1 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + */ + __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":186 + * def __getbuffer__(self, Py_buffer *info, int flags): + * cdef int bufmode = -1 + * if self.mode == u"c": # <<<<<<<<<<<<<< + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + */ + goto __pyx_L3; + } + + /* "View.MemoryView":188 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 188, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":189 + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + */ + __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); + + /* "View.MemoryView":188 + * if self.mode == u"c": + * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * elif self.mode == u"fortran": # <<<<<<<<<<<<<< + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + */ + } + __pyx_L3:; + + /* "View.MemoryView":190 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":191 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 191, __pyx_L1_error) + + /* "View.MemoryView":190 + * elif self.mode == u"fortran": + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): # <<<<<<<<<<<<<< + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + */ + } + + /* "View.MemoryView":192 + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data # <<<<<<<<<<<<<< + * info.len = self.len + * info.ndim = self.ndim + */ + __pyx_t_4 = __pyx_v_self->data; + __pyx_v_info->buf = __pyx_t_4; + + /* "View.MemoryView":193 + * raise ValueError("Can only create a buffer that is contiguous in memory.") + * info.buf = self.data + * info.len = self.len # <<<<<<<<<<<<<< + * info.ndim = self.ndim + * info.shape = self._shape + */ + __pyx_t_5 = __pyx_v_self->len; + __pyx_v_info->len = __pyx_t_5; + + /* "View.MemoryView":194 + * info.buf = self.data + * info.len = self.len + * info.ndim = self.ndim # <<<<<<<<<<<<<< + * info.shape = self._shape + * info.strides = self._strides + */ + __pyx_t_6 = __pyx_v_self->ndim; + __pyx_v_info->ndim = __pyx_t_6; + + /* "View.MemoryView":195 + * info.len = self.len + * info.ndim = self.ndim + * info.shape = self._shape # <<<<<<<<<<<<<< + * info.strides = self._strides + * info.suboffsets = NULL + */ + __pyx_t_7 = __pyx_v_self->_shape; + __pyx_v_info->shape = __pyx_t_7; + + /* "View.MemoryView":196 + * info.ndim = self.ndim + * info.shape = self._shape + * info.strides = self._strides # <<<<<<<<<<<<<< + * info.suboffsets = NULL + * info.itemsize = self.itemsize + */ + __pyx_t_7 = __pyx_v_self->_strides; + __pyx_v_info->strides = __pyx_t_7; + + /* "View.MemoryView":197 + * info.shape = self._shape + * info.strides = self._strides + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * info.itemsize = self.itemsize + * info.readonly = 0 + */ + __pyx_v_info->suboffsets = NULL; + + /* "View.MemoryView":198 + * info.strides = self._strides + * info.suboffsets = NULL + * info.itemsize = self.itemsize # <<<<<<<<<<<<<< + * info.readonly = 0 + * + */ + __pyx_t_5 = __pyx_v_self->itemsize; + __pyx_v_info->itemsize = __pyx_t_5; + + /* "View.MemoryView":199 + * info.suboffsets = NULL + * info.itemsize = self.itemsize + * info.readonly = 0 # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + __pyx_v_info->readonly = 0; + + /* "View.MemoryView":201 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":202 + * + * if flags & PyBUF_FORMAT: + * info.format = self.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_4 = __pyx_v_self->format; + __pyx_v_info->format = __pyx_t_4; + + /* "View.MemoryView":201 + * info.readonly = 0 + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.format + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":204 + * info.format = self.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.obj = self + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L5:; + + /* "View.MemoryView":206 + * info.format = NULL + * + * info.obj = self # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":184 + * + * @cname('getbuffer') + * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< + * cdef int bufmode = -1 + * if self.mode == u"c": + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":210 + * __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) + */ + +/* Python wrapper */ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":211 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":212 + * def __dealloc__(array self): + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) # <<<<<<<<<<<<<< + * elif self.free_data: + * if self.dtype_is_object: + */ + __pyx_v_self->callback_free_data(__pyx_v_self->data); + + /* "View.MemoryView":211 + * + * def __dealloc__(array self): + * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< + * self.callback_free_data(self.data) + * elif self.free_data: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":213 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + __pyx_t_1 = (__pyx_v_self->free_data != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":214 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":215 + * elif self.free_data: + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< + * self._strides, self.ndim, False) + * free(self.data) + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); + + /* "View.MemoryView":214 + * self.callback_free_data(self.data) + * elif self.free_data: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + */ + } + + /* "View.MemoryView":217 + * refcount_objects_in_slice(self.data, self._shape, + * self._strides, self.ndim, False) + * free(self.data) # <<<<<<<<<<<<<< + * PyObject_Free(self._shape) + * + */ + free(__pyx_v_self->data); + + /* "View.MemoryView":213 + * if self.callback_free_data != NULL: + * self.callback_free_data(self.data) + * elif self.free_data: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * refcount_objects_in_slice(self.data, self._shape, + */ + } + __pyx_L3:; + + /* "View.MemoryView":218 + * self._strides, self.ndim, False) + * free(self.data) + * PyObject_Free(self._shape) # <<<<<<<<<<<<<< + * + * @property + */ + PyObject_Free(__pyx_v_self->_shape); + + /* "View.MemoryView":210 + * __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) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":221 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":222 + * @property + * def memview(self): + * return self.get_memview() # <<<<<<<<<<<<<< + * + * @cname('get_memview') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":221 + * + * @property + * def memview(self): # <<<<<<<<<<<<<< + * return self.get_memview() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":225 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + +static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_memview", 0); + + /* "View.MemoryView":226 + * @cname('get_memview') + * cdef get_memview(self): + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< + * return memoryview(self, flags, self.dtype_is_object) + * + */ + __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); + + /* "View.MemoryView":227 + * 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); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":225 + * + * @cname('get_memview') + * cdef get_memview(self): # <<<<<<<<<<<<<< + * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE + * return memoryview(self, flags, self.dtype_is_object) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":229 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":230 + * + * def __len__(self): + * return self._shape[0] # <<<<<<<<<<<<<< + * + * def __getattr__(self, attr): + */ + __pyx_r = (__pyx_v_self->_shape[0]); + goto __pyx_L0; + + /* "View.MemoryView":229 + * return memoryview(self, flags, self.dtype_is_object) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return self._shape[0] + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":232 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ +static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "View.MemoryView":233 + * + * def __getattr__(self, attr): + * return getattr(self.memview, attr) # <<<<<<<<<<<<<< + * + * def __getitem__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":232 + * return self._shape[0] + * + * def __getattr__(self, attr): # <<<<<<<<<<<<<< + * return getattr(self.memview, attr) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":235 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + +/* Python wrapper */ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":236 + * + * def __getitem__(self, item): + * return self.memview[item] # <<<<<<<<<<<<<< + * + * def __setitem__(self, item, value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":235 + * return getattr(self.memview, attr) + * + * def __getitem__(self, item): # <<<<<<<<<<<<<< + * return self.memview[item] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":238 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + +/* Python wrapper */ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + + /* "View.MemoryView":239 + * + * 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(1, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":238 + * return self.memview[item] + * + * def __setitem__(self, item, value): # <<<<<<<<<<<<<< + * self.memview[item] = value + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":243 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + +static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { + struct __pyx_array_obj *__pyx_v_result = 0; + struct __pyx_array_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("array_cwrapper", 0); + + /* "View.MemoryView":247 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":248 + * + * if buf == NULL: + * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), + */ + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":247 + * cdef array result + * + * if buf == NULL: # <<<<<<<<<<<<<< + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":250 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + /*else*/ { + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_GIVEREF(__pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":251 + * else: + * 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(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 251, __pyx_L1_error) + + /* "View.MemoryView":250 + * result = array(shape, itemsize, format, mode.decode('ASCII')) + * else: + * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< + * allocate_buffer=False) + * result.data = buf + */ + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "View.MemoryView":252 + * result = array(shape, itemsize, format, mode.decode('ASCII'), + * allocate_buffer=False) + * result.data = buf # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_v_result->data = __pyx_v_buf; + } + __pyx_L3:; + + /* "View.MemoryView":254 + * result.data = buf + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":243 + * + * @cname("__pyx_array_new") + * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< + * char *mode, char *buf): + * cdef array result + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":280 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + +/* Python wrapper */ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_name = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 280, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_name = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 280, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "View.MemoryView":281 + * cdef object name + * def __init__(self, name): + * self.name = name # <<<<<<<<<<<<<< + * def __repr__(self): + * return self.name + */ + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __Pyx_GOTREF(__pyx_v_self->name); + __Pyx_DECREF(__pyx_v_self->name); + __pyx_v_self->name = __pyx_v_name; + + /* "View.MemoryView":280 + * cdef class Enum(object): + * cdef object name + * def __init__(self, name): # <<<<<<<<<<<<<< + * self.name = name + * def __repr__(self): + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":282 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + +/* Python wrapper */ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":283 + * self.name = name + * def __repr__(self): + * return self.name # <<<<<<<<<<<<<< + * + * cdef generic = Enum("") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->name); + __pyx_r = __pyx_v_self->name; + goto __pyx_L0; + + /* "View.MemoryView":282 + * def __init__(self, name): + * self.name = name + * def __repr__(self): # <<<<<<<<<<<<<< + * return self.name + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { + int __pyx_v_use_setstate; + PyObject *__pyx_v_state = NULL; + PyObject *__pyx_v__dict = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * cdef bint use_setstate + * state = (self.name,) # <<<<<<<<<<<<<< + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->name); + __Pyx_GIVEREF(__pyx_v_self->name); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); + __pyx_v_state = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "(tree fragment)":4 + * cdef bint use_setstate + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< + * if _dict is not None: + * state += (_dict,) + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__dict = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + __pyx_t_2 = (__pyx_v__dict != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":6 + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: + * state += (_dict,) # <<<<<<<<<<<<<< + * use_setstate = True + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v__dict); + __Pyx_GIVEREF(__pyx_v__dict); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "(tree fragment)":7 + * if _dict is not None: + * state += (_dict,) + * use_setstate = True # <<<<<<<<<<<<<< + * else: + * use_setstate = self.name is not None + */ + __pyx_v_use_setstate = 1; + + /* "(tree fragment)":5 + * state = (self.name,) + * _dict = getattr(self, '__dict__', None) + * if _dict is not None: # <<<<<<<<<<<<<< + * state += (_dict,) + * use_setstate = True + */ + goto __pyx_L3; + } + + /* "(tree fragment)":9 + * use_setstate = True + * else: + * use_setstate = self.name is not None # <<<<<<<<<<<<<< + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_self->name != Py_None); + __pyx_v_use_setstate = __pyx_t_3; + } + __pyx_L3:; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + __pyx_t_3 = (__pyx_v_use_setstate != 0); + if (__pyx_t_3) { + + /* "(tree fragment)":11 + * use_setstate = self.name is not None + * if use_setstate: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "(tree fragment)":10 + * else: + * use_setstate = self.name is not None + * if use_setstate: # <<<<<<<<<<<<<< + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + */ + } + + /* "(tree fragment)":13 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_INCREF(__pyx_int_184977713); + __Pyx_GIVEREF(__pyx_int_184977713); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); + __Pyx_INCREF(__pyx_v_state); + __Pyx_GIVEREF(__pyx_v_state); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * cdef bint use_setstate + * state = (self.name,) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_state); + __Pyx_XDECREF(__pyx_v__dict); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":14 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":15 + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): + * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":14 + * else: + * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state(self, __pyx_state) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":297 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + +static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { + Py_intptr_t __pyx_v_aligned_p; + size_t __pyx_v_offset; + void *__pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":299 + * cdef void *align_pointer(void *memory, size_t alignment) nogil: + * "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":303 + * + * with cython.cdivision(True): + * offset = aligned_p % alignment # <<<<<<<<<<<<<< + * + * if offset > 0: + */ + __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); + + /* "View.MemoryView":305 + * 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":306 + * + * 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":305 + * offset = aligned_p % alignment + * + * if offset > 0: # <<<<<<<<<<<<<< + * aligned_p += alignment - offset + * + */ + } + + /* "View.MemoryView":308 + * aligned_p += alignment - offset + * + * return aligned_p # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((void *)__pyx_v_aligned_p); + goto __pyx_L0; + + /* "View.MemoryView":297 + * + * @cname('__pyx_align_pointer') + * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< + * "Align pointer memory on a given boundary" + * cdef Py_intptr_t aligned_p = memory + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":344 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + +/* Python wrapper */ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_obj = 0; + int __pyx_v_flags; + int __pyx_v_dtype_is_object; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 344, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_obj = values[0]; + __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error) + if (values[2]) { + __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error) + } else { + __pyx_v_dtype_is_object = ((int)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "View.MemoryView":345 + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj # <<<<<<<<<<<<<< + * self.flags = flags + * if type(self) is memoryview or obj is not None: + */ + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + __Pyx_GOTREF(__pyx_v_self->obj); + __Pyx_DECREF(__pyx_v_self->obj); + __pyx_v_self->obj = __pyx_v_obj; + + /* "View.MemoryView":346 + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): + * self.obj = obj + * self.flags = flags # <<<<<<<<<<<<<< + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + */ + __pyx_v_self->flags = __pyx_v_flags; + + /* "View.MemoryView":347 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_obj != Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "View.MemoryView":348 + * self.flags = flags + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< + * if self.view.obj == NULL: + * (<__pyx_buffer *> &self.view).obj = Py_None + */ + __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 348, __pyx_L1_error) + + /* "View.MemoryView":349 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":350 + * __Pyx_GetBuffer(obj, &self.view, flags) + * 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; + + /* "View.MemoryView":351 + * 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); + + /* "View.MemoryView":349 + * if type(self) is memoryview or obj is not None: + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &self.view).obj = Py_None + * Py_INCREF(Py_None) + */ + } + + /* "View.MemoryView":347 + * self.obj = obj + * self.flags = flags + * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< + * __Pyx_GetBuffer(obj, &self.view, flags) + * if self.view.obj == NULL: + */ + } + + /* "View.MemoryView":354 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":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] # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + */ + __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + + /* "View.MemoryView":356 + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); + + /* "View.MemoryView":354 + * + * global __pyx_memoryview_thread_locks_used + * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + */ + } + + /* "View.MemoryView":357 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":358 + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< + * if self.lock is NULL: + * raise MemoryError + */ + __pyx_v_self->lock = PyThread_allocate_lock(); + + /* "View.MemoryView":359 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":360 + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + PyErr_NoMemory(); __PYX_ERR(1, 360, __pyx_L1_error) + + /* "View.MemoryView":359 + * if self.lock is NULL: + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "View.MemoryView":357 + * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] + * __pyx_memoryview_thread_locks_used += 1 + * if self.lock is NULL: # <<<<<<<<<<<<<< + * self.lock = PyThread_allocate_lock() + * if self.lock is NULL: + */ + } + + /* "View.MemoryView":362 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":363 + * + * if flags & PyBUF_FORMAT: + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< + * else: + * self.dtype_is_object = dtype_is_object + */ + __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_self->dtype_is_object = __pyx_t_1; + + /* "View.MemoryView":362 + * raise MemoryError + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + */ + goto __pyx_L10; + } + + /* "View.MemoryView":365 + * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') + * else: + * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< + * + * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( + */ + /*else*/ { + __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; + } + __pyx_L10:; + + /* "View.MemoryView":367 + * 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 + */ + __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); + + /* "View.MemoryView":369 + * 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":344 + * cdef __Pyx_TypeInfo *typeinfo + * + * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< + * self.obj = obj + * self.flags = flags + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":371 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + +/* Python wrapper */ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { + int __pyx_v_i; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyThread_type_lock __pyx_t_6; + PyThread_type_lock __pyx_t_7; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":372 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + __pyx_t_1 = (__pyx_v_self->obj != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":373 + * def __dealloc__(memoryview self): + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< + * + * cdef int i + */ + __Pyx_ReleaseBuffer((&__pyx_v_self->view)); + + /* "View.MemoryView":372 + * + * def __dealloc__(memoryview self): + * if self.obj is not None: # <<<<<<<<<<<<<< + * __Pyx_ReleaseBuffer(&self.view) + * + */ + } + + /* "View.MemoryView":377 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":378 + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + */ + __pyx_t_3 = __pyx_memoryview_thread_locks_used; + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_v_i = __pyx_t_5; + + /* "View.MemoryView":379 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":380 + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + */ + __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); + + /* "View.MemoryView":381 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":383 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); + __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); + + /* "View.MemoryView":382 + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break + */ + (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; + (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; + + /* "View.MemoryView":381 + * if __pyx_memoryview_thread_locks[i] is self.lock: + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + */ + } + + /* "View.MemoryView":384 + * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( + * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) + * break # <<<<<<<<<<<<<< + * else: + * PyThread_free_lock(self.lock) + */ + goto __pyx_L6_break; + + /* "View.MemoryView":379 + * if self.lock != NULL: + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< + * __pyx_memoryview_thread_locks_used -= 1 + * if i != __pyx_memoryview_thread_locks_used: + */ + } + } + /*else*/ { + + /* "View.MemoryView":386 + * 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); + } + __pyx_L6_break:; + + /* "View.MemoryView":377 + * cdef int i + * global __pyx_memoryview_thread_locks_used + * if self.lock != NULL: # <<<<<<<<<<<<<< + * for i in range(__pyx_memoryview_thread_locks_used): + * if __pyx_memoryview_thread_locks[i] is self.lock: + */ + } + + /* "View.MemoryView":371 + * self.typeinfo = NULL + * + * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< + * if self.obj is not None: + * __Pyx_ReleaseBuffer(&self.view) + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":388 + * 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 + */ + +static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + Py_ssize_t __pyx_v_dim; + char *__pyx_v_itemp; + PyObject *__pyx_v_idx = NULL; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + char *__pyx_t_7; + __Pyx_RefNannySetupContext("get_item_pointer", 0); + + /* "View.MemoryView":390 + * 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":392 + * 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)) { + __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 392, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 392, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_v_dim = __pyx_t_1; + __pyx_t_1 = (__pyx_t_1 + 1); + + /* "View.MemoryView":393 + * + * 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(1, 393, __pyx_L1_error) + __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 393, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_7; + + /* "View.MemoryView":392 + * 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":395 + * itemp = pybuffer_index(&self.view, itemp, idx, dim) + * + * return itemp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_itemp; + goto __pyx_L0; + + /* "View.MemoryView":388 + * 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 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":398 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_indices = NULL; + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + char *__pyx_t_6; + __Pyx_RefNannySetupContext("__getitem__", 0); + + /* "View.MemoryView":399 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":400 + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: + * return self # <<<<<<<<<<<<<< + * + * have_slices, indices = _unellipsify(index, self.view.ndim) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "View.MemoryView":399 + * + * def __getitem__(memoryview self, object index): + * if index is Ellipsis: # <<<<<<<<<<<<<< + * return self + * + */ + } + + /* "View.MemoryView":402 + * 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(1, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(__pyx_t_3 != Py_None)) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 402, __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_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 402, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_indices = __pyx_t_5; + __pyx_t_5 = 0; + + /* "View.MemoryView":405 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 405, __pyx_L1_error) + if (__pyx_t_2) { + + /* "View.MemoryView":406 + * cdef char *itemp + * if have_slices: + * return memview_slice(self, indices) # <<<<<<<<<<<<<< + * else: + * itemp = self.get_item_pointer(indices) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":405 + * + * cdef char *itemp + * if have_slices: # <<<<<<<<<<<<<< + * return memview_slice(self, indices) + * else: + */ + } + + /* "View.MemoryView":408 + * return memview_slice(self, indices) + * 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(1, 408, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_6; + + /* "View.MemoryView":409 + * else: + * itemp = self.get_item_pointer(indices) + * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< + * + * def __setitem__(memoryview self, object index, object value): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":398 + * + * + * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< + * if index is Ellipsis: + * return self + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_indices); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":411 + * 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") + */ + +/* Python wrapper */ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + PyObject *__pyx_v_have_slices = NULL; + PyObject *__pyx_v_obj = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__setitem__", 0); + __Pyx_INCREF(__pyx_v_index); + + /* "View.MemoryView":412 + * + * 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)) { + + /* "View.MemoryView":413 + * 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__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 413, __pyx_L1_error) + + /* "View.MemoryView":412 + * + * def __setitem__(memoryview self, object index, object value): + * if self.view.readonly: # <<<<<<<<<<<<<< + * raise TypeError("Cannot assign to read-only memoryview") + * + */ + } + + /* "View.MemoryView":415 + * 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(1, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(__pyx_t_2 != Py_None)) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(1, 415, __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_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 415, __pyx_L1_error) + } + __pyx_v_have_slices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":417 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 417, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":418 + * + * if have_slices: + * obj = self.is_slice(value) # <<<<<<<<<<<<<< + * if obj: + * self.setitem_slice_assignment(self[index], obj) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_obj = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":419 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 419, __pyx_L1_error) + if (__pyx_t_1) { + + /* "View.MemoryView":420 + * obj = self.is_slice(value) + * if obj: + * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< + * else: + * self.setitem_slice_assign_scalar(self[index], value) + */ + __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "View.MemoryView":419 + * if have_slices: + * obj = self.is_slice(value) + * if obj: # <<<<<<<<<<<<<< + * self.setitem_slice_assignment(self[index], obj) + * else: + */ + goto __pyx_L5; + } + + /* "View.MemoryView":422 + * self.setitem_slice_assignment(self[index], obj) + * else: + * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< + * else: + * self.setitem_indexed(index, value) + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 422, __pyx_L1_error) + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L5:; + + /* "View.MemoryView":417 + * have_slices, index = _unellipsify(index, self.view.ndim) + * + * if have_slices: # <<<<<<<<<<<<<< + * obj = self.is_slice(value) + * if obj: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":424 + * self.setitem_slice_assign_scalar(self[index], value) + * else: + * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< + * + * cdef is_slice(self, obj): + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L4:; + + /* "View.MemoryView":411 + * 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") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_have_slices); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":426 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + +static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("is_slice", 0); + __Pyx_INCREF(__pyx_v_obj); + + /* "View.MemoryView":427 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "View.MemoryView":429 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":430 + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) # <<<<<<<<<<<<<< + * except TypeError: + * return None + */ + __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "View.MemoryView":429 + * if not isinstance(obj, memoryview): + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< + * self.dtype_is_object) + * except TypeError: + */ + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 429, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); + __pyx_t_7 = 0; + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":431 + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + * except TypeError: # <<<<<<<<<<<<<< + * return None + * + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_9) { + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 431, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_6); + + /* "View.MemoryView":432 + * self.dtype_is_object) + * except TypeError: + * return None # <<<<<<<<<<<<<< + * + * return obj + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L7_except_return; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "View.MemoryView":428 + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): + * try: # <<<<<<<<<<<<<< + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + * self.dtype_is_object) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L7_except_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + __pyx_L9_try_end:; + } + + /* "View.MemoryView":427 + * + * cdef is_slice(self, obj): + * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< + * try: + * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, + */ + } + + /* "View.MemoryView":434 + * return None + * + * return obj # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assignment(self, dst, src): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_obj); + __pyx_r = __pyx_v_obj; + goto __pyx_L0; + + /* "View.MemoryView":426 + * self.setitem_indexed(index, value) + * + * cdef is_slice(self, obj): # <<<<<<<<<<<<<< + * if not isinstance(obj, memoryview): + * try: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":436 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + +static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { + __Pyx_memviewslice __pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_src_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); + + /* "View.MemoryView":440 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 440, __pyx_L1_error) + + /* "View.MemoryView":441 + * + * 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(1, 441, __pyx_L1_error) + + /* "View.MemoryView":442 + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":440 + * cdef __Pyx_memviewslice src_slice + * + * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< + * get_slice_from_memview(dst, &dst_slice)[0], + * src.ndim, dst.ndim, self.dtype_is_object) + */ + __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 440, __pyx_L1_error) + + /* "View.MemoryView":436 + * return obj + * + * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice dst_slice + * cdef __Pyx_memviewslice src_slice + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":444 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + +static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { + int __pyx_v_array[0x80]; + void *__pyx_v_tmp; + void *__pyx_v_item; + __Pyx_memviewslice *__pyx_v_dst_slice; + __Pyx_memviewslice __pyx_v_tmp_slice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + char const *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); + + /* "View.MemoryView":446 + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): + * cdef int array[128] + * cdef void *tmp = NULL # <<<<<<<<<<<<<< + * cdef void *item + * + */ + __pyx_v_tmp = NULL; + + /* "View.MemoryView":451 + * 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_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); + + /* "View.MemoryView":453 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":454 + * + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< + * if tmp == NULL: + * raise MemoryError + */ + __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); + + /* "View.MemoryView":455 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":456 + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + * raise MemoryError # <<<<<<<<<<<<<< + * item = tmp + * else: + */ + PyErr_NoMemory(); __PYX_ERR(1, 456, __pyx_L1_error) + + /* "View.MemoryView":455 + * if self.view.itemsize > sizeof(array): + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: # <<<<<<<<<<<<<< + * raise MemoryError + * item = tmp + */ + } + + /* "View.MemoryView":457 + * if tmp == NULL: + * raise MemoryError + * item = tmp # <<<<<<<<<<<<<< + * else: + * item = array + */ + __pyx_v_item = __pyx_v_tmp; + + /* "View.MemoryView":453 + * dst_slice = get_slice_from_memview(dst, &tmp_slice) + * + * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< + * tmp = PyMem_Malloc(self.view.itemsize) + * if tmp == NULL: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":459 + * item = tmp + * else: + * item = array # <<<<<<<<<<<<<< + * + * try: + */ + /*else*/ { + __pyx_v_item = ((void *)__pyx_v_array); + } + __pyx_L3:; + + /* "View.MemoryView":461 + * item = array + * + * try: # <<<<<<<<<<<<<< + * if self.dtype_is_object: + * ( item)[0] = value + */ + /*try:*/ { + + /* "View.MemoryView":462 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":463 + * try: + * if self.dtype_is_object: + * ( item)[0] = value # <<<<<<<<<<<<<< + * else: + * self.assign_item_from_object( item, value) + */ + (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); + + /* "View.MemoryView":462 + * + * try: + * if self.dtype_is_object: # <<<<<<<<<<<<<< + * ( item)[0] = value + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":465 + * ( item)[0] = value + * else: + * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_L8:; + + /* "View.MemoryView":469 + * + * + * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":470 + * + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, + * item, self.dtype_is_object) + */ + __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":469 + * + * + * 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, + */ + } + + /* "View.MemoryView":471 + * if self.view.suboffsets != NULL: + * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) + * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< + * item, self.dtype_is_object) + * finally: + */ + __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); + } + + /* "View.MemoryView":474 + * item, self.dtype_is_object) + * finally: + * PyMem_Free(tmp) # <<<<<<<<<<<<<< + * + * cdef setitem_indexed(self, index, value): + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_tmp); + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; + { + PyMem_Free(__pyx_v_tmp); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + } + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; + __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "View.MemoryView":444 + * src.ndim, dst.ndim, self.dtype_is_object) + * + * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< + * cdef int array[128] + * cdef void *tmp = NULL + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":476 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + +static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { + char *__pyx_v_itemp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + char *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("setitem_indexed", 0); + + /* "View.MemoryView":477 + * + * 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(1, 477, __pyx_L1_error) + __pyx_v_itemp = __pyx_t_1; + + /* "View.MemoryView":478 + * 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(1, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":476 + * PyMem_Free(tmp) + * + * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< + * cdef char *itemp = self.get_item_pointer(index) + * self.assign_item_from_object(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":480 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_v_struct = NULL; + PyObject *__pyx_v_bytesitem = 0; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":483 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef bytes bytesitem + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":486 + * cdef bytes bytesitem + * + * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< + * try: + * result = struct.unpack(self.view.format, bytesitem) + */ + __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "View.MemoryView":488 + * bytesitem = itemp[:self.view.itemsize] + * try: + * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< + * except struct.error: + * raise ValueError("Unable to convert item to object") + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); + __Pyx_INCREF(__pyx_v_bytesitem); + __Pyx_GIVEREF(__pyx_v_bytesitem); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + } + + /* "View.MemoryView":492 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + /*else:*/ { + __pyx_t_10 = strlen(__pyx_v_self->view.format); + __pyx_t_11 = ((__pyx_t_10 == 1) != 0); + if (__pyx_t_11) { + + /* "View.MemoryView":493 + * else: + * if len(self.view.format) == 1: + * return result[0] # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L6_except_return; + + /* "View.MemoryView":492 + * raise ValueError("Unable to convert item to object") + * else: + * if len(self.view.format) == 1: # <<<<<<<<<<<<<< + * return result[0] + * return result + */ + } + + /* "View.MemoryView":494 + * if len(self.view.format) == 1: + * return result[0] + * return result # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L6_except_return; + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":489 + * try: + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: # <<<<<<<<<<<<<< + * raise ValueError("Unable to convert item to object") + * else: + */ + __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); + __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; + if (__pyx_t_8) { + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 489, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + + /* "View.MemoryView":490 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __PYX_ERR(1, 490, __pyx_L5_except_error) + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "View.MemoryView":487 + * + * bytesitem = itemp[:self.view.itemsize] + * try: # <<<<<<<<<<<<<< + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L0; + } + + /* "View.MemoryView":480 + * self.assign_item_from_object(itemp, value) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesitem); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":496 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + +static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_v_struct = NULL; + char __pyx_v_c; + PyObject *__pyx_v_bytesvalue = 0; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + char *__pyx_t_12; + char *__pyx_t_13; + char *__pyx_t_14; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":499 + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + * import struct # <<<<<<<<<<<<<< + * cdef char c + * cdef bytes bytesvalue + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_struct = __pyx_t_1; + __pyx_t_1 = 0; + + /* "View.MemoryView":504 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + __pyx_t_2 = PyTuple_Check(__pyx_v_value); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "View.MemoryView":505 + * + * if isinstance(value, tuple): + * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< + * else: + * bytesvalue = struct.pack(self.view.format, value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 505, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "View.MemoryView":504 + * cdef Py_ssize_t i + * + * if isinstance(value, tuple): # <<<<<<<<<<<<<< + * bytesvalue = struct.pack(self.view.format, *value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":507 + * bytesvalue = struct.pack(self.view.format, *value) + * else: + * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< + * + * for i, c in enumerate(bytesvalue): + */ + /*else*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 507, __pyx_L1_error) + __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":509 + * 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)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); + __PYX_ERR(1, 509, __pyx_L1_error) + } + __Pyx_INCREF(__pyx_v_bytesvalue); + __pyx_t_10 = __pyx_v_bytesvalue; + __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); + __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); + for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { + __pyx_t_11 = __pyx_t_14; + __pyx_v_c = (__pyx_t_11[0]); + + /* "View.MemoryView":510 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + __pyx_v_i = __pyx_t_9; + + /* "View.MemoryView":509 + * 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":510 + * + * for i, c in enumerate(bytesvalue): + * itemp[i] = c # <<<<<<<<<<<<<< + * + * @cname('getbuffer') + */ + (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "View.MemoryView":496 + * return result + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * """Only used if instantiated manually by the user, or if Cython doesn't + * know how to convert the type""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_struct); + __Pyx_XDECREF(__pyx_v_bytesvalue); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":513 + * + * @cname('getbuffer') + * 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") + */ + +/* Python wrapper */ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + char *__pyx_t_5; + void *__pyx_t_6; + int __pyx_t_7; + Py_ssize_t __pyx_t_8; + if (__pyx_v_info == NULL) { + PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); + return -1; + } + __Pyx_RefNannySetupContext("__getbuffer__", 0); + __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(__pyx_v_info->obj); + + /* "View.MemoryView":514 + * @cname('getbuffer') + * 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) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->view.readonly != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":515 + * 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_STRIDES: + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 515, __pyx_L1_error) + + /* "View.MemoryView":514 + * @cname('getbuffer') + * 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":517 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":518 + * + * if flags & PyBUF_STRIDES: + * info.shape = self.view.shape # <<<<<<<<<<<<<< + * else: + * info.shape = NULL + */ + __pyx_t_4 = __pyx_v_self->view.shape; + __pyx_v_info->shape = __pyx_t_4; + + /* "View.MemoryView":517 + * raise ValueError("Cannot create writable memory view from read-only memoryview") + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.shape = self.view.shape + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":520 + * info.shape = self.view.shape + * else: + * info.shape = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_STRIDES: + */ + /*else*/ { + __pyx_v_info->shape = NULL; + } + __pyx_L6:; + + /* "View.MemoryView":522 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":523 + * + * if flags & PyBUF_STRIDES: + * info.strides = self.view.strides # <<<<<<<<<<<<<< + * else: + * info.strides = NULL + */ + __pyx_t_4 = __pyx_v_self->view.strides; + __pyx_v_info->strides = __pyx_t_4; + + /* "View.MemoryView":522 + * info.shape = NULL + * + * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< + * info.strides = self.view.strides + * else: + */ + goto __pyx_L7; + } + + /* "View.MemoryView":525 + * info.strides = self.view.strides + * else: + * info.strides = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_INDIRECT: + */ + /*else*/ { + __pyx_v_info->strides = NULL; + } + __pyx_L7:; + + /* "View.MemoryView":527 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":528 + * + * if flags & PyBUF_INDIRECT: + * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< + * else: + * info.suboffsets = NULL + */ + __pyx_t_4 = __pyx_v_self->view.suboffsets; + __pyx_v_info->suboffsets = __pyx_t_4; + + /* "View.MemoryView":527 + * info.strides = NULL + * + * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< + * info.suboffsets = self.view.suboffsets + * else: + */ + goto __pyx_L8; + } + + /* "View.MemoryView":530 + * info.suboffsets = self.view.suboffsets + * else: + * info.suboffsets = NULL # <<<<<<<<<<<<<< + * + * if flags & PyBUF_FORMAT: + */ + /*else*/ { + __pyx_v_info->suboffsets = NULL; + } + __pyx_L8:; + + /* "View.MemoryView":532 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":533 + * + * if flags & PyBUF_FORMAT: + * info.format = self.view.format # <<<<<<<<<<<<<< + * else: + * info.format = NULL + */ + __pyx_t_5 = __pyx_v_self->view.format; + __pyx_v_info->format = __pyx_t_5; + + /* "View.MemoryView":532 + * info.suboffsets = NULL + * + * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< + * info.format = self.view.format + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":535 + * info.format = self.view.format + * else: + * info.format = NULL # <<<<<<<<<<<<<< + * + * info.buf = self.view.buf + */ + /*else*/ { + __pyx_v_info->format = NULL; + } + __pyx_L9:; + + /* "View.MemoryView":537 + * info.format = NULL + * + * info.buf = self.view.buf # <<<<<<<<<<<<<< + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + */ + __pyx_t_6 = __pyx_v_self->view.buf; + __pyx_v_info->buf = __pyx_t_6; + + /* "View.MemoryView":538 + * + * info.buf = self.view.buf + * info.ndim = self.view.ndim # <<<<<<<<<<<<<< + * info.itemsize = self.view.itemsize + * info.len = self.view.len + */ + __pyx_t_7 = __pyx_v_self->view.ndim; + __pyx_v_info->ndim = __pyx_t_7; + + /* "View.MemoryView":539 + * info.buf = self.view.buf + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< + * info.len = self.view.len + * info.readonly = self.view.readonly + */ + __pyx_t_8 = __pyx_v_self->view.itemsize; + __pyx_v_info->itemsize = __pyx_t_8; + + /* "View.MemoryView":540 + * info.ndim = self.view.ndim + * info.itemsize = self.view.itemsize + * info.len = self.view.len # <<<<<<<<<<<<<< + * info.readonly = self.view.readonly + * info.obj = self + */ + __pyx_t_8 = __pyx_v_self->view.len; + __pyx_v_info->len = __pyx_t_8; + + /* "View.MemoryView":541 + * info.itemsize = self.view.itemsize + * 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; + + /* "View.MemoryView":542 + * 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)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); + __pyx_v_info->obj = ((PyObject *)__pyx_v_self); + + /* "View.MemoryView":513 + * + * @cname('getbuffer') + * 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") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + if (__pyx_v_info->obj != NULL) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + goto __pyx_L2; + __pyx_L0:; + if (__pyx_v_info->obj == Py_None) { + __Pyx_GOTREF(__pyx_v_info->obj); + __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; + } + __pyx_L2:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":548 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":549 + * @property + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< + * transpose_memslice(&result.from_slice) + * return result + */ + __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 549, __pyx_L1_error) + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":550 + * def T(self): + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 550, __pyx_L1_error) + + /* "View.MemoryView":551 + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":548 + * + * @property + * def T(self): # <<<<<<<<<<<<<< + * cdef _memoryviewslice result = memoryview_copy(self) + * transpose_memslice(&result.from_slice) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":554 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":555 + * @property + * def base(self): + * return self.obj # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->obj); + __pyx_r = __pyx_v_self->obj; + goto __pyx_L0; + + /* "View.MemoryView":554 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.obj + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":558 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_length; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":559 + * @property + * def shape(self): + * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); + for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { + __pyx_t_2 = __pyx_t_4; + __pyx_v_length = (__pyx_t_2[0]); + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":558 + * + * @property + * def shape(self): # <<<<<<<<<<<<<< + * return tuple([length for length in self.view.shape[:self.view.ndim]]) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":562 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_stride; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":563 + * @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); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":565 + * 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__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 565, __pyx_L1_error) + + /* "View.MemoryView":563 + * @property + * def strides(self): + * if self.view.strides == NULL: # <<<<<<<<<<<<<< + * + * raise ValueError("Buffer view does not expose strides") + */ + } + + /* "View.MemoryView":567 + * 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); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); + for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { + __pyx_t_3 = __pyx_t_5; + __pyx_v_stride = (__pyx_t_3[0]); + __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "View.MemoryView":562 + * + * @property + * def strides(self): # <<<<<<<<<<<<<< + * if self.view.strides == NULL: + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":570 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + Py_ssize_t *__pyx_t_6; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":571 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":572 + * 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); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__32, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":571 + * @property + * def suboffsets(self): + * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< + * return (-1,) * self.view.ndim + * + */ + } + + /* "View.MemoryView":574 + * return (-1,) * self.view.ndim + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); + for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { + __pyx_t_4 = __pyx_t_6; + __pyx_v_suboffset = (__pyx_t_4[0]); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":570 + * + * @property + * def suboffsets(self): # <<<<<<<<<<<<<< + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":577 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":578 + * @property + * def ndim(self): + * return self.view.ndim # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":577 + * + * @property + * def ndim(self): # <<<<<<<<<<<<<< + * return self.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":581 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":582 + * @property + * def itemsize(self): + * return self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":581 + * + * @property + * def itemsize(self): # <<<<<<<<<<<<<< + * return self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":585 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":586 + * @property + * def nbytes(self): + * return self.size * self.view.itemsize # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":585 + * + * @property + * def nbytes(self): # <<<<<<<<<<<<<< + * return self.size * self.view.itemsize + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":589 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + Py_ssize_t *__pyx_t_3; + Py_ssize_t *__pyx_t_4; + Py_ssize_t *__pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":590 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + __pyx_t_1 = (__pyx_v_self->_size == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":591 + * def size(self): + * if self._size is None: + * result = 1 # <<<<<<<<<<<<<< + * + * for length in self.view.shape[:self.view.ndim]: + */ + __Pyx_INCREF(__pyx_int_1); + __pyx_v_result = __pyx_int_1; + + /* "View.MemoryView":593 + * 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++) { + __pyx_t_3 = __pyx_t_5; + __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); + __pyx_t_6 = 0; + + /* "View.MemoryView":594 + * + * for length in self.view.shape[:self.view.ndim]: + * result *= length # <<<<<<<<<<<<<< + * + * self._size = result + */ + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); + __pyx_t_6 = 0; + } + + /* "View.MemoryView":596 + * result *= length + * + * self._size = result # <<<<<<<<<<<<<< + * + * return self._size + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->_size); + __Pyx_DECREF(__pyx_v_self->_size); + __pyx_v_self->_size = __pyx_v_result; + + /* "View.MemoryView":590 + * @property + * def size(self): + * if self._size is None: # <<<<<<<<<<<<<< + * result = 1 + * + */ + } + + /* "View.MemoryView":598 + * self._size = result + * + * return self._size # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_size); + __pyx_r = __pyx_v_self->_size; + goto __pyx_L0; + + /* "View.MemoryView":589 + * + * @property + * def size(self): # <<<<<<<<<<<<<< + * if self._size is None: + * result = 1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":600 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "View.MemoryView":601 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":602 + * 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":601 + * + * def __len__(self): + * if self.view.ndim >= 1: # <<<<<<<<<<<<<< + * return self.view.shape[0] + * + */ + } + + /* "View.MemoryView":604 + * return self.view.shape[0] + * + * return 0 # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":600 + * return self._size + * + * def __len__(self): # <<<<<<<<<<<<<< + * if self.view.ndim >= 1: + * return self.view.shape[0] + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":606 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "View.MemoryView":607 + * + * 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(1, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "View.MemoryView":608 + * 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(1, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "View.MemoryView":607 + * + * def __repr__(self): + * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< + * id(self)) + * + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":606 + * return 0 + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__, + * id(self)) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":610 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "View.MemoryView":611 + * + * 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(1, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":610 + * id(self)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return "" % (self.base.__class__.__name__,) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":614 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_c_contig", 0); + + /* "View.MemoryView":617 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":618 + * 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); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":614 + * + * + * def is_c_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":620 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice *__pyx_v_mslice; + __Pyx_memviewslice __pyx_v_tmp; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_f_contig", 0); + + /* "View.MemoryView":623 + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< + * return slice_is_contig(mslice[0], 'F', self.view.ndim) + * + */ + __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); + + /* "View.MemoryView":624 + * 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); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":620 + * return slice_is_contig(mslice[0], 'C', self.view.ndim) + * + * def is_f_contig(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice *mslice + * cdef __Pyx_memviewslice tmp + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":626 + * 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 + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_mslice; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("copy", 0); + + /* "View.MemoryView":628 + * 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":630 + * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS + * + * slice_copy(self, &mslice) # <<<<<<<<<<<<<< + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); + + /* "View.MemoryView":631 + * + * slice_copy(self, &mslice) + * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_C_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error) + __pyx_v_mslice = __pyx_t_1; + + /* "View.MemoryView":636 + * self.dtype_is_object) + * + * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< + * + * def copy_fortran(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":626 + * 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 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":638 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + +/* Python wrapper */ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); + __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_memviewslice __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("copy_fortran", 0); + + /* "View.MemoryView":640 + * 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":642 + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + * + * slice_copy(self, &src) # <<<<<<<<<<<<<< + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, + * self.view.itemsize, + */ + __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); + + /* "View.MemoryView":643 + * + * slice_copy(self, &src) + * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< + * self.view.itemsize, + * flags|PyBUF_F_CONTIGUOUS, + */ + __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 643, __pyx_L1_error) + __pyx_v_dst = __pyx_t_1; + + /* "View.MemoryView":648 + * 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(1, 648, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":638 + * return memoryview_copy_from_slice(self, &mslice) + * + * def copy_fortran(self): # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice src, dst + * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":652 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + +static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { + struct __pyx_memoryview_obj *__pyx_v_result = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); + + /* "View.MemoryView":653 + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< + * result.typeinfo = typeinfo + * return result + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_o); + __Pyx_GIVEREF(__pyx_v_o); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":654 + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_v_result->typeinfo = __pyx_v_typeinfo; + + /* "View.MemoryView":655 + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_check') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":652 + * + * @cname('__pyx_memoryview_new') + * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< + * cdef memoryview result = memoryview(o, flags, dtype_is_object) + * result.typeinfo = typeinfo + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":658 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + +static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("memoryview_check", 0); + + /* "View.MemoryView":659 + * @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_r = __pyx_t_1; + goto __pyx_L0; + + /* "View.MemoryView":658 + * + * @cname('__pyx_memoryview_check') + * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< + * return isinstance(o, memoryview) + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":661 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + +static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { + PyObject *__pyx_v_tup = NULL; + PyObject *__pyx_v_result = NULL; + int __pyx_v_have_slices; + int __pyx_v_seen_ellipsis; + CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; + PyObject *__pyx_v_item = NULL; + Py_ssize_t __pyx_v_nslices; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + __Pyx_RefNannySetupContext("_unellipsify", 0); + + /* "View.MemoryView":666 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + __pyx_t_1 = PyTuple_Check(__pyx_v_index); + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":667 + * """ + * if not isinstance(index, tuple): + * tup = (index,) # <<<<<<<<<<<<<< + * else: + * tup = index + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_index); + __Pyx_GIVEREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); + __pyx_v_tup = __pyx_t_3; + __pyx_t_3 = 0; + + /* "View.MemoryView":666 + * full slices. + * """ + * if not isinstance(index, tuple): # <<<<<<<<<<<<<< + * tup = (index,) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":669 + * tup = (index,) + * else: + * tup = index # <<<<<<<<<<<<<< + * + * result = [] + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_index); + __pyx_v_tup = __pyx_v_index; + } + __pyx_L3:; + + /* "View.MemoryView":671 + * tup = index + * + * result = [] # <<<<<<<<<<<<<< + * have_slices = False + * seen_ellipsis = False + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":672 + * + * result = [] + * have_slices = False # <<<<<<<<<<<<<< + * seen_ellipsis = False + * for idx, item in enumerate(tup): + */ + __pyx_v_have_slices = 0; + + /* "View.MemoryView":673 + * result = [] + * have_slices = False + * seen_ellipsis = False # <<<<<<<<<<<<<< + * for idx, item in enumerate(tup): + * if item is Ellipsis: + */ + __pyx_v_seen_ellipsis = 0; + + /* "View.MemoryView":674 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_t_3 = __pyx_int_0; + if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { + __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 674, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_INCREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); + __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + + /* "View.MemoryView":675 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":676 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":677 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 677, __pyx_L1_error) + __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__35); + __Pyx_GIVEREF(__pyx_slice__35); + PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__35); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 677, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "View.MemoryView":678 + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True # <<<<<<<<<<<<<< + * else: + * result.append(slice(None)) + */ + __pyx_v_seen_ellipsis = 1; + + /* "View.MemoryView":676 + * for idx, item in enumerate(tup): + * if item is Ellipsis: + * if not seen_ellipsis: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + * seen_ellipsis = True + */ + goto __pyx_L7; + } + + /* "View.MemoryView":680 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__36); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 680, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":681 + * else: + * result.append(slice(None)) + * have_slices = True # <<<<<<<<<<<<<< + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + */ + __pyx_v_have_slices = 1; + + /* "View.MemoryView":675 + * seen_ellipsis = False + * for idx, item in enumerate(tup): + * if item is Ellipsis: # <<<<<<<<<<<<<< + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) + */ + goto __pyx_L6; + } + + /* "View.MemoryView":683 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + /*else*/ { + __pyx_t_2 = PySlice_Check(__pyx_v_item); + __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); + __pyx_t_1 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":684 + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): + * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< + * + * have_slices = have_slices or isinstance(item, slice) + */ + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_11, 0, 0, 0); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __PYX_ERR(1, 684, __pyx_L1_error) + + /* "View.MemoryView":683 + * have_slices = True + * else: + * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + */ + } + + /* "View.MemoryView":686 + * raise TypeError("Cannot index with type '%s'" % type(item)) + * + * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< + * result.append(item) + * + */ + __pyx_t_10 = (__pyx_v_have_slices != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_1 = __pyx_t_10; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = PySlice_Check(__pyx_v_item); + __pyx_t_2 = (__pyx_t_10 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L11_bool_binop_done:; + __pyx_v_have_slices = __pyx_t_1; + + /* "View.MemoryView":687 + * + * 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(1, 687, __pyx_L1_error) + } + __pyx_L6:; + + /* "View.MemoryView":674 + * have_slices = False + * seen_ellipsis = False + * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< + * if item is Ellipsis: + * if not seen_ellipsis: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":689 + * result.append(item) + * + * nslices = ndim - len(result) # <<<<<<<<<<<<<< + * if nslices: + * result.extend([slice(None)] * nslices) + */ + __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 689, __pyx_L1_error) + __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); + + /* "View.MemoryView":690 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + __pyx_t_1 = (__pyx_v_nslices != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":691 + * 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(1, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { + __Pyx_INCREF(__pyx_slice__37); + __Pyx_GIVEREF(__pyx_slice__37); + PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__37); + } + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":690 + * + * nslices = ndim - len(result) + * if nslices: # <<<<<<<<<<<<<< + * result.extend([slice(None)] * nslices) + * + */ + } + + /* "View.MemoryView":693 + * result.extend([slice(None)] * nslices) + * + * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + */ + __Pyx_XDECREF(__pyx_r); + if (!__pyx_v_have_slices) { + } else { + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_L14_bool_binop_done:; + __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + goto __pyx_L0; + + /* "View.MemoryView":661 + * return isinstance(o, memoryview) + * + * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< + * """ + * Replace all ellipses with full slices and fill incomplete indices with + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_tup); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_idx); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":695 + * 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: + */ + +static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + Py_ssize_t *__pyx_t_2; + Py_ssize_t *__pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); + + /* "View.MemoryView":696 + * + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") + */ + __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); + for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { + __pyx_t_1 = __pyx_t_3; + __pyx_v_suboffset = (__pyx_t_1[0]); + + /* "View.MemoryView":697 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); + if (unlikely(__pyx_t_4)) { + + /* "View.MemoryView":698 + * 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__38, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(1, 698, __pyx_L1_error) + + /* "View.MemoryView":697 + * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * raise ValueError("Indirect dimensions not supported") + * + */ + } + } + + /* "View.MemoryView":695 + * 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: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":705 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + +static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { + int __pyx_v_new_ndim; + int __pyx_v_suboffset_dim; + int __pyx_v_dim; + __Pyx_memviewslice __pyx_v_src; + __Pyx_memviewslice __pyx_v_dst; + __Pyx_memviewslice *__pyx_v_p_src; + struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; + __Pyx_memviewslice *__pyx_v_p_dst; + int *__pyx_v_p_suboffset_dim; + Py_ssize_t __pyx_v_start; + Py_ssize_t __pyx_v_stop; + Py_ssize_t __pyx_v_step; + int __pyx_v_have_start; + int __pyx_v_have_stop; + int __pyx_v_have_step; + PyObject *__pyx_v_index = NULL; + struct __pyx_memoryview_obj *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + struct __pyx_memoryview_obj *__pyx_t_4; + char *__pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + __Pyx_RefNannySetupContext("memview_slice", 0); + + /* "View.MemoryView":706 + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): + * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< + * cdef bint negative_step + * cdef __Pyx_memviewslice src, dst + */ + __pyx_v_new_ndim = 0; + __pyx_v_suboffset_dim = -1; + + /* "View.MemoryView":713 + * + * + * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< + * + * cdef _memoryviewslice memviewsliceobj + */ + (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); + + /* "View.MemoryView":717 + * cdef _memoryviewslice memviewsliceobj + * + * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(1, 717, __pyx_L1_error) + } + } + #endif + + /* "View.MemoryView":719 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":720 + * + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview # <<<<<<<<<<<<<< + * p_src = &memviewsliceobj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 720, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":721 + * if isinstance(memview, _memoryviewslice): + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, &src) + */ + __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); + + /* "View.MemoryView":719 + * assert memview.view.ndim > 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * memviewsliceobj = memview + * p_src = &memviewsliceobj.from_slice + */ + goto __pyx_L3; + } + + /* "View.MemoryView":723 + * p_src = &memviewsliceobj.from_slice + * else: + * slice_copy(memview, &src) # <<<<<<<<<<<<<< + * p_src = &src + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); + + /* "View.MemoryView":724 + * else: + * slice_copy(memview, &src) + * p_src = &src # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_p_src = (&__pyx_v_src); + } + __pyx_L3:; + + /* "View.MemoryView":730 + * + * + * 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":731 + * + * 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":736 + * + * + * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< + * cdef int *p_suboffset_dim = &suboffset_dim + * cdef Py_ssize_t start, stop, step + */ + __pyx_v_p_dst = (&__pyx_v_dst); + + /* "View.MemoryView":737 + * + * cdef __Pyx_memviewslice *p_dst = &dst + * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< + * cdef Py_ssize_t start, stop, step + * cdef bint have_start, have_stop, have_step + */ + __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); + + /* "View.MemoryView":741 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + __pyx_t_6 = 0; + if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { + __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 741, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } else { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error) + #else + __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + } + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(1, 741, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_9); + } + __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_v_dim = __pyx_t_6; + __pyx_t_6 = (__pyx_t_6 + 1); + + /* "View.MemoryView":742 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":746 + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< + * 0, 0, 0, # have_{start,stop,step} + * False) + */ + __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error) + + /* "View.MemoryView":743 + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 743, __pyx_L1_error) + + /* "View.MemoryView":742 + * + * for dim, index in enumerate(indices): + * if PyIndex_Check(index): # <<<<<<<<<<<<<< + * slice_memviewslice( + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + */ + goto __pyx_L6; + } + + /* "View.MemoryView":749 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + __pyx_t_2 = (__pyx_v_index == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":750 + * False) + * elif index is None: + * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + */ + (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; + + /* "View.MemoryView":751 + * elif index is None: + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 + */ + (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; + + /* "View.MemoryView":752 + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< + * new_ndim += 1 + * else: + */ + (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; + + /* "View.MemoryView":753 + * p_dst.strides[new_ndim] = 0 + * p_dst.suboffsets[new_ndim] = -1 + * new_ndim += 1 # <<<<<<<<<<<<<< + * else: + * start = index.start or 0 + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + + /* "View.MemoryView":749 + * 0, 0, 0, # have_{start,stop,step} + * False) + * elif index is None: # <<<<<<<<<<<<<< + * p_dst.shape[new_ndim] = 1 + * p_dst.strides[new_ndim] = 0 + */ + goto __pyx_L6; + } + + /* "View.MemoryView":755 + * new_ndim += 1 + * else: + * start = index.start or 0 # <<<<<<<<<<<<<< + * stop = index.stop or 0 + * step = index.step or 0 + */ + /*else*/ { + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 755, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L7_bool_binop_done:; + __pyx_v_start = __pyx_t_10; + + /* "View.MemoryView":756 + * else: + * start = index.start or 0 + * stop = index.stop or 0 # <<<<<<<<<<<<<< + * step = index.step or 0 + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L9_bool_binop_done:; + __pyx_v_stop = __pyx_t_10; + + /* "View.MemoryView":757 + * 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(1, 757, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error) + if (!__pyx_t_1) { + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error) + __pyx_t_10 = __pyx_t_12; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_10 = 0; + __pyx_L11_bool_binop_done:; + __pyx_v_step = __pyx_t_10; + + /* "View.MemoryView":759 + * step = index.step or 0 + * + * have_start = index.start is not None # <<<<<<<<<<<<<< + * have_stop = index.stop is not None + * have_step = index.step is not None + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_start = __pyx_t_1; + + /* "View.MemoryView":760 + * + * 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(1, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_stop = __pyx_t_1; + + /* "View.MemoryView":761 + * 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(1, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = (__pyx_t_9 != Py_None); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_have_step = __pyx_t_1; + + /* "View.MemoryView":763 + * have_step = index.step is not None + * + * slice_memviewslice( # <<<<<<<<<<<<<< + * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], + * dim, new_ndim, p_suboffset_dim, + */ + __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 763, __pyx_L1_error) + + /* "View.MemoryView":769 + * have_start, have_stop, have_step, + * True) + * new_ndim += 1 # <<<<<<<<<<<<<< + * + * if isinstance(memview, _memoryviewslice): + */ + __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); + } + __pyx_L6:; + + /* "View.MemoryView":741 + * cdef bint have_start, have_stop, have_step + * + * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< + * if PyIndex_Check(index): + * slice_memviewslice( + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "View.MemoryView":771 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":772 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":773 + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< + * memviewsliceobj.to_dtype_func, + * memview.dtype_is_object) + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 773, __pyx_L1_error) } + + /* "View.MemoryView":774 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) } + + /* "View.MemoryView":772 + * + * if isinstance(memview, _memoryviewslice): + * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, + */ + __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 772, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "View.MemoryView":771 + * new_ndim += 1 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + */ + } + + /* "View.MemoryView":777 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + /*else*/ { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + + /* "View.MemoryView":778 + * 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(1, 777, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "View.MemoryView":777 + * memview.dtype_is_object) + * else: + * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * + */ + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error) + __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":705 + * + * @cname('__pyx_memview_slice') + * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< + * cdef int new_ndim = 0, suboffset_dim = -1, dim + * cdef bint negative_step + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); + __Pyx_XDECREF(__pyx_v_index); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":802 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + +static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { + Py_ssize_t __pyx_v_new_shape; + int __pyx_v_negative_step; + int __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":822 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":824 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + __pyx_t_1 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":825 + * + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":824 + * if not is_slice: + * + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if not 0 <= start < shape: + */ + } + + /* "View.MemoryView":826 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + __pyx_t_1 = (0 <= __pyx_v_start); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); + } + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":827 + * start += shape + * if not 0 <= start < shape: + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< + * else: + * + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 827, __pyx_L1_error) + + /* "View.MemoryView":826 + * if start < 0: + * start += shape + * if not 0 <= start < shape: # <<<<<<<<<<<<<< + * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) + * else: + */ + } + + /* "View.MemoryView":822 + * cdef bint negative_step + * + * if not is_slice: # <<<<<<<<<<<<<< + * + * if start < 0: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":830 + * else: + * + * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< + * + * if have_step and step == 0: + */ + /*else*/ { + __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step < 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L6_bool_binop_done:; + __pyx_v_negative_step = __pyx_t_2; + + /* "View.MemoryView":832 + * negative_step = have_step != 0 and step < 0 + * + * if have_step and step == 0: # <<<<<<<<<<<<<< + * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) + * + */ + __pyx_t_1 = (__pyx_v_have_step != 0); + if (__pyx_t_1) { + } else { + __pyx_t_2 = __pyx_t_1; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_1 = ((__pyx_v_step == 0) != 0); + __pyx_t_2 = __pyx_t_1; + __pyx_L9_bool_binop_done:; + if (__pyx_t_2) { + + /* "View.MemoryView":833 + * + * 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(1, 833, __pyx_L1_error) + + /* "View.MemoryView":832 + * 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":836 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + __pyx_t_2 = (__pyx_v_have_start != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":837 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":838 + * if have_start: + * if start < 0: + * start += shape # <<<<<<<<<<<<<< + * if start < 0: + * start = 0 + */ + __pyx_v_start = (__pyx_v_start + __pyx_v_shape); + + /* "View.MemoryView":839 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + __pyx_t_2 = ((__pyx_v_start < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":840 + * start += shape + * if start < 0: + * start = 0 # <<<<<<<<<<<<<< + * elif start >= shape: + * if negative_step: + */ + __pyx_v_start = 0; + + /* "View.MemoryView":839 + * if start < 0: + * start += shape + * if start < 0: # <<<<<<<<<<<<<< + * start = 0 + * elif start >= shape: + */ + } + + /* "View.MemoryView":837 + * + * if have_start: + * if start < 0: # <<<<<<<<<<<<<< + * start += shape + * if start < 0: + */ + goto __pyx_L12; + } + + /* "View.MemoryView":841 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":842 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":843 + * elif start >= shape: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = shape + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":842 + * start = 0 + * elif start >= shape: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L14; + } + + /* "View.MemoryView":845 + * start = shape - 1 + * else: + * start = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + /*else*/ { + __pyx_v_start = __pyx_v_shape; + } + __pyx_L14:; + + /* "View.MemoryView":841 + * if start < 0: + * start = 0 + * elif start >= shape: # <<<<<<<<<<<<<< + * if negative_step: + * start = shape - 1 + */ + } + __pyx_L12:; + + /* "View.MemoryView":836 + * + * + * if have_start: # <<<<<<<<<<<<<< + * if start < 0: + * start += shape + */ + goto __pyx_L11; + } + + /* "View.MemoryView":847 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":848 + * else: + * if negative_step: + * start = shape - 1 # <<<<<<<<<<<<<< + * else: + * start = 0 + */ + __pyx_v_start = (__pyx_v_shape - 1); + + /* "View.MemoryView":847 + * start = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * start = shape - 1 + * else: + */ + goto __pyx_L15; + } + + /* "View.MemoryView":850 + * start = shape - 1 + * else: + * start = 0 # <<<<<<<<<<<<<< + * + * if have_stop: + */ + /*else*/ { + __pyx_v_start = 0; + } + __pyx_L15:; + } + __pyx_L11:; + + /* "View.MemoryView":852 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + __pyx_t_2 = (__pyx_v_have_stop != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":853 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":854 + * if have_stop: + * if stop < 0: + * stop += shape # <<<<<<<<<<<<<< + * if stop < 0: + * stop = 0 + */ + __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); + + /* "View.MemoryView":855 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + __pyx_t_2 = ((__pyx_v_stop < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":856 + * stop += shape + * if stop < 0: + * stop = 0 # <<<<<<<<<<<<<< + * elif stop > shape: + * stop = shape + */ + __pyx_v_stop = 0; + + /* "View.MemoryView":855 + * if stop < 0: + * stop += shape + * if stop < 0: # <<<<<<<<<<<<<< + * stop = 0 + * elif stop > shape: + */ + } + + /* "View.MemoryView":853 + * + * if have_stop: + * if stop < 0: # <<<<<<<<<<<<<< + * stop += shape + * if stop < 0: + */ + goto __pyx_L17; + } + + /* "View.MemoryView":857 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":858 + * stop = 0 + * elif stop > shape: + * stop = shape # <<<<<<<<<<<<<< + * else: + * if negative_step: + */ + __pyx_v_stop = __pyx_v_shape; + + /* "View.MemoryView":857 + * if stop < 0: + * stop = 0 + * elif stop > shape: # <<<<<<<<<<<<<< + * stop = shape + * else: + */ + } + __pyx_L17:; + + /* "View.MemoryView":852 + * start = 0 + * + * if have_stop: # <<<<<<<<<<<<<< + * if stop < 0: + * stop += shape + */ + goto __pyx_L16; + } + + /* "View.MemoryView":860 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + /*else*/ { + __pyx_t_2 = (__pyx_v_negative_step != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":861 + * else: + * if negative_step: + * stop = -1 # <<<<<<<<<<<<<< + * else: + * stop = shape + */ + __pyx_v_stop = -1L; + + /* "View.MemoryView":860 + * stop = shape + * else: + * if negative_step: # <<<<<<<<<<<<<< + * stop = -1 + * else: + */ + goto __pyx_L19; + } + + /* "View.MemoryView":863 + * stop = -1 + * else: + * stop = shape # <<<<<<<<<<<<<< + * + * if not have_step: + */ + /*else*/ { + __pyx_v_stop = __pyx_v_shape; + } + __pyx_L19:; + } + __pyx_L16:; + + /* "View.MemoryView":865 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":866 + * + * if not have_step: + * step = 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_step = 1; + + /* "View.MemoryView":865 + * stop = shape + * + * if not have_step: # <<<<<<<<<<<<<< + * step = 1 + * + */ + } + + /* "View.MemoryView":870 + * + * 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":872 + * 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":873 + * + * if (stop - start) - step * new_shape: + * new_shape += 1 # <<<<<<<<<<<<<< + * + * if new_shape < 0: + */ + __pyx_v_new_shape = (__pyx_v_new_shape + 1); + + /* "View.MemoryView":872 + * new_shape = (stop - start) // step + * + * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< + * new_shape += 1 + * + */ + } + + /* "View.MemoryView":875 + * 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":876 + * + * if new_shape < 0: + * new_shape = 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_new_shape = 0; + + /* "View.MemoryView":875 + * new_shape += 1 + * + * if new_shape < 0: # <<<<<<<<<<<<<< + * new_shape = 0 + * + */ + } + + /* "View.MemoryView":879 + * + * + * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< + * dst.shape[new_ndim] = new_shape + * dst.suboffsets[new_ndim] = suboffset + */ + (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); + + /* "View.MemoryView":880 + * + * dst.strides[new_ndim] = stride * step + * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< + * dst.suboffsets[new_ndim] = suboffset + * + */ + (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; + + /* "View.MemoryView":881 + * 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":884 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":885 + * + * if suboffset_dim[0] < 0: + * dst.data += start * stride # <<<<<<<<<<<<<< + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride + */ + __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); + + /* "View.MemoryView":884 + * + * + * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< + * dst.data += start * stride + * else: + */ + goto __pyx_L23; + } + + /* "View.MemoryView":887 + * dst.data += start * stride + * else: + * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< + * + * if suboffset >= 0: + */ + /*else*/ { + __pyx_t_3 = (__pyx_v_suboffset_dim[0]); + (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); + } + __pyx_L23:; + + /* "View.MemoryView":889 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":890 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":891 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":892 + * if not is_slice: + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + */ + __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); + + /* "View.MemoryView":891 + * if suboffset >= 0: + * if not is_slice: + * if new_ndim == 0: # <<<<<<<<<<<<<< + * dst.data = ( dst.data)[0] + suboffset + * else: + */ + goto __pyx_L26; + } + + /* "View.MemoryView":894 + * dst.data = ( dst.data)[0] + suboffset + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< + * "must be indexed and not sliced", dim) + * else: + */ + /*else*/ { + + /* "View.MemoryView":895 + * else: + * _err_dim(IndexError, "All dimensions preceding dimension %d " + * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< + * else: + * suboffset_dim[0] = new_ndim + */ + __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 894, __pyx_L1_error) + } + __pyx_L26:; + + /* "View.MemoryView":890 + * + * if suboffset >= 0: + * if not is_slice: # <<<<<<<<<<<<<< + * if new_ndim == 0: + * dst.data = ( dst.data)[0] + suboffset + */ + goto __pyx_L25; + } + + /* "View.MemoryView":897 + * "must be indexed and not sliced", dim) + * else: + * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< + * + * return 0 + */ + /*else*/ { + (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; + } + __pyx_L25:; + + /* "View.MemoryView":889 + * dst.suboffsets[suboffset_dim[0]] += start * stride + * + * if suboffset >= 0: # <<<<<<<<<<<<<< + * if not is_slice: + * if new_ndim == 0: + */ + } + + /* "View.MemoryView":899 + * suboffset_dim[0] = new_ndim + * + * return 0 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":802 + * + * @cname('__pyx_memoryview_slice_memviewslice') + * cdef int slice_memviewslice( # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":905 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + +static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { + Py_ssize_t __pyx_v_shape; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_suboffset; + Py_ssize_t __pyx_v_itemsize; + char *__pyx_v_resultp; + char *__pyx_r; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("pybuffer_index", 0); + + /* "View.MemoryView":907 + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< + * cdef Py_ssize_t itemsize = view.itemsize + * cdef char *resultp + */ + __pyx_v_suboffset = -1L; + + /* "View.MemoryView":908 + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< + * cdef char *resultp + * + */ + __pyx_t_1 = __pyx_v_view->itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":911 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":912 + * + * if view.ndim == 0: + * shape = view.len / itemsize # <<<<<<<<<<<<<< + * stride = itemsize + * else: + */ + if (unlikely(__pyx_v_itemsize == 0)) { + PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); + __PYX_ERR(1, 912, __pyx_L1_error) + } + else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { + PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); + __PYX_ERR(1, 912, __pyx_L1_error) + } + __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize); + + /* "View.MemoryView":913 + * if view.ndim == 0: + * shape = view.len / itemsize + * stride = itemsize # <<<<<<<<<<<<<< + * else: + * shape = view.shape[dim] + */ + __pyx_v_stride = __pyx_v_itemsize; + + /* "View.MemoryView":911 + * cdef char *resultp + * + * if view.ndim == 0: # <<<<<<<<<<<<<< + * shape = view.len / itemsize + * stride = itemsize + */ + goto __pyx_L3; + } + + /* "View.MemoryView":915 + * stride = itemsize + * else: + * shape = view.shape[dim] # <<<<<<<<<<<<<< + * stride = view.strides[dim] + * if view.suboffsets != NULL: + */ + /*else*/ { + __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); + + /* "View.MemoryView":916 + * else: + * shape = view.shape[dim] + * stride = view.strides[dim] # <<<<<<<<<<<<<< + * if view.suboffsets != NULL: + * suboffset = view.suboffsets[dim] + */ + __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); + + /* "View.MemoryView":917 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":918 + * 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]); + + /* "View.MemoryView":917 + * shape = view.shape[dim] + * stride = view.strides[dim] + * if view.suboffsets != NULL: # <<<<<<<<<<<<<< + * suboffset = view.suboffsets[dim] + * + */ + } + } + __pyx_L3:; + + /* "View.MemoryView":920 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":921 + * + * if index < 0: + * index += view.shape[dim] # <<<<<<<<<<<<<< + * if index < 0: + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + */ + __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); + + /* "View.MemoryView":922 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + __pyx_t_2 = ((__pyx_v_index < 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "View.MemoryView":923 + * 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(1, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 923, __pyx_L1_error) + + /* "View.MemoryView":922 + * if index < 0: + * index += view.shape[dim] + * if index < 0: # <<<<<<<<<<<<<< + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + */ + } + + /* "View.MemoryView":920 + * suboffset = view.suboffsets[dim] + * + * if index < 0: # <<<<<<<<<<<<<< + * index += view.shape[dim] + * if index < 0: + */ + } + + /* "View.MemoryView":925 + * 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":926 + * + * 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(1, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 926, __pyx_L1_error) + + /* "View.MemoryView":925 + * 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":928 + * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) + * + * resultp = bufp + index * stride # <<<<<<<<<<<<<< + * if suboffset >= 0: + * resultp = ( resultp)[0] + suboffset + */ + __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); + + /* "View.MemoryView":929 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":930 + * 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":929 + * + * resultp = bufp + index * stride + * if suboffset >= 0: # <<<<<<<<<<<<<< + * resultp = ( resultp)[0] + suboffset + * + */ + } + + /* "View.MemoryView":932 + * resultp = ( resultp)[0] + suboffset + * + * return resultp # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_resultp; + goto __pyx_L0; + + /* "View.MemoryView":905 + * + * @cname('__pyx_pybuffer_index') + * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< + * Py_ssize_t dim) except NULL: + * cdef Py_ssize_t shape, stride, suboffset = -1 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":938 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + +static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { + int __pyx_v_ndim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + int __pyx_v_i; + int __pyx_v_j; + int __pyx_r; + int __pyx_t_1; + Py_ssize_t *__pyx_t_2; + long __pyx_t_3; + long __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + + /* "View.MemoryView":939 + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: + * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< + * + * cdef Py_ssize_t *shape = memslice.shape + */ + __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; + __pyx_v_ndim = __pyx_t_1; + + /* "View.MemoryView":941 + * 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":942 + * + * 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":946 + * + * cdef int i, j + * for i in range(ndim / 2): # <<<<<<<<<<<<<< + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] + */ + __pyx_t_3 = (__pyx_v_ndim / 2); + __pyx_t_4 = __pyx_t_3; + for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":947 + * cdef int i, j + * for i in range(ndim / 2): + * j = ndim - 1 - i # <<<<<<<<<<<<<< + * strides[i], strides[j] = strides[j], strides[i] + * shape[i], shape[j] = shape[j], shape[i] + */ + __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); + + /* "View.MemoryView":948 + * for i in range(ndim / 2): + * j = ndim - 1 - i + * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< + * shape[i], shape[j] = shape[j], shape[i] + * + */ + __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); + __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); + (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; + (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; + + /* "View.MemoryView":949 + * 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]); + __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); + (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; + (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; + + /* "View.MemoryView":951 + * 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) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L6_bool_binop_done:; + if (__pyx_t_7) { + + /* "View.MemoryView":952 + * + * 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(1, 952, __pyx_L1_error) + + /* "View.MemoryView":951 + * 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":954 + * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") + * + * return 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "View.MemoryView":938 + * + * @cname('__pyx_memslice_transpose') + * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< + * cdef int ndim = memslice.memview.view.ndim + * + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = 0; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":971 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + +/* Python wrapper */ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "View.MemoryView":972 + * + * 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":971 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":974 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + +static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("convert_item_to_object", 0); + + /* "View.MemoryView":975 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":976 + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) # <<<<<<<<<<<<<< + * else: + * return memoryview.convert_item_to_object(self, itemp) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 976, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "View.MemoryView":975 + * + * cdef convert_item_to_object(self, char *itemp): + * if self.to_object_func != NULL: # <<<<<<<<<<<<<< + * return self.to_object_func(itemp) + * else: + */ + } + + /* "View.MemoryView":978 + * return self.to_object_func(itemp) + * else: + * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< + * + * cdef assign_item_from_object(self, char *itemp, object value): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "View.MemoryView":974 + * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) + * + * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< + * if self.to_object_func != NULL: + * return self.to_object_func(itemp) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":980 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + +static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("assign_item_from_object", 0); + + /* "View.MemoryView":981 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":982 + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< + * else: + * memoryview.assign_item_from_object(self, itemp, value) + */ + __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 982, __pyx_L1_error) + + /* "View.MemoryView":981 + * + * cdef assign_item_from_object(self, char *itemp, object value): + * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< + * self.to_dtype_func(itemp, value) + * else: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":984 + * self.to_dtype_func(itemp, value) + * else: + * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< + * + * @property + */ + /*else*/ { + __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_L3:; + + /* "View.MemoryView":980 + * return memoryview.convert_item_to_object(self, itemp) + * + * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< + * if self.to_dtype_func != NULL: + * self.to_dtype_func(itemp, value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":987 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "View.MemoryView":988 + * @property + * def base(self): + * return self.from_object # <<<<<<<<<<<<<< + * + * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->from_object); + __pyx_r = __pyx_v_self->from_object; + goto __pyx_L0; + + /* "View.MemoryView":987 + * + * @property + * def base(self): # <<<<<<<<<<<<<< + * return self.from_object + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + +/* Python wrapper */ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":994 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + +static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { + struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; + Py_ssize_t __pyx_v_suboffset; + PyObject *__pyx_v_length = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_TypeInfo *__pyx_t_4; + Py_buffer __pyx_t_5; + Py_ssize_t *__pyx_t_6; + Py_ssize_t *__pyx_t_7; + Py_ssize_t *__pyx_t_8; + Py_ssize_t __pyx_t_9; + __Pyx_RefNannySetupContext("memoryview_fromslice", 0); + + /* "View.MemoryView":1002 + * 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":1003 + * + * if memviewslice.memview == Py_None: + * return None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "View.MemoryView":1002 + * cdef _memoryviewslice result + * + * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< + * return None + * + */ + } + + /* "View.MemoryView":1008 + * + * + * 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(1, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1010 + * 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":1011 + * + * result.from_slice = memviewslice + * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< + * + * result.from_object = ( memviewslice.memview).base + */ + __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); + + /* "View.MemoryView":1013 + * __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(1, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_result->from_object); + __Pyx_DECREF(__pyx_v_result->from_object); + __pyx_v_result->from_object = __pyx_t_2; + __pyx_t_2 = 0; + + /* "View.MemoryView":1014 + * + * result.from_object = ( memviewslice.memview).base + * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< + * + * result.view = memviewslice.memview.view + */ + __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; + __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; + + /* "View.MemoryView":1016 + * result.typeinfo = memviewslice.memview.typeinfo + * + * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + */ + __pyx_t_5 = __pyx_v_memviewslice.memview->view; + __pyx_v_result->__pyx_base.view = __pyx_t_5; + + /* "View.MemoryView":1017 + * + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None + */ + __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); + + /* "View.MemoryView":1018 + * result.view = memviewslice.memview.view + * result.view.buf = memviewslice.data + * result.view.ndim = ndim # <<<<<<<<<<<<<< + * (<__pyx_buffer *> &result.view).obj = Py_None + * Py_INCREF(Py_None) + */ + __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; + + /* "View.MemoryView":1019 + * result.view.buf = memviewslice.data + * result.view.ndim = ndim + * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< + * Py_INCREF(Py_None) + * + */ + ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; + + /* "View.MemoryView":1020 + * 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":1022 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1023 + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: + * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< + * else: + * result.flags = PyBUF_RECORDS_RO + */ + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; + + /* "View.MemoryView":1022 + * Py_INCREF(Py_None) + * + * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< + * result.flags = PyBUF_RECORDS + * else: + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1025 + * result.flags = PyBUF_RECORDS + * else: + * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< + * + * result.view.shape = result.from_slice.shape + */ + /*else*/ { + __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; + } + __pyx_L4:; + + /* "View.MemoryView":1027 + * 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":1028 + * + * 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":1031 + * + * + * result.view.suboffsets = NULL # <<<<<<<<<<<<<< + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: + */ + __pyx_v_result->__pyx_base.view.suboffsets = NULL; + + /* "View.MemoryView":1032 + * + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + */ + __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); + for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { + __pyx_t_6 = __pyx_t_8; + __pyx_v_suboffset = (__pyx_t_6[0]); + + /* "View.MemoryView":1033 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1034 + * for suboffset in result.from_slice.suboffsets[:ndim]: + * 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); + + /* "View.MemoryView":1035 + * if suboffset >= 0: + * result.view.suboffsets = result.from_slice.suboffsets + * break # <<<<<<<<<<<<<< + * + * result.view.len = result.view.itemsize + */ + goto __pyx_L6_break; + + /* "View.MemoryView":1033 + * result.view.suboffsets = NULL + * for suboffset in result.from_slice.suboffsets[:ndim]: + * if suboffset >= 0: # <<<<<<<<<<<<<< + * result.view.suboffsets = result.from_slice.suboffsets + * break + */ + } + } + __pyx_L6_break:; + + /* "View.MemoryView":1037 + * break + * + * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< + * for length in result.view.shape[:ndim]: + * result.view.len *= length + */ + __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + + /* "View.MemoryView":1038 + * + * 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++) { + __pyx_t_6 = __pyx_t_8; + __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); + __pyx_t_2 = 0; + + /* "View.MemoryView":1039 + * 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(1, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1039, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result->__pyx_base.view.len = __pyx_t_9; + } + + /* "View.MemoryView":1041 + * 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":1042 + * + * 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":1044 + * result.to_dtype_func = to_dtype_func + * + * return result # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_result)); + __pyx_r = ((PyObject *)__pyx_v_result); + goto __pyx_L0; + + /* "View.MemoryView":994 + * + * @cname('__pyx_memoryview_fromslice') + * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< + * int ndim, + * object (*to_object_func)(char *), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_result); + __Pyx_XDECREF(__pyx_v_length); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1047 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + +static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { + struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; + __Pyx_memviewslice *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_slice_from_memview", 0); + + /* "View.MemoryView":1050 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1051 + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): + * obj = memview # <<<<<<<<<<<<<< + * return &obj.from_slice + * else: + */ + if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1051, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_v_memview); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "View.MemoryView":1052 + * if isinstance(memview, _memoryviewslice): + * obj = memview + * return &obj.from_slice # <<<<<<<<<<<<<< + * else: + * slice_copy(memview, mslice) + */ + __pyx_r = (&__pyx_v_obj->from_slice); + goto __pyx_L0; + + /* "View.MemoryView":1050 + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * obj = memview + * return &obj.from_slice + */ + } + + /* "View.MemoryView":1054 + * return &obj.from_slice + * else: + * slice_copy(memview, mslice) # <<<<<<<<<<<<<< + * return mslice + * + */ + /*else*/ { + __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); + + /* "View.MemoryView":1055 + * else: + * slice_copy(memview, mslice) + * return mslice # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_slice_copy') + */ + __pyx_r = __pyx_v_mslice; + goto __pyx_L0; + } + + /* "View.MemoryView":1047 + * + * @cname('__pyx_memoryview_get_slice_from_memoryview') + * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *mslice): + * cdef _memoryviewslice obj + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_obj); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1058 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + +static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { + int __pyx_v_dim; + Py_ssize_t *__pyx_v_shape; + Py_ssize_t *__pyx_v_strides; + Py_ssize_t *__pyx_v_suboffsets; + __Pyx_RefNannyDeclarations + Py_ssize_t *__pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("slice_copy", 0); + + /* "View.MemoryView":1062 + * cdef (Py_ssize_t*) shape, strides, suboffsets + * + * shape = memview.view.shape # <<<<<<<<<<<<<< + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets + */ + __pyx_t_1 = __pyx_v_memview->view.shape; + __pyx_v_shape = __pyx_t_1; + + /* "View.MemoryView":1063 + * + * shape = memview.view.shape + * strides = memview.view.strides # <<<<<<<<<<<<<< + * suboffsets = memview.view.suboffsets + * + */ + __pyx_t_1 = __pyx_v_memview->view.strides; + __pyx_v_strides = __pyx_t_1; + + /* "View.MemoryView":1064 + * shape = memview.view.shape + * strides = memview.view.strides + * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< + * + * dst.memview = <__pyx_memoryview *> memview + */ + __pyx_t_1 = __pyx_v_memview->view.suboffsets; + __pyx_v_suboffsets = __pyx_t_1; + + /* "View.MemoryView":1066 + * 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":1067 + * + * 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":1069 + * dst.data = memview.view.buf + * + * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< + * dst.shape[dim] = shape[dim] + * dst.strides[dim] = strides[dim] + */ + __pyx_t_2 = __pyx_v_memview->view.ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_dim = __pyx_t_4; + + /* "View.MemoryView":1070 + * + * for dim in range(memview.view.ndim): + * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< + * dst.strides[dim] = strides[dim] + * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 + */ + (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); + + /* "View.MemoryView":1071 + * for dim in range(memview.view.ndim): + * 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]); + + /* "View.MemoryView":1072 + * 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)) { + __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); + } else { + __pyx_t_5 = -1L; + } + (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; + } + + /* "View.MemoryView":1058 + * + * @cname('__pyx_memoryview_slice_copy') + * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< + * cdef int dim + * cdef (Py_ssize_t*) shape, strides, suboffsets + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1075 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + +static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { + __Pyx_memviewslice __pyx_v_memviewslice; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("memoryview_copy", 0); + + /* "View.MemoryView":1078 + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< + * return memoryview_copy_from_slice(memview, &memviewslice) + * + */ + __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); + + /* "View.MemoryView":1079 + * cdef __Pyx_memviewslice memviewslice + * slice_copy(memview, &memviewslice) + * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_object_from_slice') + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1075 + * + * @cname('__pyx_memoryview_copy_object') + * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< + * "Create a new memoryview object" + * cdef __Pyx_memviewslice memviewslice + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1082 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + +static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { + PyObject *(*__pyx_v_to_object_func)(char *); + int (*__pyx_v_to_dtype_func)(char *, PyObject *); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *(*__pyx_t_3)(char *); + int (*__pyx_t_4)(char *, PyObject *); + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); + + /* "View.MemoryView":1089 + * 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_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1090 + * + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + */ + __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; + __pyx_v_to_object_func = __pyx_t_3; + + /* "View.MemoryView":1091 + * if isinstance(memview, _memoryviewslice): + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< + * else: + * to_object_func = NULL + */ + __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; + __pyx_v_to_dtype_func = __pyx_t_4; + + /* "View.MemoryView":1089 + * cdef int (*to_dtype_func)(char *, object) except 0 + * + * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< + * to_object_func = (<_memoryviewslice> memview).to_object_func + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1093 + * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func + * else: + * to_object_func = NULL # <<<<<<<<<<<<<< + * to_dtype_func = NULL + * + */ + /*else*/ { + __pyx_v_to_object_func = NULL; + + /* "View.MemoryView":1094 + * else: + * to_object_func = NULL + * to_dtype_func = NULL # <<<<<<<<<<<<<< + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, + */ + __pyx_v_to_dtype_func = NULL; + } + __pyx_L3:; + + /* "View.MemoryView":1096 + * to_dtype_func = NULL + * + * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< + * to_object_func, to_dtype_func, + * memview.dtype_is_object) + */ + __Pyx_XDECREF(__pyx_r); + + /* "View.MemoryView":1098 + * 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(1, 1096, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "View.MemoryView":1082 + * + * @cname('__pyx_memoryview_copy_object_from_slice') + * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< + * """ + * Create a new memoryview object from a given memoryview object and slice. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "View.MemoryView":1104 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + +static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { + Py_ssize_t __pyx_r; + int __pyx_t_1; + + /* "View.MemoryView":1105 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + __pyx_t_1 = ((__pyx_v_arg < 0) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1106 + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: + * return -arg # <<<<<<<<<<<<<< + * else: + * return arg + */ + __pyx_r = (-__pyx_v_arg); + goto __pyx_L0; + + /* "View.MemoryView":1105 + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: + * if arg < 0: # <<<<<<<<<<<<<< + * return -arg + * else: + */ + } + + /* "View.MemoryView":1108 + * return -arg + * else: + * return arg # <<<<<<<<<<<<<< + * + * @cname('__pyx_get_best_slice_order') + */ + /*else*/ { + __pyx_r = __pyx_v_arg; + goto __pyx_L0; + } + + /* "View.MemoryView":1104 + * + * + * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< + * if arg < 0: + * return -arg + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1111 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + +static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_c_stride; + Py_ssize_t __pyx_v_f_stride; + char __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1116 + * """ + * cdef int i + * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< + * cdef Py_ssize_t f_stride = 0 + * + */ + __pyx_v_c_stride = 0; + + /* "View.MemoryView":1117 + * 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":1119 + * cdef Py_ssize_t f_stride = 0 + * + * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1120 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1121 + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1122 + * if mslice.shape[i] > 1: + * c_stride = mslice.strides[i] + * break # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + goto __pyx_L4_break; + + /* "View.MemoryView":1120 + * + * for i in range(ndim - 1, -1, -1): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * c_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L4_break:; + + /* "View.MemoryView":1124 + * break + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] + */ + __pyx_t_1 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_1; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1125 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1126 + * for i in range(ndim): + * if mslice.shape[i] > 1: + * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< + * break + * + */ + __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); + + /* "View.MemoryView":1127 + * 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":1125 + * + * for i in range(ndim): + * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< + * f_stride = mslice.strides[i] + * break + */ + } + } + __pyx_L7_break:; + + /* "View.MemoryView":1129 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1130 + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): + * return 'C' # <<<<<<<<<<<<<< + * else: + * return 'F' + */ + __pyx_r = 'C'; + goto __pyx_L0; + + /* "View.MemoryView":1129 + * break + * + * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< + * return 'C' + * else: + */ + } + + /* "View.MemoryView":1132 + * return 'C' + * else: + * return 'F' # <<<<<<<<<<<<<< + * + * @cython.cdivision(True) + */ + /*else*/ { + __pyx_r = 'F'; + goto __pyx_L0; + } + + /* "View.MemoryView":1111 + * + * @cname('__pyx_get_best_slice_order') + * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< + * """ + * Figure out the best memory access order for a given slice. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1135 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + +static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; + Py_ssize_t __pyx_v_dst_extent; + Py_ssize_t __pyx_v_src_stride; + Py_ssize_t __pyx_v_dst_stride; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + + /* "View.MemoryView":1142 + * + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] + */ + __pyx_v_src_extent = (__pyx_v_src_shape[0]); + + /* "View.MemoryView":1143 + * cdef Py_ssize_t i + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t src_stride = src_strides[0] + * cdef Py_ssize_t dst_stride = dst_strides[0] + */ + __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); + + /* "View.MemoryView":1144 + * cdef Py_ssize_t src_extent = src_shape[0] + * cdef Py_ssize_t dst_extent = dst_shape[0] + * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t dst_stride = dst_strides[0] + * + */ + __pyx_v_src_stride = (__pyx_v_src_strides[0]); + + /* "View.MemoryView":1145 + * 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":1147 + * 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): + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + + /* "View.MemoryView":1149 + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + */ + __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); + } + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L5_bool_binop_done:; + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + if (__pyx_t_1) { + + /* "View.MemoryView":1150 + * if (src_stride > 0 and dst_stride > 0 and + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); + + /* "View.MemoryView":1148 + * + * if ndim == 1: + * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< + * src_stride == itemsize == dst_stride): + * memcpy(dst_data, src_data, itemsize * dst_extent) + */ + goto __pyx_L4; + } + + /* "View.MemoryView":1152 + * memcpy(dst_data, src_data, itemsize * dst_extent) + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1153 + * else: + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< + * src_data += src_stride + * dst_data += dst_stride + */ + (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); + + /* "View.MemoryView":1154 + * for i in range(dst_extent): + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * else: + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1155 + * memcpy(dst_data, src_data, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * else: + * for i in range(dst_extent): + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L4:; + + /* "View.MemoryView":1147 + * 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): + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1157 + * dst_data += dst_stride + * else: + * for i in range(dst_extent): # <<<<<<<<<<<<<< + * _copy_strided_to_strided(src_data, src_strides + 1, + * dst_data, dst_strides + 1, + */ + /*else*/ { + __pyx_t_4 = __pyx_v_dst_extent; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1158 + * else: + * for i in range(dst_extent): + * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< + * dst_data, dst_strides + 1, + * src_shape + 1, dst_shape + 1, + */ + _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); + + /* "View.MemoryView":1162 + * src_shape + 1, dst_shape + 1, + * ndim - 1, itemsize) + * src_data += src_stride # <<<<<<<<<<<<<< + * dst_data += dst_stride + * + */ + __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); + + /* "View.MemoryView":1163 + * ndim - 1, itemsize) + * src_data += src_stride + * dst_data += dst_stride # <<<<<<<<<<<<<< + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, + */ + __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1135 + * + * @cython.cdivision(True) + * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< + * char *dst_data, Py_ssize_t *dst_strides, + * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, + */ + + /* function exit code */ +} + +/* "View.MemoryView":1165 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + +static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { + + /* "View.MemoryView":1168 + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< + * src.shape, dst.shape, ndim, itemsize) + * + */ + _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1165 + * dst_data += dst_stride + * + * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *dst, + * int ndim, size_t itemsize) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1172 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + +static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { + int __pyx_v_i; + Py_ssize_t __pyx_v_size; + Py_ssize_t __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1175 + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_1 = __pyx_v_src->memview->view.itemsize; + __pyx_v_size = __pyx_t_1; + + /* "View.MemoryView":1177 + * cdef Py_ssize_t size = src.memview.view.itemsize + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * size *= src.shape[i] + * + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1178 + * + * for i in range(ndim): + * size *= src.shape[i] # <<<<<<<<<<<<<< + * + * return size + */ + __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i])); + } + + /* "View.MemoryView":1180 + * size *= src.shape[i] + * + * return size # <<<<<<<<<<<<<< + * + * @cname('__pyx_fill_contig_strides_array') + */ + __pyx_r = __pyx_v_size; + goto __pyx_L0; + + /* "View.MemoryView":1172 + * + * @cname('__pyx_memoryview_slice_get_size') + * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< + * "Return the size of the memory occupied by the slice in number of bytes" + * cdef int i + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1183 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + +static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { + int __pyx_v_idx; + Py_ssize_t __pyx_r; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + + /* "View.MemoryView":1192 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + __pyx_t_1 = ((__pyx_v_order == 'F') != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1193 + * + * if order == 'F': + * for idx in range(ndim): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + __pyx_t_2 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_idx = __pyx_t_4; + + /* "View.MemoryView":1194 + * if order == 'F': + * for idx in range(ndim): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * else: + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1195 + * for idx in range(ndim): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * else: + * for idx in range(ndim - 1, -1, -1): + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + + /* "View.MemoryView":1192 + * cdef int idx + * + * if order == 'F': # <<<<<<<<<<<<<< + * for idx in range(ndim): + * strides[idx] = stride + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1197 + * stride = stride * shape[idx] + * else: + * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< + * strides[idx] = stride + * stride = stride * shape[idx] + */ + /*else*/ { + for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { + __pyx_v_idx = __pyx_t_2; + + /* "View.MemoryView":1198 + * else: + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride # <<<<<<<<<<<<<< + * stride = stride * shape[idx] + * + */ + (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; + + /* "View.MemoryView":1199 + * for idx in range(ndim - 1, -1, -1): + * strides[idx] = stride + * stride = stride * shape[idx] # <<<<<<<<<<<<<< + * + * return stride + */ + __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); + } + } + __pyx_L3:; + + /* "View.MemoryView":1201 + * stride = stride * shape[idx] + * + * return stride # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_data_to_temp') + */ + __pyx_r = __pyx_v_stride; + goto __pyx_L0; + + /* "View.MemoryView":1183 + * + * @cname('__pyx_fill_contig_strides_array') + * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< + * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, + * int ndim, char order) nogil: + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1204 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + +static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { + int __pyx_v_i; + void *__pyx_v_result; + size_t __pyx_v_itemsize; + size_t __pyx_v_size; + void *__pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + struct __pyx_memoryview_obj *__pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + + /* "View.MemoryView":1215 + * 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":1216 + * + * 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":1218 + * cdef size_t size = slice_get_size(src, ndim) + * + * result = malloc(size) # <<<<<<<<<<<<<< + * if not result: + * _err(MemoryError, NULL) + */ + __pyx_v_result = malloc(__pyx_v_size); + + /* "View.MemoryView":1219 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1220 + * 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(1, 1220, __pyx_L1_error) + + /* "View.MemoryView":1219 + * + * result = malloc(size) + * if not result: # <<<<<<<<<<<<<< + * _err(MemoryError, NULL) + * + */ + } + + /* "View.MemoryView":1223 + * + * + * tmpslice.data = result # <<<<<<<<<<<<<< + * tmpslice.memview = src.memview + * for i in range(ndim): + */ + __pyx_v_tmpslice->data = ((char *)__pyx_v_result); + + /* "View.MemoryView":1224 + * + * tmpslice.data = result + * tmpslice.memview = src.memview # <<<<<<<<<<<<<< + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] + */ + __pyx_t_4 = __pyx_v_src->memview; + __pyx_v_tmpslice->memview = __pyx_t_4; + + /* "View.MemoryView":1225 + * tmpslice.data = result + * tmpslice.memview = src.memview + * for i in range(ndim): # <<<<<<<<<<<<<< + * tmpslice.shape[i] = src.shape[i] + * tmpslice.suboffsets[i] = -1 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1226 + * tmpslice.memview = src.memview + * for i in range(ndim): + * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< + * tmpslice.suboffsets[i] = -1 + * + */ + (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); + + /* "View.MemoryView":1227 + * 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; + } + + /* "View.MemoryView":1229 + * 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":1233 + * + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if tmpslice.shape[i] == 1: + * tmpslice.strides[i] = 0 + */ + __pyx_t_3 = __pyx_v_ndim; + __pyx_t_5 = __pyx_t_3; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "View.MemoryView":1234 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1235 + * 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":1234 + * + * for i in range(ndim): + * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< + * tmpslice.strides[i] = 0 + * + */ + } + } + + /* "View.MemoryView":1237 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1238 + * + * if slice_is_contig(src[0], order, ndim): + * memcpy(result, src.data, size) # <<<<<<<<<<<<<< + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + */ + (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); + + /* "View.MemoryView":1237 + * tmpslice.strides[i] = 0 + * + * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< + * memcpy(result, src.data, size) + * else: + */ + goto __pyx_L9; + } + + /* "View.MemoryView":1240 + * memcpy(result, src.data, size) + * else: + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< + * + * return result + */ + /*else*/ { + copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); + } + __pyx_L9:; + + /* "View.MemoryView":1242 + * copy_strided_to_strided(src, tmpslice, ndim, itemsize) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "View.MemoryView":1204 + * + * @cname('__pyx_memoryview_copy_data_to_temp') + * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice *tmpslice, + * char order, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = NULL; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1247 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + +static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_extents", 0); + + /* "View.MemoryView":1250 + * 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(1, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "View.MemoryView":1249 + * cdef int _err_extents(int i, Py_ssize_t extent1, + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< + * (i, extent1, extent2)) + * + */ + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 1249, __pyx_L1_error) + + /* "View.MemoryView":1247 + * + * @cname('__pyx_memoryview_err_extents') + * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< + * Py_ssize_t extent2) except -1 with gil: + * raise ValueError("got differing extents in dimension %d (got %d and %d)" % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1253 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + +static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err_dim", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1254 + * @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(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_error); + __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + if (!__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 1254, __pyx_L1_error) + + /* "View.MemoryView":1253 + * + * @cname('__pyx_memoryview_err_dim') + * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii') % dim) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + +static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_err", 0); + __Pyx_INCREF(__pyx_v_error); + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); + if (unlikely(__pyx_t_1)) { + + /* "View.MemoryView":1259 + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: + * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< + * else: + * raise error + */ + __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_error); + __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + if (!__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 1259, __pyx_L1_error) + + /* "View.MemoryView":1258 + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: + * if msg != NULL: # <<<<<<<<<<<<<< + * raise error(msg.decode('ascii')) + * else: + */ + } + + /* "View.MemoryView":1261 + * raise error(msg.decode('ascii')) + * else: + * raise error # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_copy_contents') + */ + /*else*/ { + __Pyx_Raise(__pyx_v_error, 0, 0, 0); + __PYX_ERR(1, 1261, __pyx_L1_error) + } + + /* "View.MemoryView":1257 + * + * @cname('__pyx_memoryview_err') + * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< + * if msg != NULL: + * raise error(msg.decode('ascii')) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __Pyx_XDECREF(__pyx_v_error); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + return __pyx_r; +} + +/* "View.MemoryView":1264 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + +static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { + void *__pyx_v_tmpdata; + size_t __pyx_v_itemsize; + int __pyx_v_i; + char __pyx_v_order; + int __pyx_v_broadcasting; + int __pyx_v_direct_copy; + __Pyx_memviewslice __pyx_v_tmp; + int __pyx_v_ndim; + int __pyx_r; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + void *__pyx_t_7; + int __pyx_t_8; + + /* "View.MemoryView":1272 + * Check for overlapping memory and verify the shapes. + * """ + * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + */ + __pyx_v_tmpdata = NULL; + + /* "View.MemoryView":1273 + * """ + * cdef void *tmpdata = NULL + * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + */ + __pyx_t_1 = __pyx_v_src.memview->view.itemsize; + __pyx_v_itemsize = __pyx_t_1; + + /* "View.MemoryView":1275 + * cdef size_t itemsize = src.memview.view.itemsize + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< + * cdef bint broadcasting = False + * cdef bint direct_copy = False + */ + __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); + + /* "View.MemoryView":1276 + * cdef int i + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False # <<<<<<<<<<<<<< + * cdef bint direct_copy = False + * cdef __Pyx_memviewslice tmp + */ + __pyx_v_broadcasting = 0; + + /* "View.MemoryView":1277 + * cdef char order = get_best_order(&src, src_ndim) + * cdef bint broadcasting = False + * cdef bint direct_copy = False # <<<<<<<<<<<<<< + * cdef __Pyx_memviewslice tmp + * + */ + __pyx_v_direct_copy = 0; + + /* "View.MemoryView":1280 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1281 + * + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * elif dst_ndim < src_ndim: + * broadcast_leading(&dst, dst_ndim, src_ndim) + */ + __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); + + /* "View.MemoryView":1280 + * cdef __Pyx_memviewslice tmp + * + * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1282 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1283 + * 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); + + /* "View.MemoryView":1282 + * if src_ndim < dst_ndim: + * broadcast_leading(&src, src_ndim, dst_ndim) + * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + */ + } + __pyx_L3:; + + /* "View.MemoryView":1285 + * broadcast_leading(&dst, dst_ndim, src_ndim) + * + * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< + * + * for i in range(ndim): + */ + __pyx_t_3 = __pyx_v_dst_ndim; + __pyx_t_4 = __pyx_v_src_ndim; + if (((__pyx_t_3 > __pyx_t_4) != 0)) { + __pyx_t_5 = __pyx_t_3; + } else { + __pyx_t_5 = __pyx_t_4; + } + __pyx_v_ndim = __pyx_t_5; + + /* "View.MemoryView":1287 + * cdef int ndim = max(src_ndim, dst_ndim) + * + * for i in range(ndim): # <<<<<<<<<<<<<< + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + */ + __pyx_t_5 = __pyx_v_ndim; + __pyx_t_3 = __pyx_t_5; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1288 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1289 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1290 + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: + * broadcasting = True # <<<<<<<<<<<<<< + * src.strides[i] = 0 + * else: + */ + __pyx_v_broadcasting = 1; + + /* "View.MemoryView":1291 + * if src.shape[i] == 1: + * broadcasting = True + * src.strides[i] = 0 # <<<<<<<<<<<<<< + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) + */ + (__pyx_v_src.strides[__pyx_v_i]) = 0; + + /* "View.MemoryView":1289 + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: + * if src.shape[i] == 1: # <<<<<<<<<<<<<< + * broadcasting = True + * src.strides[i] = 0 + */ + goto __pyx_L7; + } + + /* "View.MemoryView":1293 + * src.strides[i] = 0 + * else: + * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< + * + * if src.suboffsets[i] >= 0: + */ + /*else*/ { + __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1293, __pyx_L1_error) + } + __pyx_L7:; + + /* "View.MemoryView":1288 + * + * for i in range(ndim): + * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< + * if src.shape[i] == 1: + * broadcasting = True + */ + } + + /* "View.MemoryView":1295 + * _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":1296 + * + * 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(1, 1296, __pyx_L1_error) + + /* "View.MemoryView":1295 + * _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":1298 + * _err_dim(ValueError, "Dimension %d is not direct", i) + * + * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< + * + * if not slice_is_contig(src, order, ndim): + */ + __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1300 + * 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":1301 + * + * 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":1300 + * if slices_overlap(&src, &dst, ndim, itemsize): + * + * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< + * order = get_best_order(&dst, ndim) + * + */ + } + + /* "View.MemoryView":1303 + * 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(1, 1303, __pyx_L1_error) + __pyx_v_tmpdata = __pyx_t_7; + + /* "View.MemoryView":1304 + * + * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) + * src = tmp # <<<<<<<<<<<<<< + * + * if not broadcasting: + */ + __pyx_v_src = __pyx_v_tmp; + + /* "View.MemoryView":1298 + * _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":1306 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1309 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1310 + * + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< + * elif slice_is_contig(src, 'F', ndim): + * direct_copy = slice_is_contig(dst, 'F', ndim) + */ + __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); + + /* "View.MemoryView":1309 + * + * + * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): + */ + goto __pyx_L12; + } + + /* "View.MemoryView":1311 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1312 + * 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); + + /* "View.MemoryView":1311 + * if slice_is_contig(src, 'C', ndim): + * direct_copy = slice_is_contig(dst, 'C', ndim) + * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + */ + } + __pyx_L12:; + + /* "View.MemoryView":1314 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + __pyx_t_2 = (__pyx_v_direct_copy != 0); + if (__pyx_t_2) { + + /* "View.MemoryView":1316 + * if direct_copy: + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1317 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + */ + (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); + + /* "View.MemoryView":1318 + * refcount_copying(&dst, dtype_is_object, ndim, False) + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< + * free(tmpdata) + * return 0 + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); + + /* "View.MemoryView":1319 + * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1320 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * if order == 'F' == get_best_order(&dst, ndim): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1314 + * direct_copy = slice_is_contig(dst, 'F', ndim) + * + * if direct_copy: # <<<<<<<<<<<<<< + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + */ + } + + /* "View.MemoryView":1306 + * src = tmp + * + * if not broadcasting: # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1322 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = (__pyx_v_order == 'F'); + if (__pyx_t_2) { + __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); + } + __pyx_t_8 = (__pyx_t_2 != 0); + if (__pyx_t_8) { + + /* "View.MemoryView":1325 + * + * + * transpose_memslice(&src) # <<<<<<<<<<<<<< + * transpose_memslice(&dst) + * + */ + __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1325, __pyx_L1_error) + + /* "View.MemoryView":1326 + * + * 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(1, 1326, __pyx_L1_error) + + /* "View.MemoryView":1322 + * return 0 + * + * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< + * + * + */ + } + + /* "View.MemoryView":1328 + * transpose_memslice(&dst) + * + * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * copy_strided_to_strided(&src, &dst, ndim, itemsize) + * refcount_copying(&dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1329 + * + * refcount_copying(&dst, dtype_is_object, ndim, False) + * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + */ + copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); + + /* "View.MemoryView":1330 + * 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":1332 + * refcount_copying(&dst, dtype_is_object, ndim, True) + * + * free(tmpdata) # <<<<<<<<<<<<<< + * return 0 + * + */ + free(__pyx_v_tmpdata); + + /* "View.MemoryView":1333 + * + * free(tmpdata) + * return 0 # <<<<<<<<<<<<<< + * + * @cname('__pyx_memoryview_broadcast_leading') + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "View.MemoryView":1264 + * + * @cname('__pyx_memoryview_copy_contents') + * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< + * __Pyx_memviewslice dst, + * int src_ndim, int dst_ndim, + */ + + /* function exit code */ + __pyx_L1_error:; + { + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif + } + __pyx_r = -1; + __pyx_L0:; + return __pyx_r; +} + +/* "View.MemoryView":1336 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + +static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { + int __pyx_v_i; + int __pyx_v_offset; + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + + /* "View.MemoryView":1340 + * 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":1342 + * 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] + */ + for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { + __pyx_v_i = __pyx_t_1; + + /* "View.MemoryView":1343 + * + * for i in range(ndim - 1, -1, -1): + * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< + * mslice.strides[i + offset] = mslice.strides[i] + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + */ + (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); + + /* "View.MemoryView":1344 + * for i in range(ndim - 1, -1, -1): + * 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]); + + /* "View.MemoryView":1345 + * 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]); + } + + /* "View.MemoryView":1347 + * mslice.suboffsets[i + offset] = mslice.suboffsets[i] + * + * for i in range(offset): # <<<<<<<<<<<<<< + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + */ + __pyx_t_1 = __pyx_v_offset; + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1348 + * + * for i in range(offset): + * mslice.shape[i] = 1 # <<<<<<<<<<<<<< + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 + */ + (__pyx_v_mslice->shape[__pyx_v_i]) = 1; + + /* "View.MemoryView":1349 + * for i in range(offset): + * 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]); + + /* "View.MemoryView":1350 + * mslice.shape[i] = 1 + * mslice.strides[i] = mslice.strides[0] + * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; + } + + /* "View.MemoryView":1336 + * + * @cname('__pyx_memoryview_broadcast_leading') + * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< + * int ndim, + * int ndim_other) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1358 + * + * @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":1362 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + __pyx_t_1 = (__pyx_v_dtype_is_object != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1363 + * + * 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":1362 + * + * + * if dtype_is_object: # <<<<<<<<<<<<<< + * refcount_objects_in_slice_with_gil(dst.data, dst.shape, + * dst.strides, ndim, inc) + */ + } + + /* "View.MemoryView":1358 + * + * @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":1367 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + +static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + __Pyx_RefNannyDeclarations + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); + + /* "View.MemoryView":1370 + * 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":1367 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') + * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * bint inc) with gil: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + +/* "View.MemoryView":1373 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + +static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + __Pyx_RefNannyDeclarations + Py_ssize_t __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); + + /* "View.MemoryView":1377 + * cdef Py_ssize_t i + * + * for i in range(shape[0]): # <<<<<<<<<<<<<< + * if ndim == 1: + * if inc: + */ + __pyx_t_1 = (__pyx_v_shape[0]); + __pyx_t_2 = __pyx_t_1; + for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { + __pyx_v_i = __pyx_t_3; + + /* "View.MemoryView":1378 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1379 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + __pyx_t_4 = (__pyx_v_inc != 0); + if (__pyx_t_4) { + + /* "View.MemoryView":1380 + * if ndim == 1: + * if inc: + * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * Py_DECREF(( data)[0]) + */ + Py_INCREF((((PyObject **)__pyx_v_data)[0])); + + /* "View.MemoryView":1379 + * for i in range(shape[0]): + * if ndim == 1: + * if inc: # <<<<<<<<<<<<<< + * Py_INCREF(( data)[0]) + * else: + */ + goto __pyx_L6; + } + + /* "View.MemoryView":1382 + * Py_INCREF(( data)[0]) + * else: + * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + */ + /*else*/ { + Py_DECREF((((PyObject **)__pyx_v_data)[0])); + } + __pyx_L6:; + + /* "View.MemoryView":1378 + * + * for i in range(shape[0]): + * if ndim == 1: # <<<<<<<<<<<<<< + * if inc: + * Py_INCREF(( data)[0]) + */ + goto __pyx_L5; + } + + /* "View.MemoryView":1384 + * Py_DECREF(( data)[0]) + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, inc) + * + */ + /*else*/ { + + /* "View.MemoryView":1385 + * else: + * refcount_objects_in_slice(data, shape + 1, strides + 1, + * ndim - 1, inc) # <<<<<<<<<<<<<< + * + * data += strides[0] + */ + __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); + } + __pyx_L5:; + + /* "View.MemoryView":1387 + * ndim - 1, inc) + * + * data += strides[0] # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); + } + + /* "View.MemoryView":1373 + * + * @cname('__pyx_memoryview_refcount_objects_in_slice') + * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, bint inc): + * cdef Py_ssize_t i + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "View.MemoryView":1393 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + +static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { + + /* "View.MemoryView":1396 + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, + * itemsize, item) + */ + __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); + + /* "View.MemoryView":1397 + * bint dtype_is_object) nogil: + * refcount_copying(dst, dtype_is_object, ndim, False) + * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< + * itemsize, item) + * refcount_copying(dst, dtype_is_object, ndim, True) + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1399 + * _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":1393 + * + * @cname('__pyx_memoryview_slice_assign_scalar') + * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< + * size_t itemsize, void *item, + * bint dtype_is_object) nogil: + */ + + /* function exit code */ +} + +/* "View.MemoryView":1403 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + +static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { + CYTHON_UNUSED Py_ssize_t __pyx_v_i; + Py_ssize_t __pyx_v_stride; + Py_ssize_t __pyx_v_extent; + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + Py_ssize_t __pyx_t_4; + + /* "View.MemoryView":1407 + * size_t itemsize, void *item) nogil: + * cdef Py_ssize_t i + * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< + * cdef Py_ssize_t extent = shape[0] + * + */ + __pyx_v_stride = (__pyx_v_strides[0]); + + /* "View.MemoryView":1408 + * 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":1410 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); + if (__pyx_t_1) { + + /* "View.MemoryView":1411 + * + * if ndim == 1: + * for i in range(extent): # <<<<<<<<<<<<<< + * memcpy(data, item, itemsize) + * data += stride + */ + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1412 + * if ndim == 1: + * for i in range(extent): + * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< + * data += stride + * else: + */ + (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); + + /* "View.MemoryView":1413 + * for i in range(extent): + * memcpy(data, item, itemsize) + * data += stride # <<<<<<<<<<<<<< + * else: + * for i in range(extent): + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + + /* "View.MemoryView":1410 + * cdef Py_ssize_t extent = shape[0] + * + * if ndim == 1: # <<<<<<<<<<<<<< + * for i in range(extent): + * memcpy(data, item, itemsize) + */ + goto __pyx_L3; + } + + /* "View.MemoryView":1415 + * data += stride + * else: + * for i in range(extent): # <<<<<<<<<<<<<< + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + */ + /*else*/ { + __pyx_t_2 = __pyx_v_extent; + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "View.MemoryView":1416 + * else: + * for i in range(extent): + * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< + * ndim - 1, itemsize, item) + * data += stride + */ + __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); + + /* "View.MemoryView":1418 + * _slice_assign_scalar(data, shape + 1, strides + 1, + * ndim - 1, itemsize, item) + * data += stride # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_data = (__pyx_v_data + __pyx_v_stride); + } + } + __pyx_L3:; + + /* "View.MemoryView":1403 + * + * @cname('__pyx_memoryview__slice_assign_scalar') + * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< + * Py_ssize_t *strides, int ndim, + * size_t itemsize, void *item) nogil: + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v___pyx_type = 0; + long __pyx_v___pyx_checksum; + PyObject *__pyx_v___pyx_state = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v___pyx_type = values[0]; + __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_v___pyx_state = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_v___pyx_PickleError = NULL; + PyObject *__pyx_v___pyx_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); + + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); + if (__pyx_t_1) { + + /* "(tree fragment)":3 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PickleError); + __Pyx_GIVEREF(__pyx_n_s_PickleError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_v___pyx_PickleError = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":4 + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + */ + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v___pyx_PickleError); + __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_5) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 4, __pyx_L1_error) + + /* "(tree fragment)":2 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): + * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + */ + } + + /* "(tree fragment)":5 + * from pickle import PickleError as __pyx_PickleError + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (!__pyx_t_6) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + __Pyx_INCREF(__pyx_v___pyx_type); + __Pyx_GIVEREF(__pyx_v___pyx_type); + PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v___pyx_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + __pyx_t_1 = (__pyx_v___pyx_state != Py_None); + __pyx_t_7 = (__pyx_t_1 != 0); + if (__pyx_t_7) { + + /* "(tree fragment)":7 + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + */ + if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error) + __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "(tree fragment)":6 + * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) + * __pyx_result = Enum.__new__(__pyx_type) + * if __pyx_state is not None: # <<<<<<<<<<<<<< + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + */ + } + + /* "(tree fragment)":8 + * if __pyx_state is not None: + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result # <<<<<<<<<<<<<< + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v___pyx_result); + __pyx_r = __pyx_v___pyx_result; + goto __pyx_L0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v___pyx_PickleError); + __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + +static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); + + /* "(tree fragment)":10 + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 10, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v___pyx_result->name); + __Pyx_DECREF(__pyx_v___pyx_result->name); + __pyx_v___pyx_result->name = __pyx_t_1; + __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(1, 11, __pyx_L1_error) + } + __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_4 = ((__pyx_t_3 > 1) != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_5 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_5; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "(tree fragment)":12 + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(__pyx_v___pyx_state == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(1, 12, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + if (!__pyx_t_8) { + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else { + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":11 + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< + * __pyx_result.__dict__.update(__pyx_state[1]) + */ + } + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_PBCBox __pyx_vtable_10MDAnalysis_3lib_6nsgrid_PBCBox; + +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_PBCBox(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)o); + p->__pyx_vtab = __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_PBCBox; + return o; +} + +static void __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_PBCBox(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_10MDAnalysis_3lib_6nsgrid_PBCBox[] = { + {"update", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_3update, METH_O, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox_2update}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_5__reduce_cython__, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox_4__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_7__setstate_cython__, METH_O, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox_6__setstate_cython__}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid.PBCBox", /*tp_name*/ + sizeof(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_PBCBox, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "PBCBox(__Pyx_memviewslice box, bool periodic)\n\n Cython implementation of\n `PBC-related `_\n operations. This class is used by classes :class:`FastNS`\n and :class:`NSGrid` to put all particles inside a brick-shaped box\n and to compute PBC-aware distance. The class can also handle\n non-PBC aware distance evaluations through ``periodic`` argument.\n\n .. warning::\n This class is not meant to be used by end users.\n\n .. warning::\n Even if MD triclinic boxes can be handled by this class,\n internal optimization is made based on the assumption that\n particles are inside a brick-shaped box. When this is not\n the case, calculated distances are not\n warranted to be exact.\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_10MDAnalysis_3lib_6nsgrid_PBCBox, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_10MDAnalysis_3lib_6nsgrid_6PBCBox_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10MDAnalysis_3lib_6nsgrid_PBCBox, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSResults __pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSResults; + +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_NSResults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)o); + p->__pyx_vtab = __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSResults; + new((void*)&(p->indices_buffer)) std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_intvec> (); + new((void*)&(p->distances_buffer)) std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_realvec> (); + new((void*)&(p->pairs_buffer)) std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int> (); + new((void*)&(p->pair_distances_buffer)) std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> (); + new((void*)&(p->pair_distances2_buffer)) std::vector<__pyx_t_10MDAnalysis_3lib_6nsgrid_real> (); + p->coords.data = NULL; + p->coords.memview = NULL; + p->searchcoords.data = NULL; + p->searchcoords.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_NSResults(PyObject *o) { + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *p = (struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + __Pyx_call_destructor(p->indices_buffer); + __Pyx_call_destructor(p->distances_buffer); + __Pyx_call_destructor(p->pairs_buffer); + __Pyx_call_destructor(p->pair_distances_buffer); + __Pyx_call_destructor(p->pair_distances2_buffer); + __PYX_XDEC_MEMVIEW(&p->coords, 1); + __PYX_XDEC_MEMVIEW(&p->searchcoords, 1); + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_10MDAnalysis_3lib_6nsgrid_9NSResults_cutoff(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_6cutoff_1__get__(o); +} + +static PyMethodDef __pyx_methods_10MDAnalysis_3lib_6nsgrid_NSResults[] = { + {"get_pairs", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_3get_pairs, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_2get_pairs}, + {"get_pair_distances", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_5get_pair_distances, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_4get_pair_distances}, + {"get_indices", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_7get_indices, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_6get_indices}, + {"get_distances", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_9get_distances, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_8get_distances}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_11__reduce_cython__, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_10__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_13__setstate_cython__, METH_O, __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults_12__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_10MDAnalysis_3lib_6nsgrid_NSResults[] = { + {(char *)"cutoff", __pyx_getprop_10MDAnalysis_3lib_6nsgrid_9NSResults_cutoff, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid.NSResults", /*tp_name*/ + sizeof(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_NSResults, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "NSResults(real cutoff, __Pyx_memviewslice coords, __Pyx_memviewslice searchcoords)\nClass to store the results\n\n All the required outputs from :class:`FastNS` is stored in the\n instance of this class. All the methods of :class:`FastNS` returns\n an instance of this class, which can be used to generate the desired\n results on demand.\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_10MDAnalysis_3lib_6nsgrid_NSResults, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_10MDAnalysis_3lib_6nsgrid_NSResults, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_10MDAnalysis_3lib_6nsgrid_9NSResults_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10MDAnalysis_3lib_6nsgrid_NSResults, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_10MDAnalysis_3lib_6nsgrid_NSGrid __pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSGrid; + +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_NSGrid(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)o); + p->__pyx_vtab = __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSGrid; + return o; +} + +static void __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_NSGrid(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_10MDAnalysis_3lib_6nsgrid_6NSGrid_cutoff(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_6cutoff_1__get__(o); +} + +static PyMethodDef __pyx_methods_10MDAnalysis_3lib_6nsgrid_NSGrid[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_5__reduce_cython__, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6NSGrid_4__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_7__setstate_cython__, METH_O, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6NSGrid_6__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_10MDAnalysis_3lib_6nsgrid_NSGrid[] = { + {(char *)"cutoff", __pyx_getprop_10MDAnalysis_3lib_6nsgrid_6NSGrid_cutoff, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid.NSGrid", /*tp_name*/ + sizeof(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_NSGrid, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "NSGrid(ncoords, cutoff, PBCBox box, max_size, force=False)\nConstructs a uniform cuboidal grid for a brick-shaped box\n\n This class uses :class:`PBCBox` to define the brick shaped box\n It is essential to initialize the box with :class:`PBCBox`\n inorder to form the grid.\n\n The domain is subdivided into number of cells based on the desired search\n radius. Ideally cellsize should be equal to the search radius, but small\n search radius leads to large cell-list data strucutres.\n An optimization of cutoff is imposed to limit the size of data\n structure such that the cellsize is always greater than or\n equal to cutoff distance.\n\n Note\n ----\n This class assumes that all the coordinates are already\n inside the brick shaped box. Care must be taken to ensure\n all the particles are within the brick shaped box as\n defined by :class:`PBCBox`. This can be ensured by using\n :func:`~MDAnalysis.lib.nsgrid.PBCBox.fast_put_atoms_in_bbox`\n\n .. warning::\n This class is not meant to be used by end users.\n\n ", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_10MDAnalysis_3lib_6nsgrid_NSGrid, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_10MDAnalysis_3lib_6nsgrid_NSGrid, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_10MDAnalysis_3lib_6nsgrid_6NSGrid_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10MDAnalysis_3lib_6nsgrid_NSGrid, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_10MDAnalysis_3lib_6nsgrid_FastNS(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)o); + p->box = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)Py_None); Py_INCREF(Py_None); + p->grid = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)Py_None); Py_INCREF(Py_None); + p->coords.data = NULL; + p->coords.memview = NULL; + p->coords_bbox.data = NULL; + p->coords_bbox.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_FastNS(PyObject *o) { + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *p = (struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->box); + Py_CLEAR(p->grid); + __PYX_XDEC_MEMVIEW(&p->coords, 1); + __PYX_XDEC_MEMVIEW(&p->coords_bbox, 1); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_10MDAnalysis_3lib_6nsgrid_FastNS(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *p = (struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)o; + if (p->box) { + e = (*v)(((PyObject *)p->box), a); if (e) return e; + } + if (p->grid) { + e = (*v)(((PyObject *)p->grid), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10MDAnalysis_3lib_6nsgrid_FastNS(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *p = (struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS *)o; + tmp = ((PyObject*)p->box); + p->box = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->grid); + p->grid = ((struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_10MDAnalysis_3lib_6nsgrid_6FastNS_cutoff(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_6cutoff_1__get__(o); +} + +static PyMethodDef __pyx_methods_10MDAnalysis_3lib_6nsgrid_FastNS[] = { + {"search", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_3search, METH_O, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_2search}, + {"self_search", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_5self_search, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_4self_search}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_7__reduce_cython__, METH_NOARGS, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_6__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_9__setstate_cython__, METH_O, __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS_8__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_10MDAnalysis_3lib_6nsgrid_FastNS[] = { + {(char *)"cutoff", __pyx_getprop_10MDAnalysis_3lib_6nsgrid_6FastNS_cutoff, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid.FastNS", /*tp_name*/ + sizeof(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_FastNS), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10MDAnalysis_3lib_6nsgrid_FastNS, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "FastNS(cutoff, coords, box, max_gridsize=5000, pbc=True)\nGrid based search between two group of atoms\n\n Instantiates a class object which uses :class:`PBCBox` and\n :class:`NSGrid` to construct a cuboidal\n grid in an orthogonal brick shaped box.\n\n Minimum image convention is used for distance evaluations\n if pbc is set to ``True``.\n ", /*tp_doc*/ + __pyx_tp_traverse_10MDAnalysis_3lib_6nsgrid_FastNS, /*tp_traverse*/ + __pyx_tp_clear_10MDAnalysis_3lib_6nsgrid_FastNS, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_10MDAnalysis_3lib_6nsgrid_FastNS, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_10MDAnalysis_3lib_6nsgrid_FastNS, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_10MDAnalysis_3lib_6nsgrid_6FastNS_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10MDAnalysis_3lib_6nsgrid_FastNS, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_array __pyx_vtable_array; + +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_array_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_array; + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_array___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); + (*Py_TYPE(o)->tp_free)(o); +} +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_array___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); +} + +static PyMethodDef __pyx_methods_array[] = { + {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_array = { + __pyx_array___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_array, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_array = { + __pyx_array___len__, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_array = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_array_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_array = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid.array", /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_array, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_array, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_Enum[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_MemviewEnum = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid.Enum", /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_MemviewEnum___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_Enum, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_Enum, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; + +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_memoryview(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); + return 0; +} +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, + {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, + {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, + {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + 0, /*bf_releasebuffer*/ +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid.memoryview", /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_memoryview___str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_memoryview, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_memoryview, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_memoryview, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; + +static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryviewslice_obj *p; + PyObject *o = __pyx_tp_new_memoryview(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_memoryviewslice_obj *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; + p->from_object = Py_None; Py_INCREF(Py_None); + p->from_slice.memview = NULL; + return o; +} + +static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryviewslice___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->from_object); + PyObject_GC_Track(o); + __pyx_tp_dealloc_memoryview(o); +} + +static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; + if (p->from_object) { + e = (*v)(p->from_object, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear__memoryviewslice(PyObject *o) { + PyObject* tmp; + struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; + __pyx_tp_clear_memoryview(o); + tmp = ((PyObject*)p->from_object); + p->from_object = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + __PYX_XDEC_MEMVIEW(&p->from_slice, 1); + return 0; +} + +static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); +} + +static PyMethodDef __pyx_methods__memoryviewslice[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { + {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type___pyx_memoryviewslice = { + PyVarObject_HEAD_INIT(0, 0) + "MDAnalysis.lib.nsgrid._memoryviewslice", /*tp_name*/ + sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_memoryview___str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Internal class for passing memoryview slices to Python", /*tp_doc*/ + __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ + __pyx_tp_clear__memoryviewslice, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods__memoryviewslice, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets__memoryviewslice, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new__memoryviewslice, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_nsgrid(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_nsgrid}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "nsgrid", + __pyx_k_Neighbor_search_library_mod_MDA, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, + {&__pyx_kp_s_Any_of_the_box_dimensions_cannot, __pyx_k_Any_of_the_box_dimensions_cannot, sizeof(__pyx_k_Any_of_the_box_dimensions_cannot), 0, 0, 1, 0}, + {&__pyx_kp_s_Box_does_not_correspond_to_PBC_x, __pyx_k_Box_does_not_correspond_to_PBC_x, sizeof(__pyx_k_Box_does_not_correspond_to_PBC_x), 0, 0, 1, 0}, + {&__pyx_kp_s_Box_must_be_a_x_matrix_Got_x, __pyx_k_Box_must_be_a_x_matrix_Got_x, sizeof(__pyx_k_Box_must_be_a_x_matrix_Got_x), 0, 0, 1, 0}, + {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, + {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Could_not_allocate_memory_for_NS, __pyx_k_Could_not_allocate_memory_for_NS, sizeof(__pyx_k_Could_not_allocate_memory_for_NS), 0, 0, 1, 0}, + {&__pyx_kp_s_Could_not_allocate_memory_from_N, __pyx_k_Could_not_allocate_memory_from_N, sizeof(__pyx_k_Could_not_allocate_memory_from_N), 0, 0, 1, 0}, + {&__pyx_kp_s_Could_not_allocate_memory_from_N_2, __pyx_k_Could_not_allocate_memory_from_N_2, sizeof(__pyx_k_Could_not_allocate_memory_from_N_2), 0, 0, 1, 0}, + {&__pyx_kp_s_Cutoff_greater_than_maximum_cuto, __pyx_k_Cutoff_greater_than_maximum_cuto, sizeof(__pyx_k_Cutoff_greater_than_maximum_cuto), 0, 0, 1, 0}, + {&__pyx_kp_s_Cutoff_must_be_positive, __pyx_k_Cutoff_must_be_positive, sizeof(__pyx_k_Cutoff_must_be_positive), 0, 0, 1, 0}, + {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, + {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, + {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0x29, __pyx_k_Incompatible_checksums_s_vs_0x29, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x29), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, + {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd3, __pyx_k_Incompatible_checksums_s_vs_0xd3, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd3), 0, 0, 1, 0}, + {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, + {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, + {&__pyx_n_s_MDAnalysis_lib_mdamath, __pyx_k_MDAnalysis_lib_mdamath, sizeof(__pyx_k_MDAnalysis_lib_mdamath), 0, 0, 1, 1}, + {&__pyx_n_s_MDAnalysis_lib_nsgrid, __pyx_k_MDAnalysis_lib_nsgrid, sizeof(__pyx_k_MDAnalysis_lib_nsgrid), 0, 0, 1, 1}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, + {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, + {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, + {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, + {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, + {&__pyx_kp_s_Pickling_of_struct_members_such, __pyx_k_Pickling_of_struct_members_such, sizeof(__pyx_k_Pickling_of_struct_members_such), 0, 0, 1, 0}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, + {&__pyx_n_s_allclose, __pyx_k_allclose, sizeof(__pyx_k_allclose), 0, 0, 1, 1}, + {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, + {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1}, + {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, + {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, + {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, + {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1}, + {&__pyx_kp_s_coords_must_have_a_shape_of_n_3, __pyx_k_coords_must_have_a_shape_of_n_3, sizeof(__pyx_k_coords_must_have_a_shape_of_n_3), 0, 0, 1, 0}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_cutoff, __pyx_k_cutoff, sizeof(__pyx_k_cutoff), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1}, + {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, + {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, + {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1}, + {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, + {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max_gridsize, __pyx_k_max_gridsize, sizeof(__pyx_k_max_gridsize), 0, 0, 1, 1}, + {&__pyx_n_s_max_size, __pyx_k_max_size, sizeof(__pyx_k_max_size), 0, 0, 1, 1}, + {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, + {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_ncoords, __pyx_k_ncoords, sizeof(__pyx_k_ncoords), 0, 0, 1, 1}, + {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, + {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, + {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, + {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, + {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, + {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, + {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, + {&__pyx_n_s_pbc, __pyx_k_pbc, sizeof(__pyx_k_pbc), 0, 0, 1, 1}, + {&__pyx_n_s_periodic, __pyx_k_periodic, sizeof(__pyx_k_periodic), 0, 0, 1, 1}, + {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_FastNS, __pyx_k_pyx_unpickle_FastNS, sizeof(__pyx_k_pyx_unpickle_FastNS), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_unpickle_NSResults, __pyx_k_pyx_unpickle_NSResults, sizeof(__pyx_k_pyx_unpickle_NSResults), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1}, + {&__pyx_kp_s_search_coords_must_have_a_shape, __pyx_k_search_coords_must_have_a_shape, sizeof(__pyx_k_search_coords_must_have_a_shape), 0, 0, 1, 0}, + {&__pyx_n_s_searchcoords, __pyx_k_searchcoords, sizeof(__pyx_k_searchcoords), 0, 0, 1, 1}, + {&__pyx_kp_s_self_beadids_self_cellids_self_n, __pyx_k_self_beadids_self_cellids_self_n, sizeof(__pyx_k_self_beadids_self_cellids_self_n), 0, 0, 1, 0}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, + {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, + {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_triclinic_vectors, __pyx_k_triclinic_vectors, sizeof(__pyx_k_triclinic_vectors), 0, 0, 1, 1}, + {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, + {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, + {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, + {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 810, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1000, __pyx_L1_error) + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 150, __pyx_L1_error) + __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 399, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 608, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 827, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "MDAnalysis/lib/nsgrid.pyx":228 + * DIM, DIM, box.shape[0], box.shape[1])) + * if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): + * raise ValueError("Box does not correspond to PBC=xyz") # <<<<<<<<<<<<<< + * self.fast_update(box) + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Box_does_not_correspond_to_PBC_x); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(tree fragment)":4 + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("Pickling of struct members such as self.c_pbcbox must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<< + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_beadids_self_cellids_self_n); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "(tree fragment)":4 + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("self.beadids,self.cellids,self.nbeads cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_self_beadids_self_cellids_self_n); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "MDAnalysis/lib/nsgrid.pyx":772 + * "".format(coords.shape)) + * + * if np.allclose(box[:3], 0.0): # <<<<<<<<<<<<<< + * raise ValueError("Any of the box dimensions cannot be 0") + * + */ + __pyx_slice__6 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__6); + __Pyx_GIVEREF(__pyx_slice__6); + + /* "MDAnalysis/lib/nsgrid.pyx":773 + * + * if np.allclose(box[:3], 0.0): + * raise ValueError("Any of the box dimensions cannot be 0") # <<<<<<<<<<<<<< + * + * self.periodic = pbc + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Any_of_the_box_dimensions_cannot); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "MDAnalysis/lib/nsgrid.pyx":778 + * self.coords = coords.astype(np.float32, order='C', copy=True) + * + * if box.shape != (3, 3): # <<<<<<<<<<<<<< + * box = triclinic_vectors(box) + * + */ + __pyx_tuple__8 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "MDAnalysis/lib/nsgrid.pyx":784 + * + * if cutoff < 0: + * raise ValueError("Cutoff must be positive!") # <<<<<<<<<<<<<< + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: + * raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Cutoff_must_be_positive); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "MDAnalysis/lib/nsgrid.pyx":786 + * raise ValueError("Cutoff must be positive!") + * if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: + * raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") # <<<<<<<<<<<<<< + * + * self.coords_bbox = self.box.fast_put_atoms_in_bbox(self.coords) + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cutoff_greater_than_maximum_cuto); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): + * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< + * + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) + * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): + * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< + * + * info.buf = PyArray_DATA(self) + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + * if ((descr.byteorder == c'>' and little_endian) or + * (descr.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * if t == NPY_BYTE: f = "b" + * elif t == NPY_UBYTE: f = "B" + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + * + * if (end - f) - (new_offset - offset[0]) < 15: + * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< + * + * if ((child.byteorder == c'>' and little_endian) or + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + * if ((child.byteorder == c'>' and little_endian) or + * (child.byteorder == c'<' and not little_endian)): + * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< + * # One could encode it in the format string and have Cython + * # complain instead, BUT: < and > in format strings also imply + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + * t = child.type_num + * if end - f < 5: + * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< + * + * # Until ticket #99 is fixed, use integers to avoid warnings + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + * _import_array() + * except Exception: + * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_umath() except -1: + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 1000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + * + * cdef inline int import_ufunc() except -1: + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + * _import_umath() + * except Exception: + * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 1012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "View.MemoryView":132 + * + * if not self.ndim: + * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< + * + * if itemsize <= 0: + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "View.MemoryView":135 + * + * if itemsize <= 0: + * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< + * + * if not isinstance(format, bytes): + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "View.MemoryView":138 + * + * if not isinstance(format, bytes): + * format = format.encode('ASCII') # <<<<<<<<<<<<<< + * self._format = format # keep a reference to the byte string + * self.format = self._format + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "View.MemoryView":147 + * + * if not self._shape: + * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "View.MemoryView":175 + * self.data = malloc(self.len) + * if not self.data: + * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< + * + * if self.dtype_is_object: + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "View.MemoryView":191 + * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS + * if not (flags & bufmode): + * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< + * info.buf = self.data + * info.len = self.len + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "View.MemoryView":413 + * 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__28 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "View.MemoryView":490 + * result = struct.unpack(self.view.format, bytesitem) + * except struct.error: + * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< + * else: + * if len(self.view.format) == 1: + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "View.MemoryView":515 + * 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_STRIDES: + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "View.MemoryView":565 + * 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__31 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 565, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + + /* "View.MemoryView":572 + * def suboffsets(self): + * if self.view.suboffsets == NULL: + * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< + * + * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) + */ + __pyx_tuple__32 = PyTuple_New(1); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_tuple__32, 0, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_tuple__32); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + + /* "View.MemoryView":677 + * if item is Ellipsis: + * if not seen_ellipsis: + * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< + * seen_ellipsis = True + * else: + */ + __pyx_slice__35 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(1, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__35); + __Pyx_GIVEREF(__pyx_slice__35); + + /* "View.MemoryView":680 + * seen_ellipsis = True + * else: + * result.append(slice(None)) # <<<<<<<<<<<<<< + * have_slices = True + * else: + */ + __pyx_slice__36 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__36)) __PYX_ERR(1, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__36); + __Pyx_GIVEREF(__pyx_slice__36); + + /* "View.MemoryView":691 + * nslices = ndim - len(result) + * if nslices: + * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< + * + * return have_slices or nslices, tuple(result) + */ + __pyx_slice__37 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__37)) __PYX_ERR(1, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_slice__37); + __Pyx_GIVEREF(__pyx_slice__37); + + /* "View.MemoryView":698 + * for suboffset in suboffsets[:ndim]: + * if suboffset >= 0: + * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + + /* "(tree fragment)":1 + * def __pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x294c292: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_tuple__41 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_NSResults, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 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_stringsource, __pyx_n_s_pyx_unpickle_FastNS, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "View.MemoryView":285 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + + /* "View.MemoryView":286 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + + /* "View.MemoryView":287 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + + /* "View.MemoryView":290 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__48); + __Pyx_GIVEREF(__pyx_tuple__48); + + /* "View.MemoryView":291 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_5000 = PyInt_FromLong(5000); if (unlikely(!__pyx_int_5000)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_43303570 = PyInt_FromLong(43303570L); if (unlikely(!__pyx_int_43303570)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_221827040 = PyInt_FromLong(221827040L); if (unlikely(!__pyx_int_221827040)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static int __Pyx_modinit_global_init_code(void); /*proto*/ +static int __Pyx_modinit_variable_export_code(void); /*proto*/ +static int __Pyx_modinit_function_export_code(void); /*proto*/ +static int __Pyx_modinit_type_init_code(void); /*proto*/ +static int __Pyx_modinit_type_import_code(void); /*proto*/ +static int __Pyx_modinit_variable_import_code(void); /*proto*/ +static int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + generic = Py_None; Py_INCREF(Py_None); + strided = Py_None; Py_INCREF(Py_None); + indirect = Py_None; Py_INCREF(Py_None); + contiguous = Py_None; Py_INCREF(Py_None); + indirect_contiguous = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_PBCBox = &__pyx_vtable_10MDAnalysis_3lib_6nsgrid_PBCBox; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_PBCBox.fast_update = (void (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __Pyx_memviewslice))__pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_update; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_PBCBox.fast_pbc_dx = (void (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *))__pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_pbc_dx; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_PBCBox.fast_distance2 = (__pyx_t_10MDAnalysis_3lib_6nsgrid_real (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *))__pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_distance2; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_PBCBox.fast_put_atoms_in_bbox = (__Pyx_memviewslice (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_PBCBox *, __Pyx_memviewslice))__pyx_f_10MDAnalysis_3lib_6nsgrid_6PBCBox_fast_put_atoms_in_bbox; + if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox) < 0) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox.tp_dictoffset && __pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 119, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__.doc = __pyx_doc_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6PBCBox___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox.tp_dict, __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_PBCBox) < 0) __PYX_ERR(0, 119, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "PBCBox", (PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox) < 0) __PYX_ERR(0, 119, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox) < 0) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_ptype_10MDAnalysis_3lib_6nsgrid_PBCBox = &__pyx_type_10MDAnalysis_3lib_6nsgrid_PBCBox; + __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSResults = &__pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSResults; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSResults.add_neighbors = (void (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int, __pyx_t_10MDAnalysis_3lib_6nsgrid_real))__pyx_f_10MDAnalysis_3lib_6nsgrid_9NSResults_add_neighbors; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSResults.create_buffers = (void (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSResults *))__pyx_f_10MDAnalysis_3lib_6nsgrid_9NSResults_create_buffers; + if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults.tp_dictoffset && __pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 310, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_9NSResults___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_9NSResults___init__.doc = __pyx_doc_10MDAnalysis_3lib_6nsgrid_9NSResults___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_9NSResults___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults.tp_dict, __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSResults) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NSResults", (PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSResults = &__pyx_type_10MDAnalysis_3lib_6nsgrid_NSResults; + __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSGrid = &__pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSGrid; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSGrid.coord2cellid = (__pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *, __pyx_t_10MDAnalysis_3lib_6nsgrid_real *))__pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_coord2cellid; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSGrid.cellid2cellxyz = (int (*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int, __pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int *))__pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_cellid2cellxyz; + __pyx_vtable_10MDAnalysis_3lib_6nsgrid_NSGrid.fill_grid = (PyObject *(*)(struct __pyx_obj_10MDAnalysis_3lib_6nsgrid_NSGrid *, __Pyx_memviewslice))__pyx_f_10MDAnalysis_3lib_6nsgrid_6NSGrid_fill_grid; + if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid.tp_dictoffset && __pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 510, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__.doc = __pyx_doc_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6NSGrid___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid.tp_dict, __pyx_vtabptr_10MDAnalysis_3lib_6nsgrid_NSGrid) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "NSGrid", (PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_ptype_10MDAnalysis_3lib_6nsgrid_NSGrid = &__pyx_type_10MDAnalysis_3lib_6nsgrid_NSGrid; + if (PyType_Ready(&__pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS) < 0) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS.tp_dictoffset && __pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 686, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6FastNS___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6FastNS___init__.doc = __pyx_doc_10MDAnalysis_3lib_6nsgrid_6FastNS___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10MDAnalysis_3lib_6nsgrid_6FastNS___init__; + } + } + #endif + if (PyObject_SetAttrString(__pyx_m, "FastNS", (PyObject *)&__pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS) < 0) __PYX_ERR(0, 686, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS) < 0) __PYX_ERR(0, 686, __pyx_L1_error) + __pyx_ptype_10MDAnalysis_3lib_6nsgrid_FastNS = &__pyx_type_10MDAnalysis_3lib_6nsgrid_FastNS; + __pyx_vtabptr_array = &__pyx_vtable_array; + __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; + if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error) + __pyx_type___pyx_array.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error) + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_type___pyx_MemviewEnum.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error) + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; + __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; + __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; + __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; + __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; + __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; + __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; + __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; + __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; + if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + __pyx_type___pyx_memoryview.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + __pyx_memoryview_type = &__pyx_type___pyx_memoryview; + __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; + __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; + __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; + __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; + __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; + if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error) + __pyx_type___pyx_memoryviewslice.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error) + __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(2, 164, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(2, 186, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(2, 190, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(2, 199, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(2, 872, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initnsgrid(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initnsgrid(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_nsgrid(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_nsgrid(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + result = PyDict_SetItemString(moddict, to_name, value); + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static int __pyx_pymod_exec_nsgrid(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + static PyThread_type_lock __pyx_t_2[8]; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_nsgrid(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("nsgrid", __pyx_methods, __pyx_k_Neighbor_search_library_mod_MDA, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_MDAnalysis__lib__nsgrid) { + if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "MDAnalysis.lib.nsgrid")) { + if (unlikely(PyDict_SetItemString(modules, "MDAnalysis.lib.nsgrid", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "MDAnalysis/lib/nsgrid.pyx":78 + * from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free + * from libc.math cimport sqrt + * import numpy as np # <<<<<<<<<<<<<< + * from libcpp.vector cimport vector + * cimport numpy as np + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":1 + * def __pyx_unpickle_NSResults(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0x294c292: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6nsgrid_1__pyx_unpickle_NSResults, NULL, __pyx_n_s_MDAnalysis_lib_nsgrid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_NSResults, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_NSResults__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_NSResults__set_state(NSResults __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.coords = __pyx_state[0]; __pyx_result.cutoff = __pyx_state[1]; __pyx_result.distances_buffer = __pyx_state[2]; __pyx_result.indices_buffer = __pyx_state[3]; __pyx_result.npairs = __pyx_state[4]; __pyx_result.pair_distances2_buffer = __pyx_state[5]; __pyx_result.pair_distances_buffer = __pyx_state[6]; __pyx_result.pairs_buffer = __pyx_state[7]; __pyx_result.searchcoords = __pyx_state[8] + * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6nsgrid_3__pyx_unpickle_FastNS, NULL, __pyx_n_s_MDAnalysis_lib_nsgrid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_FastNS, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "MDAnalysis/lib/nsgrid.pyx":1 + * # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- # <<<<<<<<<<<<<< + * # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 + * # + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "View.MemoryView":208 + * 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(1, 208, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 208, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_array_type); + + /* "View.MemoryView":285 + * return self.name + * + * cdef generic = Enum("") # <<<<<<<<<<<<<< + * cdef strided = Enum("") # default + * cdef indirect = Enum("") + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(generic); + __Pyx_DECREF_SET(generic, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":286 + * + * cdef generic = Enum("") + * cdef strided = Enum("") # default # <<<<<<<<<<<<<< + * cdef indirect = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(strided); + __Pyx_DECREF_SET(strided, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":287 + * cdef generic = Enum("") + * cdef strided = Enum("") # default + * cdef indirect = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect); + __Pyx_DECREF_SET(indirect, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":290 + * + * + * cdef contiguous = Enum("") # <<<<<<<<<<<<<< + * cdef indirect_contiguous = Enum("") + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(contiguous); + __Pyx_DECREF_SET(contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":291 + * + * cdef contiguous = Enum("") + * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(indirect_contiguous); + __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "View.MemoryView":315 + * + * DEF THREAD_LOCKS_PREALLOCATED = 8 + * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< + * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ + * PyThread_allocate_lock(), + */ + __pyx_memoryview_thread_locks_used = 0; + + /* "View.MemoryView":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 = [ # <<<<<<<<<<<<<< + * PyThread_allocate_lock(), + * PyThread_allocate_lock(), + */ + __pyx_t_2[0] = PyThread_allocate_lock(); + __pyx_t_2[1] = PyThread_allocate_lock(); + __pyx_t_2[2] = PyThread_allocate_lock(); + __pyx_t_2[3] = PyThread_allocate_lock(); + __pyx_t_2[4] = PyThread_allocate_lock(); + __pyx_t_2[5] = PyThread_allocate_lock(); + __pyx_t_2[6] = PyThread_allocate_lock(); + __pyx_t_2[7] = PyThread_allocate_lock(); + memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); + + /* "View.MemoryView":544 + * 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(1, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryview_type); + + /* "View.MemoryView":990 + * 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(1, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 990, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_memoryviewslice_type); + + /* "(tree fragment)":1 + * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< + * if __pyx_checksum != 0xb068931: + * from pickle import PickleError as __pyx_PickleError + */ + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "(tree fragment)":9 + * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) + * return __pyx_result + * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< + * __pyx_result.name = __pyx_state[0] + * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init MDAnalysis.lib.nsgrid", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init MDAnalysis.lib.nsgrid"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +#include "frameobject.h" +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = f->f_localsplus; + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* MemviewSliceInit */ +static int +__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, + int ndim, + __Pyx_memviewslice *memviewslice, + int memview_is_new_reference) +{ + __Pyx_RefNannyDeclarations + int i, retval=-1; + Py_buffer *buf = &memview->view; + __Pyx_RefNannySetupContext("init_memviewslice", 0); + if (!buf) { + PyErr_SetString(PyExc_ValueError, + "buf is NULL."); + goto fail; + } else if (memviewslice->memview || memviewslice->data) { + PyErr_SetString(PyExc_ValueError, + "memviewslice is already initialized!"); + goto fail; + } + if (buf->strides) { + for (i = 0; i < ndim; i++) { + memviewslice->strides[i] = buf->strides[i]; + } + } else { + Py_ssize_t stride = buf->itemsize; + for (i = ndim - 1; i >= 0; i--) { + memviewslice->strides[i] = stride; + stride *= buf->shape[i]; + } + } + for (i = 0; i < ndim; i++) { + memviewslice->shape[i] = buf->shape[i]; + if (buf->suboffsets) { + memviewslice->suboffsets[i] = buf->suboffsets[i]; + } else { + memviewslice->suboffsets[i] = -1; + } + } + memviewslice->memview = memview; + memviewslice->data = (char *)buf->buf; + if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { + Py_INCREF(memview); + } + retval = 0; + goto no_fail; +fail: + memviewslice->memview = 0; + memviewslice->data = 0; + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} +#ifndef Py_NO_RETURN +#define Py_NO_RETURN +#endif +static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { + va_list vargs; + char msg[200]; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, fmt); +#else + va_start(vargs); +#endif + vsnprintf(msg, 200, fmt, vargs); + va_end(vargs); + Py_FatalError(msg); +} +static CYTHON_INLINE int +__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)++; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE int +__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, + PyThread_type_lock lock) +{ + int result; + PyThread_acquire_lock(lock, 1); + result = (*acquisition_count)--; + PyThread_release_lock(lock); + return result; +} +static CYTHON_INLINE void +__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) +{ + int first_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview || (PyObject *) memview == Py_None) + return; + if (__pyx_get_slice_count(memview) < 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + first_time = __pyx_add_acquisition_count(memview) == 0; + if (first_time) { + if (have_gil) { + Py_INCREF((PyObject *) memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_INCREF((PyObject *) memview); + PyGILState_Release(_gilstate); + } + } +} +static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, + int have_gil, int lineno) { + int last_time; + struct __pyx_memoryview_obj *memview = memslice->memview; + if (!memview ) { + return; + } else if ((PyObject *) memview == Py_None) { + memslice->memview = NULL; + return; + } + if (__pyx_get_slice_count(memview) <= 0) + __pyx_fatalerror("Acquisition count is %d (line %d)", + __pyx_get_slice_count(memview), lineno); + last_time = __pyx_sub_acquisition_count(memview) == 1; + memslice->data = NULL; + if (last_time) { + if (have_gil) { + Py_CLEAR(memslice->memview); + } else { + PyGILState_STATE _gilstate = PyGILState_Ensure(); + Py_CLEAR(memslice->memview); + PyGILState_Release(_gilstate); + } + } else { + memslice->memview = NULL; + } +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* GetModuleGlobalName */ +static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + if (likely(result)) { + Py_INCREF(result); + } else if (unlikely(PyErr_Occurred())) { + result = NULL; + } else { +#else + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { + PyErr_Clear(); +#endif + result = __Pyx_GetBuiltinName(name); + } + return result; +} + +/* PyErrExceptionMatches */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ + static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ + static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* ArgTypeTest */ + static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* Import */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetItemInt */ + static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* SliceObject */ + static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_slice(obj, cstart, cstop); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); +bad: + return NULL; +} + +/* HasAttr */ + static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* ExtTypeTest */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* DictGetItem */ + #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) + PyErr_SetObject(PyExc_KeyError, args); + Py_XDECREF(args); + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseNoneIterError */ + static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* SaveResetException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if PY_VERSION_HEX >= 0x030700A3 + *type = tstate->exc_state.exc_type; + *value = tstate->exc_state.exc_value; + *tb = tstate->exc_state.exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = type; + tstate->exc_state.exc_value = value; + tstate->exc_state.exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ + #if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { +#endif + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = local_type; + tstate->exc_state.exc_value = local_value; + tstate->exc_state.exc_traceback = local_tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* BytesEquals */ + static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ + static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* ObjectGetItem */ + #if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* decode_c_string */ + static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + length = stop - start; + if (unlikely(length <= 0)) + return PyUnicode_FromUnicode(NULL, 0); + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* SwapException */ + #if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030700A3 + tmp_type = tstate->exc_state.exc_type; + tmp_value = tstate->exc_state.exc_value; + tmp_tb = tstate->exc_state.exc_traceback; + tstate->exc_state.exc_type = *type; + tstate->exc_state.exc_value = *value; + tstate->exc_state.exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* FastTypeChecks */ + #if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0 || (x^b) >= 0)) + return PyInt_FromLong(x); + return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; +#ifdef HAVE_LONG_LONG + const PY_LONG_LONG llb = intval; + PY_LONG_LONG lla, llx; +#endif + const digit* digits = ((PyLongObject*)op1)->ob_digit; + const Py_ssize_t size = Py_SIZE(op1); + if (likely(__Pyx_sst_abs(size) <= 1)) { + a = likely(size) ? digits[0] : 0; + if (size == -1) a = -a; + } else { + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; +#ifdef HAVE_LONG_LONG + } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { + lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); + goto long_long; +#endif + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + } + } + x = a + b; + return PyLong_FromLong(x); +#ifdef HAVE_LONG_LONG + long_long: + llx = lla + llb; + return PyLong_FromLongLong(llx); +#endif + + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + double result; + PyFPE_START_PROTECT("add", return NULL) + result = ((double)a) + (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); +} +#endif + +/* None */ + static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* PyObject_GenericGetAttrNoDict */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ + #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ + static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* SetupReduce */ + static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; +#else + if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; +#endif +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; + setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto GOOD; +BAD: + if (!PyErr_Occurred()) + PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); + ret = -1; +GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} + +/* CLineInTraceback */ + #ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (PyObject_Not(use_cline) != 0) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ + static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ + #include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +#if PY_MAJOR_VERSION < 3 +static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { + if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); + if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); + PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); + return -1; +} +static void __Pyx_ReleaseBuffer(Py_buffer *view) { + PyObject *obj = view->obj; + if (!obj) return; + if (PyObject_CheckBuffer(obj)) { + PyBuffer_Release(view); + return; + } + if ((0)) {} + else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); + view->obj = NULL; + Py_DECREF(obj); +} +#endif + + + /* MemviewSliceIsContig */ + static int +__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) +{ + int i, index, step, start; + Py_ssize_t itemsize = mvs.memview->view.itemsize; + if (order == 'F') { + step = 1; + start = 0; + } else { + step = -1; + start = ndim - 1; + } + for (i = 0; i < ndim; i++) { + index = start + step * i; + if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) + return 0; + itemsize *= mvs.shape[index]; + } + return 1; +} + +/* OverlappingSlices */ + static void +__pyx_get_array_memory_extents(__Pyx_memviewslice *slice, + void **out_start, void **out_end, + int ndim, size_t itemsize) +{ + char *start, *end; + int i; + start = end = slice->data; + for (i = 0; i < ndim; i++) { + Py_ssize_t stride = slice->strides[i]; + Py_ssize_t extent = slice->shape[i]; + if (extent == 0) { + *out_start = *out_end = start; + return; + } else { + if (stride > 0) + end += stride * (extent - 1); + else + start += stride * (extent - 1); + } + } + *out_start = start; + *out_end = end + itemsize; +} +static int +__pyx_slices_overlap(__Pyx_memviewslice *slice1, + __Pyx_memviewslice *slice2, + int ndim, size_t itemsize) +{ + void *start1, *end1, *start2, *end2; + __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); + __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); + return (start1 < end2) && (start2 < end1); +} + +/* Capsule */ + static CYTHON_INLINE PyObject * +__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) +{ + PyObject *cobj; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, NULL); +#else + cobj = PyCObject_FromVoidPtr(p, NULL); +#endif + return cobj; +} + +/* MemviewDtypeToObject */ + static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(const char *itemp) { + return (PyObject *) PyFloat_FromDouble(*(__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) itemp); +} +static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(const char *itemp, PyObject *obj) { + __pyx_t_10MDAnalysis_3lib_6nsgrid_real value = __pyx_PyFloat_AsFloat(obj); + if ((value == ((npy_float32)-1)) && PyErr_Occurred()) + return 0; + *(__pyx_t_10MDAnalysis_3lib_6nsgrid_real *) itemp = value; + return 1; +} + +/* IsLittleEndian */ + static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) +{ + union { + uint32_t u32; + uint8_t u8[4]; + } S; + S.u32 = 0x01020304; + return S.u8[0] == 4; +} + +/* BufferFormatCheck */ + static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, + __Pyx_BufFmt_StackElem* stack, + __Pyx_TypeInfo* type) { + stack[0].field = &ctx->root; + stack[0].parent_offset = 0; + ctx->root.type = type; + ctx->root.name = "buffer dtype"; + ctx->root.offset = 0; + ctx->head = stack; + ctx->head->field = &ctx->root; + ctx->fmt_offset = 0; + ctx->head->parent_offset = 0; + ctx->new_packmode = '@'; + ctx->enc_packmode = '@'; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->is_complex = 0; + ctx->is_valid_array = 0; + ctx->struct_alignment = 0; + while (type->typegroup == 'S') { + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = 0; + type = type->fields->type; + } +} +static int __Pyx_BufFmt_ParseNumber(const char** ts) { + int count; + const char* t = *ts; + if (*t < '0' || *t > '9') { + return -1; + } else { + count = *t++ - '0'; + while (*t >= '0' && *t < '9') { + count *= 10; + count += *t++ - '0'; + } + } + *ts = t; + return count; +} +static int __Pyx_BufFmt_ExpectNumber(const char **ts) { + int number = __Pyx_BufFmt_ParseNumber(ts); + if (number == -1) + PyErr_Format(PyExc_ValueError,\ + "Does not understand character buffer dtype format string ('%c')", **ts); + return number; +} +static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { + PyErr_Format(PyExc_ValueError, + "Unexpected format string character: '%c'", ch); +} +static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { + switch (ch) { + case 'c': return "'char'"; + case 'b': return "'signed char'"; + case 'B': return "'unsigned char'"; + case 'h': return "'short'"; + case 'H': return "'unsigned short'"; + case 'i': return "'int'"; + case 'I': return "'unsigned int'"; + case 'l': return "'long'"; + case 'L': return "'unsigned long'"; + case 'q': return "'long long'"; + case 'Q': return "'unsigned long long'"; + case 'f': return (is_complex ? "'complex float'" : "'float'"); + case 'd': return (is_complex ? "'complex double'" : "'double'"); + case 'g': return (is_complex ? "'complex long double'" : "'long double'"); + case 'T': return "a struct"; + case 'O': return "Python object"; + case 'P': return "a pointer"; + case 's': case 'p': return "a string"; + case 0: return "end"; + default: return "unparseable format string"; + } +} +static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return 2; + case 'i': case 'I': case 'l': case 'L': return 4; + case 'q': case 'Q': return 8; + case 'f': return (is_complex ? 8 : 4); + case 'd': return (is_complex ? 16 : 8); + case 'g': { + PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); + return 0; + } + case 'O': case 'P': return sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { + switch (ch) { + case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(short); + case 'i': case 'I': return sizeof(int); + case 'l': case 'L': return sizeof(long); + #ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(PY_LONG_LONG); + #endif + case 'f': return sizeof(float) * (is_complex ? 2 : 1); + case 'd': return sizeof(double) * (is_complex ? 2 : 1); + case 'g': return sizeof(long double) * (is_complex ? 2 : 1); + case 'O': case 'P': return sizeof(void*); + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +typedef struct { char c; short x; } __Pyx_st_short; +typedef struct { char c; int x; } __Pyx_st_int; +typedef struct { char c; long x; } __Pyx_st_long; +typedef struct { char c; float x; } __Pyx_st_float; +typedef struct { char c; double x; } __Pyx_st_double; +typedef struct { char c; long double x; } __Pyx_st_longdouble; +typedef struct { char c; void *x; } __Pyx_st_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_st_float) - sizeof(float); + case 'd': return sizeof(__Pyx_st_double) - sizeof(double); + case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +/* These are for computing the padding at the end of the struct to align + on the first member of the struct. This will probably the same as above, + but we don't have any guarantees. + */ +typedef struct { short x; char c; } __Pyx_pad_short; +typedef struct { int x; char c; } __Pyx_pad_int; +typedef struct { long x; char c; } __Pyx_pad_long; +typedef struct { float x; char c; } __Pyx_pad_float; +typedef struct { double x; char c; } __Pyx_pad_double; +typedef struct { long double x; char c; } __Pyx_pad_longdouble; +typedef struct { void *x; char c; } __Pyx_pad_void_p; +#ifdef HAVE_LONG_LONG +typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; +#endif +static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { + switch (ch) { + case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; + case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); + case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); + case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); +#ifdef HAVE_LONG_LONG + case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); +#endif + case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); + case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); + case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); + case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); + default: + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } +} +static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { + switch (ch) { + case 'c': + return 'H'; + case 'b': case 'h': case 'i': + case 'l': case 'q': case 's': case 'p': + return 'I'; + case 'B': case 'H': case 'I': case 'L': case 'Q': + return 'U'; + case 'f': case 'd': case 'g': + return (is_complex ? 'C' : 'R'); + case 'O': + return 'O'; + case 'P': + return 'P'; + default: { + __Pyx_BufFmt_RaiseUnexpectedChar(ch); + return 0; + } + } +} +static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { + if (ctx->head == NULL || ctx->head->field == &ctx->root) { + const char* expected; + const char* quote; + if (ctx->head == NULL) { + expected = "end"; + quote = ""; + } else { + expected = ctx->head->field->type->name; + quote = "'"; + } + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected %s%s%s but got %s", + quote, expected, quote, + __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); + } else { + __Pyx_StructField* field = ctx->head->field; + __Pyx_StructField* parent = (ctx->head - 1)->field; + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", + field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), + parent->type->name, field->name); + } +} +static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { + char group; + size_t size, offset, arraysize = 1; + if (ctx->enc_type == 0) return 0; + if (ctx->head->field->type->arraysize[0]) { + int i, ndim = 0; + if (ctx->enc_type == 's' || ctx->enc_type == 'p') { + ctx->is_valid_array = ctx->head->field->type->ndim == 1; + ndim = 1; + if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { + PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %zu", + ctx->head->field->type->arraysize[0], ctx->enc_count); + return -1; + } + } + if (!ctx->is_valid_array) { + PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", + ctx->head->field->type->ndim, ndim); + return -1; + } + for (i = 0; i < ctx->head->field->type->ndim; i++) { + arraysize *= ctx->head->field->type->arraysize[i]; + } + ctx->is_valid_array = 0; + ctx->enc_count = 1; + } + group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); + do { + __Pyx_StructField* field = ctx->head->field; + __Pyx_TypeInfo* type = field->type; + if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { + size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); + } else { + size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); + } + if (ctx->enc_packmode == '@') { + size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); + size_t align_mod_offset; + if (align_at == 0) return -1; + align_mod_offset = ctx->fmt_offset % align_at; + if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; + if (ctx->struct_alignment == 0) + ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, + ctx->is_complex); + } + if (type->size != size || type->typegroup != group) { + if (type->typegroup == 'C' && type->fields != NULL) { + size_t parent_offset = ctx->head->parent_offset + field->offset; + ++ctx->head; + ctx->head->field = type->fields; + ctx->head->parent_offset = parent_offset; + continue; + } + if ((type->typegroup == 'H' || group == 'H') && type->size == size) { + } else { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + } + offset = ctx->head->parent_offset + field->offset; + if (ctx->fmt_offset != offset) { + PyErr_Format(PyExc_ValueError, + "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", + (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); + return -1; + } + ctx->fmt_offset += size; + if (arraysize) + ctx->fmt_offset += (arraysize - 1) * size; + --ctx->enc_count; + while (1) { + if (field == &ctx->root) { + ctx->head = NULL; + if (ctx->enc_count != 0) { + __Pyx_BufFmt_RaiseExpected(ctx); + return -1; + } + break; + } + ctx->head->field = ++field; + if (field->type == NULL) { + --ctx->head; + field = ctx->head->field; + continue; + } else if (field->type->typegroup == 'S') { + size_t parent_offset = ctx->head->parent_offset + field->offset; + if (field->type->fields->type == NULL) continue; + field = field->type->fields; + ++ctx->head; + ctx->head->field = field; + ctx->head->parent_offset = parent_offset; + break; + } else { + break; + } + } + } while (ctx->enc_count); + ctx->enc_type = 0; + ctx->is_complex = 0; + return 0; +} +static PyObject * +__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) +{ + const char *ts = *tsp; + int i = 0, number; + int ndim = ctx->head->field->type->ndim; +; + ++ts; + if (ctx->new_count != 1) { + PyErr_SetString(PyExc_ValueError, + "Cannot handle repeated arrays in format string"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + while (*ts && *ts != ')') { + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; + } + number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) + return PyErr_Format(PyExc_ValueError, + "Expected a dimension of size %zu, got %d", + ctx->head->field->type->arraysize[i], number); + if (*ts != ',' && *ts != ')') + return PyErr_Format(PyExc_ValueError, + "Expected a comma in format string, got '%c'", *ts); + if (*ts == ',') ts++; + i++; + } + if (i != ndim) + return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", + ctx->head->field->type->ndim, i); + if (!*ts) { + PyErr_SetString(PyExc_ValueError, + "Unexpected end of format string, expected ')'"); + return NULL; + } + ctx->is_valid_array = 1; + ctx->new_count = 1; + *tsp = ++ts; + return Py_None; +} +static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { + int got_Z = 0; + while (1) { + switch(*ts) { + case 0: + if (ctx->enc_type != 0 && ctx->head == NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + if (ctx->head != NULL) { + __Pyx_BufFmt_RaiseExpected(ctx); + return NULL; + } + return ts; + case ' ': + case '\r': + case '\n': + ++ts; + break; + case '<': + if (!__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '>': + case '!': + if (__Pyx_Is_Little_Endian()) { + PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); + return NULL; + } + ctx->new_packmode = '='; + ++ts; + break; + case '=': + case '@': + case '^': + ctx->new_packmode = *ts++; + break; + case 'T': + { + const char* ts_after_sub; + size_t i, struct_count = ctx->new_count; + size_t struct_alignment = ctx->struct_alignment; + ctx->new_count = 1; + ++ts; + if (*ts != '{') { + PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); + return NULL; + } + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + ctx->enc_count = 0; + ctx->struct_alignment = 0; + ++ts; + ts_after_sub = ts; + for (i = 0; i != struct_count; ++i) { + ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); + if (!ts_after_sub) return NULL; + } + ts = ts_after_sub; + if (struct_alignment) ctx->struct_alignment = struct_alignment; + } + break; + case '}': + { + size_t alignment = ctx->struct_alignment; + ++ts; + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_type = 0; + if (alignment && ctx->fmt_offset % alignment) { + ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); + } + } + return ts; + case 'x': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->fmt_offset += ctx->new_count; + ctx->new_count = 1; + ctx->enc_count = 0; + ctx->enc_type = 0; + ctx->enc_packmode = ctx->new_packmode; + ++ts; + break; + case 'Z': + got_Z = 1; + ++ts; + if (*ts != 'f' && *ts != 'd' && *ts != 'g') { + __Pyx_BufFmt_RaiseUnexpectedChar('Z'); + return NULL; + } + CYTHON_FALLTHROUGH; + case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': + case 'l': case 'L': case 'q': case 'Q': + case 'f': case 'd': case 'g': + case 'O': case 'p': + if (ctx->enc_type == *ts && got_Z == ctx->is_complex && + ctx->enc_packmode == ctx->new_packmode) { + ctx->enc_count += ctx->new_count; + ctx->new_count = 1; + got_Z = 0; + ++ts; + break; + } + CYTHON_FALLTHROUGH; + case 's': + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + ++ts; + ctx->new_count = 1; + got_Z = 0; + break; + case ':': + ++ts; + while(*ts != ':') ++ts; + ++ts; + break; + case '(': + if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; + break; + default: + { + int number = __Pyx_BufFmt_ExpectNumber(&ts); + if (number == -1) return NULL; + ctx->new_count = (size_t)number; + } + } + } +} + +/* TypeInfoCompare */ + static int +__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) +{ + int i; + if (!a || !b) + return 0; + if (a == b) + return 1; + if (a->size != b->size || a->typegroup != b->typegroup || + a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { + if (a->typegroup == 'H' || b->typegroup == 'H') { + return a->size == b->size; + } else { + return 0; + } + } + if (a->ndim) { + for (i = 0; i < a->ndim; i++) + if (a->arraysize[i] != b->arraysize[i]) + return 0; + } + if (a->typegroup == 'S') { + if (a->flags != b->flags) + return 0; + if (a->fields || b->fields) { + if (!(a->fields && b->fields)) + return 0; + for (i = 0; a->fields[i].type && b->fields[i].type; i++) { + __Pyx_StructField *field_a = a->fields + i; + __Pyx_StructField *field_b = b->fields + i; + if (field_a->offset != field_b->offset || + !__pyx_typeinfo_cmp(field_a->type, field_b->type)) + return 0; + } + return !a->fields[i].type && !b->fields[i].type; + } + } + return 1; +} + +/* MemviewSliceValidateAndInit */ + static int +__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) +{ + if (buf->shape[dim] <= 1) + return 1; + if (buf->strides) { + if (spec & __Pyx_MEMVIEW_CONTIG) { + if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { + if (buf->strides[dim] != sizeof(void *)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly contiguous " + "in dimension %d.", dim); + goto fail; + } + } else if (buf->strides[dim] != buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_FOLLOW) { + Py_ssize_t stride = buf->strides[dim]; + if (stride < 0) + stride = -stride; + if (stride < buf->itemsize) { + PyErr_SetString(PyExc_ValueError, + "Buffer and memoryview are not contiguous " + "in the same dimension."); + goto fail; + } + } + } else { + if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not contiguous in " + "dimension %d", dim); + goto fail; + } else if (spec & (__Pyx_MEMVIEW_PTR)) { + PyErr_Format(PyExc_ValueError, + "C-contiguous buffer is not indirect in " + "dimension %d", dim); + goto fail; + } else if (buf->suboffsets) { + PyErr_SetString(PyExc_ValueError, + "Buffer exposes suboffsets but no strides"); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) +{ + if (spec & __Pyx_MEMVIEW_DIRECT) { + if (buf->suboffsets && buf->suboffsets[dim] >= 0) { + PyErr_Format(PyExc_ValueError, + "Buffer not compatible with direct access " + "in dimension %d.", dim); + goto fail; + } + } + if (spec & __Pyx_MEMVIEW_PTR) { + if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) { + PyErr_Format(PyExc_ValueError, + "Buffer is not indirectly accessible " + "in dimension %d.", dim); + goto fail; + } + } + return 1; +fail: + return 0; +} +static int +__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) +{ + int i; + if (c_or_f_flag & __Pyx_IS_F_CONTIG) { + Py_ssize_t stride = 1; + for (i = 0; i < ndim; i++) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) + { + PyErr_SetString(PyExc_ValueError, + "Buffer not fortran contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { + Py_ssize_t stride = 1; + for (i = ndim - 1; i >- 1; i--) { + if (stride * buf->itemsize != buf->strides[i] && + buf->shape[i] > 1) { + PyErr_SetString(PyExc_ValueError, + "Buffer not C contiguous."); + goto fail; + } + stride = stride * buf->shape[i]; + } + } + return 1; +fail: + return 0; +} +static int __Pyx_ValidateAndInit_memviewslice( + int *axes_specs, + int c_or_f_flag, + int buf_flags, + int ndim, + __Pyx_TypeInfo *dtype, + __Pyx_BufFmt_StackElem stack[], + __Pyx_memviewslice *memviewslice, + PyObject *original_obj) +{ + struct __pyx_memoryview_obj *memview, *new_memview; + __Pyx_RefNannyDeclarations + Py_buffer *buf; + int i, spec = 0, retval = -1; + __Pyx_BufFmt_Context ctx; + int from_memoryview = __pyx_memoryview_check(original_obj); + __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); + if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) + original_obj)->typeinfo)) { + memview = (struct __pyx_memoryview_obj *) original_obj; + new_memview = NULL; + } else { + memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + original_obj, buf_flags, 0, dtype); + new_memview = memview; + if (unlikely(!memview)) + goto fail; + } + buf = &memview->view; + if (buf->ndim != ndim) { + PyErr_Format(PyExc_ValueError, + "Buffer has wrong number of dimensions (expected %d, got %d)", + ndim, buf->ndim); + goto fail; + } + if (new_memview) { + __Pyx_BufFmt_Init(&ctx, stack, dtype); + if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail; + } + if ((unsigned) buf->itemsize != dtype->size) { + PyErr_Format(PyExc_ValueError, + "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " + "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", + buf->itemsize, + (buf->itemsize > 1) ? "s" : "", + dtype->name, + dtype->size, + (dtype->size > 1) ? "s" : ""); + goto fail; + } + for (i = 0; i < ndim; i++) { + spec = axes_specs[i]; + if (!__pyx_check_strides(buf, i, ndim, spec)) + goto fail; + if (!__pyx_check_suboffsets(buf, i, ndim, spec)) + goto fail; + } + if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, + new_memview != NULL) == -1)) { + goto fail; + } + retval = 0; + goto no_fail; +fail: + Py_XDECREF(new_memview); + retval = -1; +no_fail: + __Pyx_RefNannyFinishContext(); + return retval; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG, + (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2, + &__Pyx_TypeInfo_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_real, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value) { + const npy_long neg_one = (npy_long) -1, const_zero = (npy_long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(npy_long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(npy_long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(npy_long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(npy_long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ + #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return ::std::complex< float >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + return x + y*(__pyx_t_float_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { + __pyx_t_float_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabsf(b.real) >= fabsf(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + float r = b.imag / b.real; + float s = 1.0 / (b.real + b.imag * r); + return __pyx_t_float_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + float r = b.real / b.imag; + float s = 1.0 / (b.imag + b.real * r); + return __pyx_t_float_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + if (b.imag == 0) { + return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + float denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_float_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) { + __pyx_t_float_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrtf(z.real*z.real + z.imag*z.imag); + #else + return hypotf(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) { + __pyx_t_float_complex z; + float r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + float denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(a, a); + case 3: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, a); + case 4: + z = __Pyx_c_prod_float(a, a); + return __Pyx_c_prod_float(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = powf(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2f(0, -1); + } + } else { + r = __Pyx_c_abs_float(a); + theta = atan2f(a.imag, a.real); + } + lnr = logf(r); + z_r = expf(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cosf(z_theta); + z.imag = z_r * sinf(z_theta); + return z; + } + #endif +#endif + +/* Declarations */ + #if CYTHON_CCOMPLEX + #ifdef __cplusplus + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return ::std::complex< double >(x, y); + } + #else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + return x + y*(__pyx_t_double_complex)_Complex_I; + } + #endif +#else + static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { + __pyx_t_double_complex z; + z.real = x; + z.imag = y; + return z; + } +#endif + +/* Arithmetic */ + #if CYTHON_CCOMPLEX +#else + static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + return (a.real == b.real) && (a.imag == b.imag); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real + b.real; + z.imag = a.imag + b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real - b.real; + z.imag = a.imag - b.imag; + return z; + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + z.real = a.real * b.real - a.imag * b.imag; + z.imag = a.real * b.imag + a.imag * b.real; + return z; + } + #if 1 + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else if (fabs(b.real) >= fabs(b.imag)) { + if (b.real == 0 && b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag); + } else { + double r = b.imag / b.real; + double s = 1.0 / (b.real + b.imag * r); + return __pyx_t_double_complex_from_parts( + (a.real + a.imag * r) * s, (a.imag - a.real * r) * s); + } + } else { + double r = b.real / b.imag; + double s = 1.0 / (b.imag + b.real * r); + return __pyx_t_double_complex_from_parts( + (a.real * r + a.imag) * s, (a.imag * r - a.real) * s); + } + } + #else + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + if (b.imag == 0) { + return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real); + } else { + double denom = b.real * b.real + b.imag * b.imag; + return __pyx_t_double_complex_from_parts( + (a.real * b.real + a.imag * b.imag) / denom, + (a.imag * b.real - a.real * b.imag) / denom); + } + } + #endif + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = -a.real; + z.imag = -a.imag; + return z; + } + static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) { + return (a.real == 0) && (a.imag == 0); + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) { + __pyx_t_double_complex z; + z.real = a.real; + z.imag = -a.imag; + return z; + } + #if 1 + static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) { + #if !defined(HAVE_HYPOT) || defined(_MSC_VER) + return sqrt(z.real*z.real + z.imag*z.imag); + #else + return hypot(z.real, z.imag); + #endif + } + static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) { + __pyx_t_double_complex z; + double r, lnr, theta, z_r, z_theta; + if (b.imag == 0 && b.real == (int)b.real) { + if (b.real < 0) { + double denom = a.real * a.real + a.imag * a.imag; + a.real = a.real / denom; + a.imag = -a.imag / denom; + b.real = -b.real; + } + switch ((int)b.real) { + case 0: + z.real = 1; + z.imag = 0; + return z; + case 1: + return a; + case 2: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(a, a); + case 3: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, a); + case 4: + z = __Pyx_c_prod_double(a, a); + return __Pyx_c_prod_double(z, z); + } + } + if (a.imag == 0) { + if (a.real == 0) { + return a; + } else if (b.imag == 0) { + z.real = pow(a.real, b.real); + z.imag = 0; + return z; + } else if (a.real > 0) { + r = a.real; + theta = 0; + } else { + r = -a.real; + theta = atan2(0, -1); + } + } else { + r = __Pyx_c_abs_double(a); + theta = atan2(a.imag, a.real); + } + lnr = log(r); + z_r = exp(lnr * b.real - theta * b.imag); + z_theta = theta * b.real + lnr * b.imag; + z.real = z_r * cos(z_theta); + z.imag = z_r * sin(z_theta); + return z; + } + #endif +#endif + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { + const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(enum NPY_TYPES) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(enum NPY_TYPES) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), + little, !is_unsigned); + } +} + +/* MemviewSliceCopyTemplate */ + static __Pyx_memviewslice +__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, + const char *mode, int ndim, + size_t sizeof_dtype, int contig_flag, + int dtype_is_object) +{ + __Pyx_RefNannyDeclarations + int i; + __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; + struct __pyx_memoryview_obj *from_memview = from_mvs->memview; + Py_buffer *buf = &from_memview->view; + PyObject *shape_tuple = NULL; + PyObject *temp_int = NULL; + struct __pyx_array_obj *array_obj = NULL; + struct __pyx_memoryview_obj *memview_obj = NULL; + __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); + for (i = 0; i < ndim; i++) { + if (from_mvs->suboffsets[i] >= 0) { + PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " + "indirect dimensions (axis %d)", i); + goto fail; + } + } + shape_tuple = PyTuple_New(ndim); + if (unlikely(!shape_tuple)) { + goto fail; + } + __Pyx_GOTREF(shape_tuple); + for(i = 0; i < ndim; i++) { + temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); + if(unlikely(!temp_int)) { + goto fail; + } else { + PyTuple_SET_ITEM(shape_tuple, i, temp_int); + temp_int = NULL; + } + } + array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); + if (unlikely(!array_obj)) { + goto fail; + } + __Pyx_GOTREF(array_obj); + memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( + (PyObject *) array_obj, contig_flag, + dtype_is_object, + from_mvs->memview->typeinfo); + if (unlikely(!memview_obj)) + goto fail; + if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) + goto fail; + if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, + dtype_is_object) < 0)) + goto fail; + goto no_fail; +fail: + __Pyx_XDECREF(new_mvs.memview); + new_mvs.memview = NULL; + new_mvs.data = NULL; +no_fail: + __Pyx_XDECREF(shape_tuple); + __Pyx_XDECREF(temp_int); + __Pyx_XDECREF(array_obj); + __Pyx_RefNannyFinishContext(); + return new_mvs; +} + +/* CIntFromPy */ + static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *x) { + const npy_long neg_one = (npy_long) -1, const_zero = (npy_long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(npy_long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(npy_long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (npy_long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_long) 0; + case 1: __PYX_VERIFY_RETURN_INT(npy_long, digit, digits[0]) + case 2: + if (8 * sizeof(npy_long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) >= 2 * PyLong_SHIFT) { + return (npy_long) (((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(npy_long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) >= 3 * PyLong_SHIFT) { + return (npy_long) (((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(npy_long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) >= 4 * PyLong_SHIFT) { + return (npy_long) (((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (npy_long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(npy_long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (npy_long) 0; + case -1: __PYX_VERIFY_RETURN_INT(npy_long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(npy_long, digit, +digits[0]) + case -2: + if (8 * sizeof(npy_long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT) { + return (npy_long) (((npy_long)-1)*(((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(npy_long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT) { + return (npy_long) ((((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT) { + return (npy_long) (((npy_long)-1)*(((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(npy_long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT) { + return (npy_long) ((((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) - 1 > 4 * PyLong_SHIFT) { + return (npy_long) (((npy_long)-1)*(((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(npy_long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(npy_long) - 1 > 4 * PyLong_SHIFT) { + return (npy_long) ((((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(npy_long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(npy_long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + npy_long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (npy_long) -1; + } + } else { + npy_long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (npy_long) -1; + val = __Pyx_PyInt_As_npy_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to npy_long"); + return (npy_long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to npy_long"); + return (npy_long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntFromPy */ + static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) -1, const_zero = (char) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (char) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (char) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) + case -2: + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); + } + } + break; + } +#endif + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + char val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (char) -1; + } + } else { + char val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to char"); + return (char) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to char"); + return (char) -1; +} + +/* ObjectToMemviewSlice */ + static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int(PyObject *obj, int writable_flag) { + __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; + __Pyx_BufFmt_StackElem stack[1]; + int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; + int retcode; + if (obj == Py_None) { + result.memview = (struct __pyx_memoryview_obj *) Py_None; + return result; + } + retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, + PyBUF_RECORDS_RO | writable_flag, 1, + &__Pyx_TypeInfo_nn___pyx_t_10MDAnalysis_3lib_6nsgrid_ns_int, stack, + &result, obj); + if (unlikely(retcode == -1)) + goto __pyx_fail; + return result; +__pyx_fail: + result.memview = NULL; + result.data = NULL; + return result; +} + +/* CheckBinaryVersion */ + static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* ModuleImport */ + #ifndef __PYX_HAVE_RT_ImportModule +#define __PYX_HAVE_RT_ImportModule +static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; + PyObject *py_module = 0; + py_name = __Pyx_PyIdentifier_FromString(name); + if (!py_name) + goto bad; + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; +bad: + Py_XDECREF(py_name); + return 0; +} +#endif + +/* TypeImport */ + #ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +{ + PyObject *py_module = 0; + PyObject *result = 0; + PyObject *py_name = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + py_module = __Pyx_ImportModule(module_name); + if (!py_module) + goto bad; + py_name = __Pyx_PyIdentifier_FromString(class_name); + if (!py_name) + goto bad; + result = PyObject_GetAttr(py_module, py_name); + Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", + module_name, class_name, basicsize, size); + goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(py_module); + Py_XDECREF(result); + return NULL; +} +#endif + +/* InitStrings */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(x); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/package/MDAnalysis/lib/nsgrid.pyx b/package/MDAnalysis/lib/nsgrid.pyx new file mode 100644 index 00000000000..e3cdc608dca --- /dev/null +++ b/package/MDAnalysis/lib/nsgrid.pyx @@ -0,0 +1,999 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# +# MDAnalysis --- https://www.mdanalysis.org +# +# Copyright (C) 2013-2018 Sébastien Buchoux +# Copyright (c) 2018 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v3 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# + + +# cython: cdivision=True +# cython: boundscheck=False +# cython: initializedcheck=False +# cython: embedsignature=True + +""" +Neighbor search library --- :mod:`MDAnalysis.lib.nsgrid` +======================================================== + + +About the code +-------------- + +This Neighbor search library is a serialized Cython version greatly +inspired by the NS grid search implemented in +`GROMACS `_ . + +GROMACS 4.x code (more precisely +`nsgrid.c `_ +and `ns.c `_ ) +was used as reference to write this file. + +GROMACS 4.x code is released under the GNU Public Licence v2. + +About the algorithm +------------------- + +The neighbor search implemented here is based on +`cell lists `_ which allow +computation of pairs [#]_ with a cost of :math:`O(N)`, instead +of :math:`O(N^2)`. The basic algorithm is described in +Appendix F, Page 552 of +``Understanding Molecular Dynamics: From Algorithm to Applications`` by Frenkel and Smit. + +In brief, the algorithm divides the domain into smaller subdomains called `cells` +and distributes every particle to these cells based on their positions. Subsequently, +any distance based query first identifies the corresponding cell position in the +domain followed by distance evaluations within the identified cell and +neighboring cells only. Care must be taken to ensure that `cellsize` is +greater than the desired search distance, otherwise all of the neighbours might +not reflect in the results. + + +.. [#] a pair correspond to two particles that are considered as neighbors . + + +.. versionadded:: 0.19.0 +""" + +# Used to handle memory allocation +from cpython.mem cimport PyMem_Malloc, PyMem_Realloc, PyMem_Free +from libc.math cimport sqrt +import numpy as np +from libcpp.vector cimport vector +cimport numpy as np + +# Preprocessor DEFs +DEF DIM = 3 +DEF XX = 0 +DEF YY = 1 +DEF ZZ = 2 +DEF EPSILON = 1e-5 + +ctypedef np.int_t ns_int +ctypedef np.float32_t real +ctypedef real rvec[DIM] +ctypedef ns_int ivec[DIM] +ctypedef real matrix[DIM][DIM] + +ctypedef vector[ns_int] intvec +ctypedef vector[real] realvec + +# Useful Functions +cdef real rvec_norm2(const rvec a) nogil: + return a[XX]*a[XX] + a[YY]*a[YY] + a[ZZ]*a[ZZ] + +cdef void rvec_clear(rvec a) nogil: + a[XX] = 0.0 + a[YY] = 0.0 + a[ZZ] = 0.0 + +############################### +# Utility class to handle PBC # +############################### +cdef struct cPBCBox_t: + matrix box + rvec fbox_diag + rvec hbox_diag + rvec mhbox_diag + real max_cutoff2 + + +# Class to handle PBC calculations +cdef class PBCBox(object): + """ + Cython implementation of + `PBC-related `_ + operations. This class is used by classes :class:`FastNS` + and :class:`NSGrid` to put all particles inside a brick-shaped box + and to compute PBC-aware distance. The class can also handle + non-PBC aware distance evaluations through ``periodic`` argument. + + .. warning:: + This class is not meant to be used by end users. + + .. warning:: + Even if MD triclinic boxes can be handled by this class, + internal optimization is made based on the assumption that + particles are inside a brick-shaped box. When this is not + the case, calculated distances are not + warranted to be exact. + """ + + cdef cPBCBox_t c_pbcbox + cdef bint is_triclinic + cdef bint periodic + + def __init__(self, real[:, ::1] box, bint periodic): + """ + Parameters + ---------- + box : numpy.ndarray + box vectors of shape ``(3, 3)`` or + as returned by ``MDAnalysis.lib.mdamath.triclinic_vectors`` + ``dtype`` must be ``numpy.float32`` + periodic : boolean + ``True`` for PBC-aware calculations + ``False`` for non PBC aware calculations + """ + + self.periodic = periodic + self.update(box) + + cdef void fast_update(self, real[:, ::1] box) nogil: + """ + Updates the internal box parameters for + PBC-aware distance calculations. The internal + box parameters are used to define the brick-shaped + box which is eventually used for distance calculations. + + """ + cdef ns_int i, j + cdef real min_hv2, min_ss, tmp + + # Update matrix + self.is_triclinic = False + for i in range(DIM): + for j in range(DIM): + self.c_pbcbox.box[i][j] = box[i, j] + + if i != j: + if box[i, j] > EPSILON: + self.is_triclinic = True + + # Update diagonals + for i in range(DIM): + self.c_pbcbox.fbox_diag[i] = box[i, i] + self.c_pbcbox.hbox_diag[i] = self.c_pbcbox.fbox_diag[i] * 0.5 + self.c_pbcbox.mhbox_diag[i] = - self.c_pbcbox.hbox_diag[i] + + # Update maximum cutoff + + # Physical limitation of the cut-off + # by half the length of the shortest box vector. + min_hv2 = min(0.25 * rvec_norm2(&box[XX, XX]), 0.25 * rvec_norm2(&box[YY, XX])) + min_hv2 = min(min_hv2, 0.25 * rvec_norm2(&box[ZZ, XX])) + + # Limitation to the smallest diagonal element due to optimizations: + # checking only linear combinations of single box-vectors (2 in x) + # in the grid search and pbc_dx is a lot faster + # than checking all possible combinations. + tmp = box[YY, YY] + if box[ZZ, YY] < 0: + tmp -= box[ZZ, YY] + else: + tmp += box[ZZ, YY] + + min_ss = min(box[XX, XX], min(tmp, box[ZZ, ZZ])) + self.c_pbcbox.max_cutoff2 = min(min_hv2, min_ss * min_ss) + + def update(self, real[:, ::1] box): + """ + Updates internal MD box representation and parameters used for calculations. + + Parameters + ---------- + box : numpy.ndarray + Describes the MD box vectors as returned by + :func:`MDAnalysis.lib.mdamath.triclinic_vectors`. + `dtype` must be :class:`numpy.float32` + + Note + ---- + Call to this method is only needed when the MD box is changed + as it always called when class is instantiated. + + """ + + if box.shape[0] != DIM or box.shape[1] != DIM: + raise ValueError("Box must be a {} x {} matrix. Got: {} x {})".format( + DIM, DIM, box.shape[0], box.shape[1])) + if (box[XX, XX] == 0) or (box[YY, YY] == 0) or (box[ZZ, ZZ] == 0): + raise ValueError("Box does not correspond to PBC=xyz") + self.fast_update(box) + + cdef void fast_pbc_dx(self, rvec ref, rvec other, rvec dx) nogil: + """Dislacement between two points for both + PBC and non-PBC conditions + + Modifies the displacement vector between two points based + on the minimum image convention for PBC aware calculations. + + For non-PBC aware distance evaluations, calculates the + displacement vector without any modifications + """ + + cdef ns_int i, j + + for i in range(DIM): + dx[i] = other[i] - ref[i] + + if self.periodic: + for i in range(DIM-1, -1, -1): + while dx[i] > self.c_pbcbox.hbox_diag[i]: + for j in range(i, -1, -1): + dx[j] -= self.c_pbcbox.box[i][j] + + while dx[i] <= self.c_pbcbox.mhbox_diag[i]: + for j in range(i, -1, -1): + dx[j] += self.c_pbcbox.box[i][j] + + cdef real fast_distance2(self, rvec a, rvec b) nogil: + """Distance calculation between two points + for both PBC and non-PBC aware calculations + + Returns the distance obeying minimum + image convention if periodic is set to ``True`` while + instantiating the ``PBCBox`` object. + """ + + cdef rvec dx + self.fast_pbc_dx(a, b, dx) + return rvec_norm2(dx) + + cdef real[:, ::1]fast_put_atoms_in_bbox(self, real[:, ::1] coords) nogil: + """Shifts all ``coords`` to an orthogonal brick shaped box + + All the coordinates are brought into an orthogonal + box. The box vectors for the brick-shaped box + are defined in ``fast_update`` method. + + """ + + cdef ns_int i, m, d, natoms + cdef real[:, ::1] bbox_coords + + natoms = coords.shape[0] + with gil: + bbox_coords = coords.copy() + + if self.periodic: + if self.is_triclinic: + for i in range(natoms): + for m in range(DIM - 1, -1, -1): + while bbox_coords[i, m] < 0: + for d in range(m+1): + bbox_coords[i, d] += self.c_pbcbox.box[m][d] + while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + for d in range(m+1): + bbox_coords[i, d] -= self.c_pbcbox.box[m][d] + else: + for i in range(natoms): + for m in range(DIM): + while bbox_coords[i, m] < 0: + bbox_coords[i, m] += self.c_pbcbox.box[m][m] + while bbox_coords[i, m] >= self.c_pbcbox.box[m][m]: + bbox_coords[i, m] -= self.c_pbcbox.box[m][m] + + return bbox_coords + +######################### +# Neighbor Search Stuff # +######################### + +cdef class NSResults(object): + """Class to store the results + + All the required outputs from :class:`FastNS` is stored in the + instance of this class. All the methods of :class:`FastNS` returns + an instance of this class, which can be used to generate the desired + results on demand. + """ + + cdef readonly real cutoff + cdef ns_int npairs + + cdef real[:, ::1] coords # shape: size, DIM + cdef real[:, ::1] searchcoords + + cdef vector[intvec] indices_buffer + cdef vector[realvec] distances_buffer + cdef vector[ns_int] pairs_buffer + cdef vector[real] pair_distances_buffer + cdef vector[real] pair_distances2_buffer + + def __init__(self, real cutoff, real[:, ::1]coords, real[:, ::1]searchcoords): + """ + Parameters + ---------- + cutoff : float + Specified cutoff distance + coords : numpy.ndarray + Array with coordinates of atoms of shape ``(N, 3)`` for + ``N`` particles. ``dtype`` must be ``numpy.float32`` + searchcoords : numpy.ndarray + Array with query coordinates. Shape must be ``(M, 3)`` + for ``M`` queries. ``dtype`` must be ``numpy.float32`` + """ + + self.cutoff = cutoff + self.coords = coords + self.searchcoords = searchcoords + + self.npairs = 0 + + cdef void add_neighbors(self, ns_int beadid_i, ns_int beadid_j, real distance2) nogil: + """Internal function to add pairs and distances to buffers + + The buffers populated using this method are used by + other methods of this class. This is the + primary function used by :class:`FastNS` to save all + the pair of atoms, + which are considered as neighbors. + """ + + self.pairs_buffer.push_back(beadid_i) + self.pairs_buffer.push_back(beadid_j) + self.pair_distances2_buffer.push_back(distance2) + self.npairs += 1 + + def get_pairs(self): + """Returns all the pairs within the desired cutoff distance + + Returns an array of shape ``(N, 2)``, where N is the number of pairs + between ``reference`` and ``configuration`` within the specified distance. + For every pair ``(i, j)``, ``reference[i]`` and ``configuration[j]`` are + atom positions such that ``reference`` is the position of query + atoms while ``configuration`` coontains the position of group of + atoms used to search against the query atoms. + + Returns + ------- + pairs : numpy.ndarray + pairs of atom indices of neighbors from query + and initial atom coordinates of shape ``(N, 2)`` + """ + + return np.asarray(self.pairs_buffer, dtype=np.int64).reshape(self.npairs, 2) + + def get_pair_distances(self): + """Returns all the distances corresponding to each pair of neighbors + + Returns an array of shape ``N`` where N is the number of pairs + among the query atoms and initial atoms within a specified distance. + Every element ``[i]`` corresponds to the distance between + ``pairs[i, 0]`` and ``pairs[i, 1]``, where pairs is the array + obtained from ``get_pairs()`` + + Returns + ------- + distances : numpy.ndarray + distances between pairs of query and initial + atom coordinates of shape ``N`` + + See Also + -------- + MDAnalysis.lib.nsgrid.NSResults.get_pairs + + """ + + self.pair_distances_buffer = np.sqrt(self.pair_distances2_buffer) + return np.asarray(self.pair_distances_buffer) + + cdef void create_buffers(self) nogil: + """ + Creates buffers to get individual neighbour list and distances + of the query atoms. + + """ + + cdef ns_int i, beadid_i, beadid_j + cdef ns_int idx, nsearch + cdef real dist2, dist + + nsearch = self.searchcoords.shape[0] + + self.indices_buffer = vector[intvec]() + self.distances_buffer = vector[realvec]() + + # initialize rows corresponding to search + for i in range(nsearch): + self.indices_buffer.push_back(intvec()) + self.distances_buffer.push_back(realvec()) + + for i in range(0, 2*self.npairs, 2): + beadid_i = self.pairs_buffer[i] + beadid_j = self.pairs_buffer[i + 1] + + dist2 = self.pair_distances2_buffer[i//2] + + self.indices_buffer[beadid_i].push_back(beadid_j) + + dist = sqrt(dist2) + + self.distances_buffer[beadid_i].push_back(dist) + + def get_indices(self): + """Individual neighbours of query atom + + For every queried atom ``i``, an array of all its neighbors + indices can be obtained from ``get_indices()[i]`` + + Returns + ------- + indices : list + Indices of neighboring atoms. + Every element i.e. ``indices[i]`` will be a list of + size ``m`` where m is the number of neighbours of + query atom[i]. + + .. code-block:: python + + results = NSResults() + indices = results.get_indices() + + ``indices[i]`` will output a list of neighboring + atoms of ``atom[i]`` from query atoms ``atom``. + ``indices[i][j]`` will give the atom-id of initial coordinates + such that ``initial_atom[indices[i][j]]`` is a neighbor of ``atom[i]`` + + """ + + if self.indices_buffer.empty(): + self.create_buffers() + return list(self.indices_buffer) + + def get_distances(self): + """Distance corresponding to individual neighbors of query atom + + For every queried atom ``i``, a list of all the distances + from its neighboring atoms can be obtained from ``get_distances()[i]``. + Every ``distance[i][j]`` will correspond + to the distance between atoms ``atom[i]`` from the query + atoms and ``atom[indices[j]]`` from the initialized + set of coordinates, where ``indices`` can be obtained + by ``get_indices()`` + + Returns + ------- + distances : np.ndarray + Every element i.e. ``distances[i]`` will be an array of + shape ``m`` where m is the number of neighbours of + query atom[i]. + + .. code-block:: python + + results = NSResults() + distances = results.get_distances() + + + atoms of ``atom[i]`` and query atoms ``atom``. + ``indices[i][j]`` will give the atom-id of initial coordinates + such that ``initial_atom[indices[i][j]]`` is a neighbor of ``atom[i]`` + + See Also + -------- + MDAnalysis.lib.nsgrid.NSResults.get_indices + + """ + + if self.distances_buffer.empty(): + self.create_buffers() + return list(self.distances_buffer) + +cdef class NSGrid(object): + """Constructs a uniform cuboidal grid for a brick-shaped box + + This class uses :class:`PBCBox` to define the brick shaped box + It is essential to initialize the box with :class:`PBCBox` + inorder to form the grid. + + The domain is subdivided into number of cells based on the desired search + radius. Ideally cellsize should be equal to the search radius, but small + search radius leads to large cell-list data strucutres. + An optimization of cutoff is imposed to limit the size of data + structure such that the cellsize is always greater than or + equal to cutoff distance. + + Note + ---- + This class assumes that all the coordinates are already + inside the brick shaped box. Care must be taken to ensure + all the particles are within the brick shaped box as + defined by :class:`PBCBox`. This can be ensured by using + :func:`~MDAnalysis.lib.nsgrid.PBCBox.fast_put_atoms_in_bbox` + + .. warning:: + This class is not meant to be used by end users. + + """ + + cdef readonly real cutoff # cutoff + cdef ns_int size # total cells + cdef ns_int ncoords # number of coordinates + cdef ns_int[DIM] ncells # individual cells in every dimension + cdef ns_int[DIM] cell_offsets # Cell Multipliers + cdef real[DIM] cellsize # cell size in every dimension + cdef ns_int nbeads_per_cell # maximum beads + cdef ns_int *nbeads # size (Number of beads in every cell) + cdef ns_int *beadids # size * nbeads_per_cell (Beadids in every cell) + cdef ns_int *cellids # ncoords (Cell occupation id for every atom) + cdef bint force # To negate the effects of optimized cutoff + + def __init__(self, ncoords, cutoff, PBCBox box, max_size, force=False): + """ + Parameters + ---------- + ncoords : int + Number of coordinates to fill inside the brick shaped box + cutoff : float + Desired cutoff radius + box : PBCBox + Instance of :class:`PBCBox` + max_size : int + Maximum total number of cells + force : boolean + Optimizes cutoff if set to ``False`` [False] + """ + + cdef ns_int i + cdef ns_int ncellx, ncelly, ncellz, size, nbeadspercell + cdef ns_int xi, yi, zi + cdef real bbox_vol + + self.ncoords = ncoords + + # Calculate best cutoff + self.cutoff = cutoff + if not force: + bbox_vol = box.c_pbcbox.box[XX][XX] * box.c_pbcbox.box[YY][YY] * box.c_pbcbox.box[YY][YY] + size = bbox_vol/cutoff**3 + nbeadspercell = ncoords/size + while bbox_vol/self.cutoff**3 > max_size: + self.cutoff *= 1.2 + + for i in range(DIM): + self.ncells[i] = (box.c_pbcbox.box[i][i] / self.cutoff) + self.cellsize[i] = box.c_pbcbox.box[i][i] / self.ncells[i] + self.size = self.ncells[XX] * self.ncells[YY] * self.ncells[ZZ] + + self.cell_offsets[XX] = 0 + self.cell_offsets[YY] = self.ncells[XX] + self.cell_offsets[ZZ] = self.ncells[XX] * self.ncells[YY] + + # Allocate memory + # Number of beads in every cell + self.nbeads = PyMem_Malloc(sizeof(ns_int) * self.size) + if not self.nbeads: + raise MemoryError("Could not allocate memory from NSGrid.nbeads ({} bits requested)".format(sizeof(ns_int) * self.size)) + self.beadids = NULL + # Cellindex of every bead + self.cellids = PyMem_Malloc(sizeof(ns_int) * self.ncoords) + if not self.cellids: + raise MemoryError("Could not allocate memory from NSGrid.cellids ({} bits requested)".format(sizeof(ns_int) * self.ncoords)) + self.nbeads_per_cell = 0 + + for i in range(self.size): + self.nbeads[i] = 0 + + def __dealloc__(self): + PyMem_Free(self.nbeads) + PyMem_Free(self.beadids) + PyMem_Free(self.cellids) + + cdef ns_int coord2cellid(self, rvec coord) nogil: + """Finds the cell-id for the given coordinate inside the brick shaped box + + Note + ---- + Assumes the coordinate is already inside the brick shaped box. + Return wrong cell-id if this is not the case + """ + return (coord[ZZ] / self.cellsize[ZZ]) * (self.cell_offsets[ZZ]) +\ + (coord[YY] / self.cellsize[YY]) * self.cell_offsets[YY] + \ + (coord[XX] / self.cellsize[XX]) + + cdef bint cellid2cellxyz(self, ns_int cellid, ivec cellxyz) nogil: + """Finds actual cell position `(x, y, z)` from a cell-id + """ + + if cellid < 0: + return False + if cellid >= self.size: + return False + + cellxyz[ZZ] = (cellid / self.cell_offsets[ZZ]) + cellid -= cellxyz[ZZ] * self.cell_offsets[ZZ] + + cellxyz[YY] = (cellid / self.cell_offsets[YY]) + cellxyz[XX] = cellid - cellxyz[YY] * self.cell_offsets[YY] + + return True + + cdef fill_grid(self, real[:, ::1] coords): + """Sorts atoms into cells based on their position in the brick shaped box + + Every atom inside the brick shaped box is assigned a + cell-id based on its position. Another list ``beadids`` + sort the atom-ids in each cell. + + Note + ---- + The method fails if any coordinate is outside the brick shaped box. + + """ + + cdef ns_int i, cellindex = -1 + cdef ns_int ncoords = coords.shape[0] + cdef ns_int[:] beadcounts = np.empty(self.size, dtype=np.int) + + with nogil: + # Initialize buffers + for i in range(self.size): + beadcounts[i] = 0 + + # First loop: find cellindex for each bead + for i in range(ncoords): + cellindex = self.coord2cellid(&coords[i, 0]) + + self.nbeads[cellindex] += 1 + self.cellids[i] = cellindex + + if self.nbeads[cellindex] > self.nbeads_per_cell: + self.nbeads_per_cell = self.nbeads[cellindex] + + # Allocate memory + self.beadids = PyMem_Malloc(sizeof(ns_int) * self.size * self.nbeads_per_cell) # np.empty((self.size, nbeads_max), dtype=np.int) + if not self.beadids: + raise MemoryError("Could not allocate memory for NSGrid.beadids ({} bits requested)".format(sizeof(ns_int) * self.size * self.nbeads_per_cell)) + + with nogil: + # Second loop: fill grid + for i in range(ncoords): + + # Add bead to grid cell + cellindex = self.cellids[i] + self.beadids[cellindex * self.nbeads_per_cell + beadcounts[cellindex]] = i + beadcounts[cellindex] += 1 + + +cdef class FastNS(object): + """Grid based search between two group of atoms + + Instantiates a class object which uses :class:`PBCBox` and + :class:`NSGrid` to construct a cuboidal + grid in an orthogonal brick shaped box. + + Minimum image convention is used for distance evaluations + if pbc is set to ``True``. + """ + cdef PBCBox box + cdef real[:, ::1] coords + cdef real[:, ::1] coords_bbox + cdef readonly real cutoff + cdef NSGrid grid + cdef ns_int max_gridsize + cdef bint periodic + + def __init__(self, cutoff, coords, box, max_gridsize=5000, pbc=True): + """ + Initialize the grid and sort the coordinates in respective + cells by shifting the coordinates in a brick shaped box. + The brick shaped box is defined by :class:`PBCBox` + and cuboidal grid is initialize by :class:`NSGrid`. + If box is supplied, periodic shifts along box vectors are used + to contain all the coordinates inside the brick shaped box. + If box is not supplied, the range of coordinates i.e. + ``[xmax, ymax, zmax] - [xmin, ymin, zmin]`` should be used + to construct a pseudo box. Subsequently, the origin should also be + shifted to ``[xmin, ymin, zmin]``. These arguments must be provided + to the function. + + Parameters + ---------- + cutoff : float + Desired cutoff distance + coords : numpy.ndarray + atom coordinates of shape ``(N, 3)`` for ``N`` atoms. + ``dtype=numpy.float32``. For Non-PBC calculations, + all the coords must be within the bounding box specified + by ``box`` + box : numpy.ndarray + Box dimension of shape (6, ). The dimensions must be + provided in the same format as returned + by :attr:`MDAnalysis.coordinates.base.Timestep.dimensions`: + ``[lx, ly, lz, alpha, beta, gamma]``. For non-PBC + evaluations, provide an orthogonal bounding box + (dtype = numpy.float32) + max_gridsize : int + maximum number of cells in the grid. This parameter + can be tuned for superior performance. + pbc : boolean + Handle to switch periodic boundary conditions on/off [True] + + Note + ---- + * ``pbc=False`` Only works for orthogonal boxes. + * Care must be taken such that all particles are inside + the bounding box as defined by the box argument for non-PBC + calculations. + * In case of Non-PBC calculations, a bounding box must be provided + to encompass all the coordinates as well as the search coordinates. + The dimension should be similar to ``box`` argument but for + an orthogonal box. For instance, one valid set of argument + for ``box`` for the case of no PBC could be + ``[10, 10, 10, 90, 90, 90]`` + * Following operations are advisable for non-PBC calculations + + ..code-block:: python + + lmax = all_coords.max(axis=0) + lmin = all_coords.min(axis=0) + pseudobox[:3] = 1.1*(lmax - lmin) + pseudobox[3:] = 90. + shift = all_coords.copy() + shift -= lmin + gridsearch = FastNS(max_cutoff, shift, box=pseudobox, pbc=False) + + """ + + from MDAnalysis.lib.mdamath import triclinic_vectors + + if (coords.ndim != 2 or coords.shape[1] != 3): + raise ValueError("coords must have a shape of (n, 3), got {}." + "".format(coords.shape)) + + if np.allclose(box[:3], 0.0): + raise ValueError("Any of the box dimensions cannot be 0") + + self.periodic = pbc + self.coords = coords.astype(np.float32, order='C', copy=True) + + if box.shape != (3, 3): + box = triclinic_vectors(box) + + self.box = PBCBox(box, self.periodic) + + if cutoff < 0: + raise ValueError("Cutoff must be positive!") + if cutoff * cutoff > self.box.c_pbcbox.max_cutoff2: + raise ValueError("Cutoff greater than maximum cutoff ({:.3f}) given the PBC") + + self.coords_bbox = self.box.fast_put_atoms_in_bbox(self.coords) + + self.cutoff = cutoff + self.max_gridsize = max_gridsize + # Note that self.cutoff might be different from self.grid.cutoff + # due to optimization + self.grid = NSGrid(self.coords_bbox.shape[0], self.cutoff, self.box, self.max_gridsize) + + self.grid.fill_grid(self.coords_bbox) + + def search(self, search_coords): + """Search a group of atoms against initialized coordinates + + Creates a new grid with the query atoms and searches + against the initialized coordinates. The search is exclusive + i.e. only the pairs ``(i, j)`` such that ``atom[i]`` from query atoms + and ``atom[j]`` from the initialized set of coordinates is stored as + neighbors. + + PBC-aware/non PBC-aware calculations are automatically enabled during + the instantiation of :class:FastNS. + + Parameters + ---------- + search_coords : numpy.ndarray + Query coordinates of shape ``(N, 3)`` where + ``N`` is the number of queries + + Returns + ------- + results : NSResults object + The object from :class:NSResults + contains ``get_indices``, ``get_distances``. + ``get_pairs``, ``get_pair_distances`` + + Note + ---- + For non-PBC aware calculations, the current implementation doesn't work + if any of the query coordinates is beyond the range specified in + ``box`` in :func:`MDAnalysis.lib.nsgrid.FastNS`. + + See Also + -------- + MDAnalysis.lib.nsgrid.NSResults + + """ + + cdef ns_int i, j, size_search + cdef ns_int d, m + cdef ns_int current_beadid, bid + cdef ns_int cellindex, cellindex_probe + cdef ns_int xi, yi, zi + + cdef NSResults results + + cdef real d2 + cdef rvec probe + + cdef real[:, ::1] searchcoords + cdef real[:, ::1] searchcoords_bbox + cdef NSGrid searchgrid + cdef bint check + + cdef real cutoff2 = self.cutoff * self.cutoff + cdef ns_int npairs = 0 + + if (search_coords.ndim != 2 or search_coords.shape[1] != 3): + raise ValueError("search_coords must have a shape of (n, 3), got " + "{}.".format(search_coords.shape)) + + # Generate another grid to search + searchcoords = search_coords.astype(np.float32, order='C', copy=False) + searchcoords_bbox = self.box.fast_put_atoms_in_bbox(searchcoords) + searchgrid = NSGrid(searchcoords_bbox.shape[0], self.grid.cutoff, self.box, self.max_gridsize, force=True) + searchgrid.fill_grid(searchcoords_bbox) + + size_search = searchcoords.shape[0] + + results = NSResults(self.cutoff, self.coords, searchcoords) + + with nogil: + for i in range(size_search): + # Start with first search coordinate + current_beadid = i + # find the cellindex of the coordinate + cellindex = searchgrid.cellids[current_beadid] + for xi in range(DIM): + for yi in range(DIM): + for zi in range(DIM): + check = True + #Probe the search coordinates in a brick shaped box + probe[XX] = searchcoords_bbox[current_beadid, XX] + (xi - 1) * searchgrid.cellsize[XX] + probe[YY] = searchcoords_bbox[current_beadid, YY] + (yi - 1) * searchgrid.cellsize[YY] + probe[ZZ] = searchcoords_bbox[current_beadid, ZZ] + (zi - 1) * searchgrid.cellsize[ZZ] + # Make sure the probe coordinates is inside the brick-shaped box + if self.periodic: + for m in range(DIM - 1, -1, -1): + while probe[m] < 0: + for d in range(m+1): + probe[d] += self.box.c_pbcbox.box[m][d] + while probe[m] >= self.box.c_pbcbox.box[m][m]: + for d in range(m+1): + probe[d] -= self.box.c_pbcbox.box[m][d] + else: + for m in range(DIM -1, -1, -1): + if probe[m] < 0: + check = False + break + if probe[m] > self.box.c_pbcbox.box[m][m]: + check = False + break + if not check: + continue + # Get the cell index corresponding to the probe + cellindex_probe = self.grid.coord2cellid(probe) + # for this cellindex search in grid + for j in range(self.grid.nbeads[cellindex_probe]): + bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + # find distance between search coords[i] and coords[bid] + d2 = self.box.fast_distance2(&searchcoords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + if d2 < cutoff2: + results.add_neighbors(current_beadid, bid, d2) + npairs += 1 + return results + + def self_search(self): + """Searches all the pairs within the initialized coordinates + + All the pairs among the initialized coordinates are registered + in hald the time. Although the algorithm is still the same, but + the distance checks can be reduced to half in this particular case + as every pair need not be evaluated twice. + + Returns + ------- + results : NSResults object + The object from :class:NSResults + contains ``get_indices``, ``get_distances``. + ``get_pairs``, ``get_pair_distances`` + + See Also + -------- + MDAnalysis.lib.nsgrid.NSResults + + """ + + cdef ns_int i, j, size_search + cdef ns_int d, m + cdef ns_int current_beadid, bid + cdef ns_int cellindex, cellindex_probe + cdef ns_int xi, yi, zi + + cdef NSResults results + cdef real d2 + cdef rvec probe + + cdef real cutoff2 = self.cutoff * self.cutoff + cdef ns_int npairs = 0 + cdef bint check + + size_search = self.coords.shape[0] + + results = NSResults(self.cutoff, self.coords, self.coords) + + with nogil: + for i in range(size_search): + # Start with first search coordinate + current_beadid = i + # find the cellindex of the coordinate + cellindex = self.grid.cellids[current_beadid] + for xi in range(DIM): + for yi in range(DIM): + for zi in range(DIM): + check = True + # Calculate and/or reinitialize shifted coordinates + # Probe the search coordinates in a brick shaped box + probe[XX] = self.coords_bbox[current_beadid, XX] + (xi - 1) * self.grid.cellsize[XX] + probe[YY] = self.coords_bbox[current_beadid, YY] + (yi - 1) * self.grid.cellsize[YY] + probe[ZZ] = self.coords_bbox[current_beadid, ZZ] + (zi - 1) * self.grid.cellsize[ZZ] + # Make sure the shifted coordinates is inside the brick-shaped box + if self.periodic: + for m in range(DIM - 1, -1, -1): + while probe[m] < 0: + for d in range(m+1): + probe[d] += self.box.c_pbcbox.box[m][d] + while probe[m] >= self.box.c_pbcbox.box[m][m]: + for d in range(m+1): + probe[d] -= self.box.c_pbcbox.box[m][d] + else: + for m in range(DIM -1, -1, -1): + if probe[m] < 0: + check = False + break + elif probe[m] >= self.box.c_pbcbox.box[m][m]: + check = False + break + if not check: + continue + # Get the cell index corresponding to the probe + cellindex_probe = self.grid.coord2cellid(probe) + # for this cellindex search in grid + for j in range(self.grid.nbeads[cellindex_probe]): + bid = self.grid.beadids[cellindex_probe * self.grid.nbeads_per_cell + j] + if bid < current_beadid: + continue + # find distance between search coords[i] and coords[bid] + d2 = self.box.fast_distance2(&self.coords_bbox[current_beadid, XX], &self.coords_bbox[bid, XX]) + if d2 < cutoff2 and d2 > EPSILON: + results.add_neighbors(current_beadid, bid, d2) + results.add_neighbors(bid, current_beadid, d2) + npairs += 2 + return results diff --git a/package/MDAnalysis/lib/pkdtree.py b/package/MDAnalysis/lib/pkdtree.py index 8baa07067fa..087bd1d88cd 100644 --- a/package/MDAnalysis/lib/pkdtree.py +++ b/package/MDAnalysis/lib/pkdtree.py @@ -28,40 +28,41 @@ """ from __future__ import absolute_import -from six.moves import range import itertools import numpy as np -from Bio.KDTree import _CKDTree +from scipy.spatial import cKDTree -from MDAnalysis.lib.distances import _box_check, _check_array, apply_PBC -from MDAnalysis.lib.mdamath import norm, triclinic_vectors, triclinic_box +from ._cutil import unique_int_1d +from ._augment import augment_coordinates, undo_augment +from .util import unique_rows + +from MDAnalysis.lib.distances import apply_PBC __all__ = [ - 'PeriodicKDTree', + 'PeriodicKDTree' ] class PeriodicKDTree(object): - """ - Wrapper around Bio.KDTree._CKDTree to enable search with periodic boundary - conditions. - - A tree is first constructed with the coordinates wrapped onto the central - cell. A query for neighbors around a center point is performed first by - wrapping the center point coordinates to the central cell, then generating - images of this wrapped center point (thanks to - https://github.com/patvarilly/periodic_kdtree for the idea) and finally - searching for neighbors close to the images. - - Only the necessary number of center point images is generated for each - case. For instance, if the wrapped center point lies well within the cell - and far away from the cell boundaries, there may be no need to generate - any center point image. - """ + """Wrapper around scipy.spatial.cKDtree - def __init__(self, box, bucket_size=10): + Creates an object which can handle periodic as well as + non periodic boundary condtions depending on the parameters + provided while constructing the tree. + + To enable periodic boundary conditions, box dimensions must be + provided. Periodic Boundary conditions are implemented by creating + duplicates of the particles which are within the specified cutoff + distance from the boundary. These duplicates along with the + original particle coordinates are used with the cKDTree + without any special treatment due to PBC beyond this point. + The final results after any operation with duplicate particle indices + can be traced back to the original particle using undo augment function. + """ + def __init__(self, box=None, leafsize=10): """ + Parameters ---------- box : array-like or ``None``, optional, default ``None`` @@ -69,158 +70,129 @@ def __init__(self, box, bucket_size=10): :attr:`MDAnalysis.trajectory.base.Timestep.dimensions` when periodic boundary conditions should be taken into account for the calculation of contacts. - bucket_size : int + leafsize : int (optional) Number of entries in leafs of the KDTree. If you suffer poor performance you can play around with this number. Increasing the - `bucket_size` will speed up the construction of the KDTree but + `leafsize` will speed up the construction of the KDTree but slow down the search. - """ - self.dim = 3 # 3D systems - self.box = None - self._dm = None # matrix of central-cell vectors - self._rm = None # matrix of normalized reciprocal vectors - self.initialize_bm(box) - self.kdt = _CKDTree.KDTree(self.dim, bucket_size) - self._indices = list() - - def initialize_bm(self, box): - """ - Store box information and define direct and reciprocal box matrices. - Rows of the direct matrix are the components of the central cell - vectors. Rows of the reciprocal matrix are the components of the - normalized reciprocal lattice vectors. Each row of the reciprocal - matrix represents the vector normal to the unit cell face - associated to each axis. - For instance, in an orthorhombic cell the YZ-plane is associated to - the X-axis and its normal vector is (1, 0, 0). In a triclinic cell, - the plane associated to vector ``\vec{a}`` is perpendicular to the - normalized cross product of ``\vec{b}`` and ``\vec{c}``. - Parameters - ---------- - box : array-like or ``None``, optional, default ``None`` - Simulation cell dimensions in the form of - :attr:`MDAnalysis.trajectory.base.Timestep.dimensions` when - periodic boundary conditions should be taken into account for - the calculation of contacts. """ - box_type = _box_check(box) - if box_type == 'ortho': - a, b, c = box[:3] - dm = np.array([[a, 0, 0], [0, b, 0], [0, 0, c]], dtype=np.float32) - rm = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=np.float32) - elif box_type in 'tri_box tri_vecs tri_vecs_bad': - if box_type == 'tri_box': - dm = triclinic_vectors(box) - elif box_type == 'tri_vecs': - dm = box.copy('C') - else: # case 'tri_vecs_bad' - dm = triclinic_vectors(triclinic_box(box[0], box[1], box[2])) - rm = np.zeros(9, dtype=np.float32).reshape(3, 3) - rm[0] = np.cross(dm[1], dm[2]) - rm[1] = np.cross(dm[2], dm[0]) - rm[2] = np.cross(dm[0], dm[1]) - for i in range(self.dim): - rm[i] /= norm(rm[i]) # normalize - else: - raise ValueError('Failed to initialize direct/reciprocal matrices') + self.leafsize = leafsize + self.dim = 3 # 3D systems self.box = box - self._dm = dm - self._rm = rm + self._built = False + self.cutoff = None - def set_coords(self, coords): - """ - Add coordinates of the points. Wrapping of coordinates to the central - cell is enforced along the periodic axes. + @property + def pbc(self): + return self.box is not None + + def set_coords(self, coords, cutoff=None): + """Constructs KDTree from the coordinates + + Wrapping of coordinates to the primary unit cell is enforced + before any distance evaluations. If periodic boundary conditions + are enabled, then duplicate particles are generated in the + vicinity of the box. An additional array `mapping` is also + generated which can be later used to trace the origin of + duplicate particle coordinates. + + For non-periodic calculations, cutoff should not be provided + the parameter is only required for periodic calculations. Parameters ---------- coords: array_like - Positions of points, shape=(N, 3) for N atoms. - """ - _check_array(np.asanyarray(coords), 'coords') - wrapped_data = apply_PBC(coords, self.box) - self.kdt.set_data(wrapped_data) - self.built = 1 + Coordinate array of shape ``(N, 3)`` for N atoms. + cutoff: float + Specified cutoff distance to create duplicate images + Typically equivalent to the desired search radius + or the maximum of the desired cutoff radius. Relevant images + corresponding to every atom which lies + within ``cutoff`` distance from either of the box boundary + will be generated. - def find_images(self, center_points, radius): - """ - Find relevant images of a a set of center points, inspired by - https://github.com/patvarilly/periodic_kdtree - Parameters - ---------- - center_points: array_like (N,3) - Coordinates of the query center points. Must be in centrall cell. - radius: float - Maximum distance from center in search for neighbors + See Also + -------- + MDAnalysis.lib._augment.augment_coordinates - Returns - ------ - :class:`List` - images of the center points close to any cell boundary plane """ - images = list() - - center_points = np.asanyarray(center_points) - if center_points.shape == (3, ): - center_points = center_points.reshape((1, 3)) - - # Calculating displacement vectors for images of `center_point` - # possible point for parallel loop version (Benchmark before!) - for center_point in center_points: - # distances to cell boundary planes passing through the origin - distances = np.dot(self._rm, center_point) - displacements = list(self._dm[np.where(distances < radius)[0]]) - # distances to the remaining three cell boundary planes - distances = np.einsum('ij,ij->i', self._rm, - self._dm - center_point) - displacements.extend( - list(-self._dm[np.where(distances < radius)[0]])) - # If we have displacements along more than one axis, we have - # to combine them. This happens when center_point is close - # to any edge or vertex of the central cell. - # face case: n_displacements==1; no combination - # edge case: n_displacements==2; one extra displacement - # vertex case: n_displacements==3; five extra displacements - n_displacements = len(displacements) - if n_displacements > 1: - for start in range(n_displacements - 1, -1, -1): - for i in range(start+1, len(displacements)): - displacements.append(displacements[start]+displacements[i]) - images.extend([center_point + d for d in displacements]) - return images + # If no cutoff distance is provided but PBC aware + if self.pbc and (cutoff is None): + raise RuntimeError('Provide a cutoff distance' + ' with tree.set_coords(...)') + + # set coords dtype to float32 + # augment coordinates will work only with float32 + coords = np.asarray(coords, dtype=np.float32) + + if self.pbc: + self.cutoff = cutoff + # Bring the coordinates in the central cell + self.coords = apply_PBC(coords, self.box) + # generate duplicate images + self.aug, self.mapping = augment_coordinates(self.coords, + self.box, + self.cutoff) + # Images + coords + self.all_coords = np.concatenate([self.coords, self.aug]) + self.ckdt = cKDTree(self.all_coords, leafsize=self.leafsize) + else: + # if cutoff distance is provided for non PBC calculations + if cutoff is not None: + raise RuntimeError('Donot provide cutoff distance for' + ' non PBC aware calculations') + self.coords = coords + self.ckdt = cKDTree(self.coords, self.leafsize) + self._built = True def search(self, centers, radius): - """Search all points within radius of centers and its periodic images. - Wrapping of center coordinates is enforced to enable comparison to - wrapped coordinates of points in the tree. + """Search all points within radius from centers and their periodic images. + + All the centers coordinates are wrapped around the central cell + to enable distance evaluations from points in the tree + and their images. Parameter --------- centers: array_like (N,3) - origins around which to search for neighbors + coordinate array to search for neighbors radius: float - maximum distance around which to search for neighbors. The search - radius is half the smallest periodicity if radius exceeds this value + maximum distance to search for neighbors. """ - if not self.built: - raise RuntimeError('Unbuilt tree. Run tree.set_coords(...) first') + + if not self._built: + raise RuntimeError('Unbuilt tree. Run tree.set_coords(...)') + centers = np.asarray(centers) if centers.shape == (self.dim, ): centers = centers.reshape((1, self.dim)) - wrapped_centers = apply_PBC(centers, self.box) - self._indices = set() # clear previous search - # possible loop for parallel execution (benchmark before!) - for c in itertools.chain(wrapped_centers, - self.find_images(wrapped_centers, radius)): - self.kdt.search_center_radius(c, radius) - n = self.kdt.get_count() - if n: - new_indices = np.empty(n, int) - self.kdt.get_indices(new_indices) - self._indices.update(new_indices) - self._indices = sorted(list(self._indices)) + + # Sanity check + if self.pbc: + if self.cutoff < radius: + raise RuntimeError('Set cutoff greater or equal to the radius.') + # Bring all query points to the central cell + wrapped_centers = apply_PBC(centers, self.box) + indices = list(self.ckdt.query_ball_point(wrapped_centers, + radius)) + self._indices = np.array(list( + itertools.chain.from_iterable(indices)), + dtype=np.int64) + if self._indices.size > 0: + self._indices = undo_augment(self._indices, + self.mapping, + len(self.coords)) + else: + wrapped_centers = np.asarray(centers) + indices = list(self.ckdt.query_ball_point(wrapped_centers, + radius)) + self._indices = np.array(list( + itertools.chain.from_iterable(indices)), + dtype=np.int64) + self._indices = np.asarray(unique_int_1d(self._indices)) + return self._indices def get_indices(self): """ @@ -230,3 +202,97 @@ def get_indices(self): neighbors for the last query points and search radius """ return self._indices + + def search_pairs(self, radius): + """Search all the pairs within a specified radius + + Parameters + ---------- + radius : float + Maximum distance between pairs of coordinates + + Returns + ------- + pairs : array + Indices of all the pairs which are within the specified radius + """ + if not self._built: + raise RuntimeError(' Unbuilt Tree. Run tree.set_coords(...)') + + if self.pbc: + if self.cutoff < radius: + raise RuntimeError('Set cutoff greater or equal to the radius.') + + pairs = np.array(list(self.ckdt.query_pairs(radius)), dtype=np.int64) + if self.pbc: + if len(pairs) > 1: + pairs[:, 0] = undo_augment(pairs[:, 0], self.mapping, + len(self.coords)) + pairs[:, 1] = undo_augment(pairs[:, 1], self.mapping, + len(self.coords)) + if pairs.size > 0: + # First sort the pairs then pick the unique pairs + pairs = np.sort(pairs, axis=1) + pairs = unique_rows(pairs) + return pairs + + def search_tree(self, centers, radius): + """ + Searches all the pairs within radius between ``centers`` + and ``coords`` + + ``coords`` are the already initialized coordinates in the tree + during ``set_coords(coords, cutoff)``. + ``centers`` are wrapped around the primary unit cell + if PBC is desired. Minimum image convention (PBC) is + activated if ``box`` argument is provided during + class initialization + + Parameters + ---------- + centers: array_like (N,3) + coordinate array to search for neighbors + radius: float + maximum distance to search for neighbors. + + Returns + ------- + pairs : array + all the pairs between ``coords`` and ``centers`` + + Note + ---- + This method constructs another tree from the ``centers`` + and queries the previously built tree (Built in + ``PeriodicKDTree.set_coords(...)``) + """ + + if not self._built: + raise RuntimeError('Unbuilt tree. Run tree.set_coords(...)') + + centers = np.asarray(centers) + if centers.shape == (self.dim, ): + centers = centers.reshape((1, self.dim)) + + # Sanity check + if self.pbc: + if self.cutoff < radius: + raise RuntimeError('Set cutoff greater or equal to the radius.') + # Bring all query points to the central cell + wrapped_centers = apply_PBC(centers, self.box) + other_tree = cKDTree(wrapped_centers, leafsize=self.leafsize) + pairs = other_tree.query_ball_tree(self.ckdt, radius) + pairs = np.array([[i, j] for i, lst in enumerate(pairs) for j in lst], + dtype=np.int64) + if pairs.size > 0: + pairs[:, 1] = undo_augment(pairs[:, 1], + self.mapping, + len(self.coords)) + else: + other_tree = cKDTree(centers, leafsize=self.leafsize) + pairs = other_tree.query_ball_tree(self.ckdt, radius) + pairs = np.array([[i, j] for i, lst in enumerate(pairs) for j in lst], + dtype=np.int64) + if pairs.size > 0: + pairs = unique_rows(pairs) + return pairs diff --git a/package/MDAnalysis/lib/qcprot.c b/package/MDAnalysis/lib/qcprot.c index 049857b3a93..c268ef9be1d 100644 --- a/package/MDAnalysis/lib/qcprot.c +++ b/package/MDAnalysis/lib/qcprot.c @@ -1,11 +1,11 @@ -/* Generated by Cython 0.28.2 */ +/* Generated by Cython 0.28.5 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h" + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h", + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include/numpy/ufuncobject.h" ], "extra_compile_args": [ "-std=c99", @@ -14,7 +14,7 @@ "-funroll-loops" ], "include_dirs": [ - "/home/richard/miniconda2/envs/mda3/lib/python3.6/site-packages/numpy/core/include" + "/Users/richardgowers/miniconda3/envs/mda/lib/python3.6/site-packages/numpy/core/include" ], "name": "MDAnalysis.lib.qcprot", "sources": [ @@ -32,7 +32,7 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else -#define CYTHON_ABI "0_28_2" +#define CYTHON_ABI "0_28_5" #define CYTHON_FUTURE_DIVISION 0 #include #ifndef offsetof @@ -478,6 +478,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) @@ -675,7 +676,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ @@ -783,7 +784,7 @@ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; -static PyObject *__pyx_cython_runtime; +static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; @@ -857,7 +858,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":730 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -866,7 +867,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -875,7 +876,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -884,7 +885,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -893,7 +894,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -902,7 +903,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -911,7 +912,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":739 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -920,7 +921,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":740 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -929,7 +930,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":744 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -938,7 +939,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":745 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -947,7 +948,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":754 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -956,7 +957,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":755 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -965,7 +966,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -974,7 +975,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -983,7 +984,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -992,7 +993,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -1001,7 +1002,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -1010,7 +1011,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -1019,7 +1020,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -1028,7 +1029,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -1037,7 +1038,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -1072,7 +1073,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do /*--- Type declarations ---*/ -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -1081,7 +1082,7 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":770 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -1090,7 +1091,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -1099,7 +1100,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":773 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1354,6 +1355,9 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) @@ -1623,6 +1627,7 @@ static const char __pyx_k_yz[] = "yz"; static const char __pyx_k_z1[] = "z1"; static const char __pyx_k_z2[] = "z2"; static const char __pyx_k_zx[] = "zx"; +static const char __pyx_k_Doi[] = "Doi"; static const char __pyx_k_Sxx[] = "Sxx"; static const char __pyx_k_Sxy[] = "Sxy"; static const char __pyx_k_Sxz[] = "Sxz"; @@ -1648,6 +1653,7 @@ static const char __pyx_k_a41[] = "a41"; static const char __pyx_k_a42[] = "a42"; static const char __pyx_k_a43[] = "a43"; static const char __pyx_k_a44[] = "a44"; +static const char __pyx_k_due[] = "due"; static const char __pyx_k_ref[] = "ref"; static const char __pyx_k_rms[] = "rms"; static const char __pyx_k_rot[] = "rot"; @@ -1660,18 +1666,22 @@ static const char __pyx_k_Syz2[] = "Syz2"; static const char __pyx_k_Szx2[] = "Szx2"; static const char __pyx_k_Szy2[] = "Szy2"; static const char __pyx_k_Szz2[] = "Szz2"; +static const char __pyx_k_cite[] = "cite"; static const char __pyx_k_conf[] = "conf"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_oldg[] = "oldg"; +static const char __pyx_k_path[] = "path"; static const char __pyx_k_qsqr[] = "qsqr"; static const char __pyx_k_rmsd[] = "rmsd"; static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_QCBIB[] = "_QCBIB"; static const char __pyx_k_delta[] = "delta"; static const char __pyx_k_dtype[] = "dtype"; static const char __pyx_k_normq[] = "normq"; static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_zeros[] = "zeros"; +static const char __pyx_k_BibTeX[] = "BibTeX"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_weight[] = "weight"; static const char __pyx_k_SxxmSyy[] = "SxxmSyy"; @@ -1703,6 +1713,8 @@ static const char __pyx_k_a3243_4233[] = "a3243_4233"; static const char __pyx_k_a3244_4234[] = "a3244_4234"; static const char __pyx_k_a3344_4334[] = "a3344_4334"; static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_cite_module[] = "cite_module"; +static const char __pyx_k_description[] = "description"; static const char __pyx_k_InnerProduct[] = "InnerProduct"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_SyzSzymSyySzz2[] = "SyzSzymSyySzz2"; @@ -1710,11 +1722,14 @@ static const char __pyx_k_Sxy2Sxz2Syx2Szx2[] = "Sxy2Sxz2Syx2Szx2"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_Sxx2Syy2Szz2Syz2Szy2[] = "Sxx2Syy2Szz2Syz2Szy2"; static const char __pyx_k_MDAnalysis_lib_qcprot[] = "MDAnalysis.lib.qcprot"; +static const char __pyx_k_QCProt_implementation[] = "QCProt implementation"; static const char __pyx_k_FastCalcRMSDAndRotation[] = "FastCalcRMSDAndRotation"; static const char __pyx_k_CalcRMSDRotationalMatrix[] = "CalcRMSDRotationalMatrix"; +static const char __pyx_k_10_1107_s0108767305015266[] = "10.1107/s0108767305015266"; static const char __pyx_k_MDAnalysis_lib_qcprot_pyx[] = "MDAnalysis/lib/qcprot.pyx"; static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static const char __pyx_k_Fast_QCP_RMSD_structure_alignme[] = "\nFast QCP RMSD structure alignment --- :mod:`MDAnalysis.lib.qcprot`\n==================================================================\n\n:Author: Joshua L. Adelman, University of Pittsburgh\n:Author: Robert R. Delgado, Cornell University and Arizona State University\n:Contact: jla65@pitt.edu\n:Year: 2011, 2016\n:Licence: BSD\n\nPyQCPROT_ is a python/cython implementation of Douglas Theobald's QCP\nmethod for calculating the minimum RMSD between two structures\n[Theobald2005]_ and determining the optimal least-squares rotation\nmatrix [Liu2010]_.\n\nA full description of the method, along with the original C implementation can\nbe found at http://theobald.brandeis.edu/qcp/\n\nSee Also\n--------\nMDAnalysis.analysis.align:\n Align structures using :func:`CalcRMSDRotationalMatrix`\nMDAnalysis.analysis.rms.rmsd:\n Calculate the RMSD between two structures using\n :func:`CalcRMSDRotationalMatrix`\n\n\n.. versionchanged:: 0.16.0\n Call signatures were changed to directly interface with MDAnalysis\n coordinate arrays: shape (N, 3)\n\nReferences\n----------\n\nIf you use this QCP rotation calculation method in a publication, please\nreference:\n\n.. [Theobald2005] Douglas L. Theobald (2005)\n \"Rapid calculation of RMSD using a quaternion-based characteristic\n polynomial.\" Acta Crystallographica A 61(4):478-480.\n\n.. [Liu2010] Pu Liu, Dmitris K. Agrafiotis, and Douglas L. Theobald (2010)\n \"Fast determination of the optimal rotational matrix for macromolecular\n superpositions.\" J. Comput. Chem. 31, 1561-1563.\n\n.. _PyQCPROT: https://github.com/synapticarbors/pyqcprot\n\n\nFunctions\n---------\n\nUsers will typically use the :func:`CalcRMSDRotationalMatrix` function.\n\n.. autofunction:: CalcRMSDRotationalMatrix\n\n.. autofunction:: InnerProduct\n\n.. autofunction:: FastCalcRMSDAndRotation\n\n"; +static const char __pyx_k_article_qcprot2_author_Pu_Liu_a[] = "@article{qcprot2,\nauthor = {Pu Liu and Dimitris K. Agrafiotis and Douglas L. Theobald},\ntitle = {Fast determination of the optimal rotational matrix for macromolecular superpositions},\njournal = {Journal of Computational Chemistry},\nvolume = {31},\nnumber = {7},\npages = {1561-1563},\ndoi = {10.1002/jcc.21439},\n}\n"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; @@ -1722,9 +1737,12 @@ static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_kp_s_10_1107_s0108767305015266; static PyObject *__pyx_n_s_A; +static PyObject *__pyx_n_s_BibTeX; static PyObject *__pyx_n_s_C; static PyObject *__pyx_n_s_CalcRMSDRotationalMatrix; +static PyObject *__pyx_n_s_Doi; static PyObject *__pyx_n_s_E0; static PyObject *__pyx_n_s_FastCalcRMSDAndRotation; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; @@ -1733,10 +1751,12 @@ static PyObject *__pyx_n_s_G1; static PyObject *__pyx_n_s_G2; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_n_s_InnerProduct; -static PyObject *__pyx_n_s_MDAnalysis_lib_qcprot; +static PyObject *__pyx_kp_s_MDAnalysis_lib_qcprot; static PyObject *__pyx_kp_s_MDAnalysis_lib_qcprot_pyx; static PyObject *__pyx_n_s_N; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; +static PyObject *__pyx_n_s_QCBIB; +static PyObject *__pyx_kp_s_QCProt_implementation; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_Sxx; static PyObject *__pyx_n_s_Sxx2; @@ -1798,16 +1818,21 @@ static PyObject *__pyx_n_s_a41; static PyObject *__pyx_n_s_a42; static PyObject *__pyx_n_s_a43; static PyObject *__pyx_n_s_a44; +static PyObject *__pyx_kp_s_article_qcprot2_author_Pu_Liu_a; static PyObject *__pyx_n_s_ax; static PyObject *__pyx_n_s_ay; static PyObject *__pyx_n_s_az; static PyObject *__pyx_n_s_b; +static PyObject *__pyx_n_s_cite; +static PyObject *__pyx_n_s_cite_module; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_conf; static PyObject *__pyx_n_s_coords1; static PyObject *__pyx_n_s_coords2; static PyObject *__pyx_n_s_delta; +static PyObject *__pyx_n_s_description; static PyObject *__pyx_n_s_dtype; +static PyObject *__pyx_n_s_due; static PyObject *__pyx_n_s_evalprec; static PyObject *__pyx_n_s_evecprec; static PyObject *__pyx_n_s_float64; @@ -1823,6 +1848,7 @@ static PyObject *__pyx_n_s_numpy; static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_oldg; +static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_q1; static PyObject *__pyx_n_s_q2; static PyObject *__pyx_n_s_q3; @@ -1866,14 +1892,15 @@ static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; -static PyObject *__pyx_tuple__14; -static PyObject *__pyx_tuple__16; -static PyObject *__pyx_codeobj__13; -static PyObject *__pyx_codeobj__15; -static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; /* Late includes */ -/* "MDAnalysis/lib/qcprot.pyx":150 +/* "MDAnalysis/lib/qcprot.pyx":175 * @cython.boundscheck(False) * @cython.wraparound(False) * def InnerProduct(np.ndarray[np.float64_t, ndim=1] A, # <<<<<<<<<<<<<< @@ -1923,29 +1950,29 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_6qcprot_1InnerProduct(PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords1)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 1); __PYX_ERR(0, 150, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 1); __PYX_ERR(0, 175, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords2)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 2); __PYX_ERR(0, 150, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 2); __PYX_ERR(0, 175, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 3); __PYX_ERR(0, 150, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 3); __PYX_ERR(0, 175, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 4); __PYX_ERR(0, 150, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, 4); __PYX_ERR(0, 175, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "InnerProduct") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "InnerProduct") < 0)) __PYX_ERR(0, 175, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -1959,21 +1986,21 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_6qcprot_1InnerProduct(PyObject *__py __pyx_v_A = ((PyArrayObject *)values[0]); __pyx_v_coords1 = ((PyArrayObject *)values[1]); __pyx_v_coords2 = ((PyArrayObject *)values[2]); - __pyx_v_N = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L3_error) + __pyx_v_N = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) __pyx_v_weight = ((PyArrayObject *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 150, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("InnerProduct", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 175, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.qcprot.InnerProduct", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 150, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 151, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 152, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) __PYX_ERR(0, 154, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 175, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords1), __pyx_ptype_5numpy_ndarray, 1, "coords1", 0))) __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords2), __pyx_ptype_5numpy_ndarray, 1, "coords2", 0))) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weight), __pyx_ptype_5numpy_ndarray, 1, "weight", 0))) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(__pyx_self, __pyx_v_A, __pyx_v_coords1, __pyx_v_coords2, __pyx_v_N, __pyx_v_weight); /* function exit code */ @@ -2091,26 +2118,26 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_pybuffernd_weight.rcbuffer = &__pyx_pybuffer_weight; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 175, __pyx_L1_error) } __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords1.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords1.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 175, __pyx_L1_error) } __pyx_pybuffernd_coords1.diminfo[0].strides = __pyx_pybuffernd_coords1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords1.diminfo[0].shape = __pyx_pybuffernd_coords1.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords1.diminfo[1].strides = __pyx_pybuffernd_coords1.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords1.diminfo[1].shape = __pyx_pybuffernd_coords1.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords2.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords2.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 175, __pyx_L1_error) } __pyx_pybuffernd_coords2.diminfo[0].strides = __pyx_pybuffernd_coords2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords2.diminfo[0].shape = __pyx_pybuffernd_coords2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords2.diminfo[1].strides = __pyx_pybuffernd_coords2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords2.diminfo[1].shape = __pyx_pybuffernd_coords2.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 175, __pyx_L1_error) } __pyx_pybuffernd_weight.diminfo[0].strides = __pyx_pybuffernd_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weight.diminfo[0].shape = __pyx_pybuffernd_weight.rcbuffer->pybuffer.shape[0]; - /* "MDAnalysis/lib/qcprot.pyx":192 + /* "MDAnalysis/lib/qcprot.pyx":217 * cdef double G1, G2 * * G1 = 0.0 # <<<<<<<<<<<<<< @@ -2119,7 +2146,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P */ __pyx_v_G1 = 0.0; - /* "MDAnalysis/lib/qcprot.pyx":193 + /* "MDAnalysis/lib/qcprot.pyx":218 * * G1 = 0.0 * G2 = 0.0 # <<<<<<<<<<<<<< @@ -2128,7 +2155,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P */ __pyx_v_G2 = 0.0; - /* "MDAnalysis/lib/qcprot.pyx":195 + /* "MDAnalysis/lib/qcprot.pyx":220 * G2 = 0.0 * * A[0] = A[1] = A[2] = A[3] = A[4] = A[5] = A[6] = A[7] = A[8] = 0.0 # <<<<<<<<<<<<<< @@ -2154,7 +2181,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_9 = 8; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_A.diminfo[0].strides) = 0.0; - /* "MDAnalysis/lib/qcprot.pyx":197 + /* "MDAnalysis/lib/qcprot.pyx":222 * A[0] = A[1] = A[2] = A[3] = A[4] = A[5] = A[6] = A[7] = A[8] = 0.0 * * if (weight is not None): # <<<<<<<<<<<<<< @@ -2165,7 +2192,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_11 = (__pyx_t_10 != 0); if (__pyx_t_11) { - /* "MDAnalysis/lib/qcprot.pyx":198 + /* "MDAnalysis/lib/qcprot.pyx":223 * * if (weight is not None): * for i in range(N): # <<<<<<<<<<<<<< @@ -2177,7 +2204,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; - /* "MDAnalysis/lib/qcprot.pyx":199 + /* "MDAnalysis/lib/qcprot.pyx":224 * if (weight is not None): * for i in range(N): * x1 = weight[i] * coords1[i, 0] # <<<<<<<<<<<<<< @@ -2189,7 +2216,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_17 = 0; __pyx_v_x1 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weight.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_weight.diminfo[0].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_coords1.diminfo[1].strides))); - /* "MDAnalysis/lib/qcprot.pyx":200 + /* "MDAnalysis/lib/qcprot.pyx":225 * for i in range(N): * x1 = weight[i] * coords1[i, 0] * y1 = weight[i] * coords1[i, 1] # <<<<<<<<<<<<<< @@ -2201,7 +2228,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_20 = 1; __pyx_v_y1 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weight.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_weight.diminfo[0].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_coords1.diminfo[1].strides))); - /* "MDAnalysis/lib/qcprot.pyx":201 + /* "MDAnalysis/lib/qcprot.pyx":226 * x1 = weight[i] * coords1[i, 0] * y1 = weight[i] * coords1[i, 1] * z1 = weight[i] * coords1[i, 2] # <<<<<<<<<<<<<< @@ -2213,7 +2240,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_23 = 2; __pyx_v_z1 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weight.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_weight.diminfo[0].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_coords1.diminfo[1].strides))); - /* "MDAnalysis/lib/qcprot.pyx":203 + /* "MDAnalysis/lib/qcprot.pyx":228 * z1 = weight[i] * coords1[i, 2] * * G1 += x1 * coords1[i, 0] + y1 * coords1[i, 1] + z1 * coords1[i, 2] # <<<<<<<<<<<<<< @@ -2228,7 +2255,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_29 = 2; __pyx_v_G1 = (__pyx_v_G1 + (((__pyx_v_x1 * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_coords1.diminfo[1].strides))) + (__pyx_v_y1 * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_coords1.diminfo[1].strides)))) + (__pyx_v_z1 * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_coords1.diminfo[1].strides))))); - /* "MDAnalysis/lib/qcprot.pyx":205 + /* "MDAnalysis/lib/qcprot.pyx":230 * G1 += x1 * coords1[i, 0] + y1 * coords1[i, 1] + z1 * coords1[i, 2] * * x2 = coords2[i, 0] # <<<<<<<<<<<<<< @@ -2239,7 +2266,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_31 = 0; __pyx_v_x2 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords2.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_coords2.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_coords2.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":206 + /* "MDAnalysis/lib/qcprot.pyx":231 * * x2 = coords2[i, 0] * y2 = coords2[i, 1] # <<<<<<<<<<<<<< @@ -2250,7 +2277,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_33 = 1; __pyx_v_y2 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords2.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_coords2.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_coords2.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":207 + /* "MDAnalysis/lib/qcprot.pyx":232 * x2 = coords2[i, 0] * y2 = coords2[i, 1] * z2 = coords2[i, 2] # <<<<<<<<<<<<<< @@ -2261,7 +2288,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_35 = 2; __pyx_v_z2 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords2.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_coords2.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_coords2.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":209 + /* "MDAnalysis/lib/qcprot.pyx":234 * z2 = coords2[i, 2] * * G2 += weight[i] * (x2 * x2 + y2 * y2 + z2 * z2) # <<<<<<<<<<<<<< @@ -2271,7 +2298,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_36 = __pyx_v_i; __pyx_v_G2 = (__pyx_v_G2 + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_weight.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_weight.diminfo[0].strides)) * (((__pyx_v_x2 * __pyx_v_x2) + (__pyx_v_y2 * __pyx_v_y2)) + (__pyx_v_z2 * __pyx_v_z2)))); - /* "MDAnalysis/lib/qcprot.pyx":211 + /* "MDAnalysis/lib/qcprot.pyx":236 * G2 += weight[i] * (x2 * x2 + y2 * y2 + z2 * z2) * * A[0] += (x1 * x2) # <<<<<<<<<<<<<< @@ -2281,7 +2308,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_37 = 0; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_x1 * __pyx_v_x2); - /* "MDAnalysis/lib/qcprot.pyx":212 + /* "MDAnalysis/lib/qcprot.pyx":237 * * A[0] += (x1 * x2) * A[1] += (x1 * y2) # <<<<<<<<<<<<<< @@ -2291,7 +2318,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_38 = 1; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_x1 * __pyx_v_y2); - /* "MDAnalysis/lib/qcprot.pyx":213 + /* "MDAnalysis/lib/qcprot.pyx":238 * A[0] += (x1 * x2) * A[1] += (x1 * y2) * A[2] += (x1 * z2) # <<<<<<<<<<<<<< @@ -2301,7 +2328,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_39 = 2; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_x1 * __pyx_v_z2); - /* "MDAnalysis/lib/qcprot.pyx":215 + /* "MDAnalysis/lib/qcprot.pyx":240 * A[2] += (x1 * z2) * * A[3] += (y1 * x2) # <<<<<<<<<<<<<< @@ -2311,7 +2338,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_40 = 3; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_y1 * __pyx_v_x2); - /* "MDAnalysis/lib/qcprot.pyx":216 + /* "MDAnalysis/lib/qcprot.pyx":241 * * A[3] += (y1 * x2) * A[4] += (y1 * y2) # <<<<<<<<<<<<<< @@ -2321,7 +2348,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_41 = 4; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_y1 * __pyx_v_y2); - /* "MDAnalysis/lib/qcprot.pyx":217 + /* "MDAnalysis/lib/qcprot.pyx":242 * A[3] += (y1 * x2) * A[4] += (y1 * y2) * A[5] += (y1 * z2) # <<<<<<<<<<<<<< @@ -2331,7 +2358,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_42 = 5; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_y1 * __pyx_v_z2); - /* "MDAnalysis/lib/qcprot.pyx":219 + /* "MDAnalysis/lib/qcprot.pyx":244 * A[5] += (y1 * z2) * * A[6] += (z1 * x2) # <<<<<<<<<<<<<< @@ -2341,7 +2368,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_43 = 6; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_z1 * __pyx_v_x2); - /* "MDAnalysis/lib/qcprot.pyx":220 + /* "MDAnalysis/lib/qcprot.pyx":245 * * A[6] += (z1 * x2) * A[7] += (z1 * y2) # <<<<<<<<<<<<<< @@ -2351,7 +2378,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_44 = 7; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_z1 * __pyx_v_y2); - /* "MDAnalysis/lib/qcprot.pyx":221 + /* "MDAnalysis/lib/qcprot.pyx":246 * A[6] += (z1 * x2) * A[7] += (z1 * y2) * A[8] += (z1 * z2) # <<<<<<<<<<<<<< @@ -2362,7 +2389,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_z1 * __pyx_v_z2); } - /* "MDAnalysis/lib/qcprot.pyx":197 + /* "MDAnalysis/lib/qcprot.pyx":222 * A[0] = A[1] = A[2] = A[3] = A[4] = A[5] = A[6] = A[7] = A[8] = 0.0 * * if (weight is not None): # <<<<<<<<<<<<<< @@ -2372,7 +2399,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P goto __pyx_L3; } - /* "MDAnalysis/lib/qcprot.pyx":224 + /* "MDAnalysis/lib/qcprot.pyx":249 * * else: * for i in range(N): # <<<<<<<<<<<<<< @@ -2385,7 +2412,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; - /* "MDAnalysis/lib/qcprot.pyx":225 + /* "MDAnalysis/lib/qcprot.pyx":250 * else: * for i in range(N): * x1 = coords1[i, 0] # <<<<<<<<<<<<<< @@ -2396,7 +2423,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_47 = 0; __pyx_v_x1 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_coords1.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":226 + /* "MDAnalysis/lib/qcprot.pyx":251 * for i in range(N): * x1 = coords1[i, 0] * y1 = coords1[i, 1] # <<<<<<<<<<<<<< @@ -2407,7 +2434,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_49 = 1; __pyx_v_y1 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_coords1.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":227 + /* "MDAnalysis/lib/qcprot.pyx":252 * x1 = coords1[i, 0] * y1 = coords1[i, 1] * z1 = coords1[i, 2] # <<<<<<<<<<<<<< @@ -2418,7 +2445,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_51 = 2; __pyx_v_z1 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords1.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_coords1.diminfo[0].strides, __pyx_t_51, __pyx_pybuffernd_coords1.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":229 + /* "MDAnalysis/lib/qcprot.pyx":254 * z1 = coords1[i, 2] * * G1 += (x1 * x1 + y1 * y1 + z1 * z1) # <<<<<<<<<<<<<< @@ -2427,7 +2454,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P */ __pyx_v_G1 = (__pyx_v_G1 + (((__pyx_v_x1 * __pyx_v_x1) + (__pyx_v_y1 * __pyx_v_y1)) + (__pyx_v_z1 * __pyx_v_z1))); - /* "MDAnalysis/lib/qcprot.pyx":231 + /* "MDAnalysis/lib/qcprot.pyx":256 * G1 += (x1 * x1 + y1 * y1 + z1 * z1) * * x2 = coords2[i, 0] # <<<<<<<<<<<<<< @@ -2438,7 +2465,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_53 = 0; __pyx_v_x2 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords2.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_coords2.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_coords2.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":232 + /* "MDAnalysis/lib/qcprot.pyx":257 * * x2 = coords2[i, 0] * y2 = coords2[i, 1] # <<<<<<<<<<<<<< @@ -2449,7 +2476,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_55 = 1; __pyx_v_y2 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords2.rcbuffer->pybuffer.buf, __pyx_t_54, __pyx_pybuffernd_coords2.diminfo[0].strides, __pyx_t_55, __pyx_pybuffernd_coords2.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":233 + /* "MDAnalysis/lib/qcprot.pyx":258 * x2 = coords2[i, 0] * y2 = coords2[i, 1] * z2 = coords2[i, 2] # <<<<<<<<<<<<<< @@ -2460,7 +2487,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_57 = 2; __pyx_v_z2 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_coords2.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_coords2.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_coords2.diminfo[1].strides)); - /* "MDAnalysis/lib/qcprot.pyx":235 + /* "MDAnalysis/lib/qcprot.pyx":260 * z2 = coords2[i, 2] * * G2 += (x2 * x2 + y2 * y2 + z2 * z2) # <<<<<<<<<<<<<< @@ -2469,7 +2496,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P */ __pyx_v_G2 = (__pyx_v_G2 + (((__pyx_v_x2 * __pyx_v_x2) + (__pyx_v_y2 * __pyx_v_y2)) + (__pyx_v_z2 * __pyx_v_z2))); - /* "MDAnalysis/lib/qcprot.pyx":237 + /* "MDAnalysis/lib/qcprot.pyx":262 * G2 += (x2 * x2 + y2 * y2 + z2 * z2) * * A[0] += (x1 * x2) # <<<<<<<<<<<<<< @@ -2479,7 +2506,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_58 = 0; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_x1 * __pyx_v_x2); - /* "MDAnalysis/lib/qcprot.pyx":238 + /* "MDAnalysis/lib/qcprot.pyx":263 * * A[0] += (x1 * x2) * A[1] += (x1 * y2) # <<<<<<<<<<<<<< @@ -2489,7 +2516,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_59 = 1; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_x1 * __pyx_v_y2); - /* "MDAnalysis/lib/qcprot.pyx":239 + /* "MDAnalysis/lib/qcprot.pyx":264 * A[0] += (x1 * x2) * A[1] += (x1 * y2) * A[2] += (x1 * z2) # <<<<<<<<<<<<<< @@ -2499,7 +2526,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_60 = 2; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_60, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_x1 * __pyx_v_z2); - /* "MDAnalysis/lib/qcprot.pyx":241 + /* "MDAnalysis/lib/qcprot.pyx":266 * A[2] += (x1 * z2) * * A[3] += (y1 * x2) # <<<<<<<<<<<<<< @@ -2509,7 +2536,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_61 = 3; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_y1 * __pyx_v_x2); - /* "MDAnalysis/lib/qcprot.pyx":242 + /* "MDAnalysis/lib/qcprot.pyx":267 * * A[3] += (y1 * x2) * A[4] += (y1 * y2) # <<<<<<<<<<<<<< @@ -2519,7 +2546,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_62 = 4; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_62, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_y1 * __pyx_v_y2); - /* "MDAnalysis/lib/qcprot.pyx":243 + /* "MDAnalysis/lib/qcprot.pyx":268 * A[3] += (y1 * x2) * A[4] += (y1 * y2) * A[5] += (y1 * z2) # <<<<<<<<<<<<<< @@ -2529,7 +2556,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_63 = 5; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_y1 * __pyx_v_z2); - /* "MDAnalysis/lib/qcprot.pyx":245 + /* "MDAnalysis/lib/qcprot.pyx":270 * A[5] += (y1 * z2) * * A[6] += (z1 * x2) # <<<<<<<<<<<<<< @@ -2539,7 +2566,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_64 = 6; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_z1 * __pyx_v_x2); - /* "MDAnalysis/lib/qcprot.pyx":246 + /* "MDAnalysis/lib/qcprot.pyx":271 * * A[6] += (z1 * x2) * A[7] += (z1 * y2) # <<<<<<<<<<<<<< @@ -2549,7 +2576,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P __pyx_t_65 = 7; *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_65, __pyx_pybuffernd_A.diminfo[0].strides) += (__pyx_v_z1 * __pyx_v_y2); - /* "MDAnalysis/lib/qcprot.pyx":247 + /* "MDAnalysis/lib/qcprot.pyx":272 * A[6] += (z1 * x2) * A[7] += (z1 * y2) * A[8] += (z1 * z2) # <<<<<<<<<<<<<< @@ -2562,7 +2589,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P } __pyx_L3:; - /* "MDAnalysis/lib/qcprot.pyx":249 + /* "MDAnalysis/lib/qcprot.pyx":274 * A[8] += (z1 * z2) * * return (G1 + G2) * 0.5 # <<<<<<<<<<<<<< @@ -2570,13 +2597,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P * @cython.boundscheck(False) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_67 = PyFloat_FromDouble(((__pyx_v_G1 + __pyx_v_G2) * 0.5)); if (unlikely(!__pyx_t_67)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_67 = PyFloat_FromDouble(((__pyx_v_G1 + __pyx_v_G2) * 0.5)); if (unlikely(!__pyx_t_67)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_67); __pyx_r = __pyx_t_67; __pyx_t_67 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/qcprot.pyx":150 + /* "MDAnalysis/lib/qcprot.pyx":175 * @cython.boundscheck(False) * @cython.wraparound(False) * def InnerProduct(np.ndarray[np.float64_t, ndim=1] A, # <<<<<<<<<<<<<< @@ -2610,7 +2637,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_InnerProduct(CYTHON_UNUSED P return __pyx_r; } -/* "MDAnalysis/lib/qcprot.pyx":253 +/* "MDAnalysis/lib/qcprot.pyx":278 * @cython.boundscheck(False) * @cython.wraparound(False) * def CalcRMSDRotationalMatrix(np.ndarray[np.float64_t, ndim=2] ref, # <<<<<<<<<<<<<< @@ -2660,29 +2687,29 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_6qcprot_3CalcRMSDRotationalMatrix(Py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 1); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 1); __PYX_ERR(0, 278, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 2); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 2); __PYX_ERR(0, 278, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rot)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 3); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 3); __PYX_ERR(0, 278, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weights)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 4); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, 4); __PYX_ERR(0, 278, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CalcRMSDRotationalMatrix") < 0)) __PYX_ERR(0, 253, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CalcRMSDRotationalMatrix") < 0)) __PYX_ERR(0, 278, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -2695,22 +2722,22 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_6qcprot_3CalcRMSDRotationalMatrix(Py } __pyx_v_ref = ((PyArrayObject *)values[0]); __pyx_v_conf = ((PyArrayObject *)values[1]); - __pyx_v_N = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error) + __pyx_v_N = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L3_error) __pyx_v_rot = ((PyArrayObject *)values[3]); __pyx_v_weights = ((PyArrayObject *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 253, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("CalcRMSDRotationalMatrix", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 278, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.qcprot.CalcRMSDRotationalMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ref), __pyx_ptype_5numpy_ndarray, 1, "ref", 0))) __PYX_ERR(0, 253, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conf), __pyx_ptype_5numpy_ndarray, 1, "conf", 0))) __PYX_ERR(0, 254, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rot), __pyx_ptype_5numpy_ndarray, 1, "rot", 0))) __PYX_ERR(0, 256, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ref), __pyx_ptype_5numpy_ndarray, 1, "ref", 0))) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_conf), __pyx_ptype_5numpy_ndarray, 1, "conf", 0))) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rot), __pyx_ptype_5numpy_ndarray, 1, "rot", 0))) __PYX_ERR(0, 281, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weights), __pyx_ptype_5numpy_ndarray, 1, "weights", 0))) __PYX_ERR(0, 282, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(__pyx_self, __pyx_v_ref, __pyx_v_conf, __pyx_v_N, __pyx_v_rot, __pyx_v_weights); /* function exit code */ @@ -2769,57 +2796,57 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY __pyx_pybuffernd_weights.rcbuffer = &__pyx_pybuffer_weights; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ref.rcbuffer->pybuffer, (PyObject*)__pyx_v_ref, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ref.rcbuffer->pybuffer, (PyObject*)__pyx_v_ref, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 278, __pyx_L1_error) } __pyx_pybuffernd_ref.diminfo[0].strides = __pyx_pybuffernd_ref.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ref.diminfo[0].shape = __pyx_pybuffernd_ref.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ref.diminfo[1].strides = __pyx_pybuffernd_ref.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ref.diminfo[1].shape = __pyx_pybuffernd_ref.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conf.rcbuffer->pybuffer, (PyObject*)__pyx_v_conf, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_conf.rcbuffer->pybuffer, (PyObject*)__pyx_v_conf, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 278, __pyx_L1_error) } __pyx_pybuffernd_conf.diminfo[0].strides = __pyx_pybuffernd_conf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_conf.diminfo[0].shape = __pyx_pybuffernd_conf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_conf.diminfo[1].strides = __pyx_pybuffernd_conf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_conf.diminfo[1].shape = __pyx_pybuffernd_conf.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rot.rcbuffer->pybuffer, (PyObject*)__pyx_v_rot, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rot.rcbuffer->pybuffer, (PyObject*)__pyx_v_rot, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 278, __pyx_L1_error) } __pyx_pybuffernd_rot.diminfo[0].strides = __pyx_pybuffernd_rot.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rot.diminfo[0].shape = __pyx_pybuffernd_rot.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weights.rcbuffer->pybuffer, (PyObject*)__pyx_v_weights, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 278, __pyx_L1_error) } __pyx_pybuffernd_weights.diminfo[0].strides = __pyx_pybuffernd_weights.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weights.diminfo[0].shape = __pyx_pybuffernd_weights.rcbuffer->pybuffer.shape[0]; - /* "MDAnalysis/lib/qcprot.pyx":283 + /* "MDAnalysis/lib/qcprot.pyx":308 * """ * cdef double E0 * cdef np.ndarray[np.float64_t, ndim = 1] A = np.zeros(9,dtype = np.float64) # <<<<<<<<<<<<<< * * E0 = InnerProduct(A, conf, ref, N, weights) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 283, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 283, __pyx_L1_error) + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_A = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_A.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 283, __pyx_L1_error) + __PYX_ERR(0, 308, __pyx_L1_error) } else {__pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; } } @@ -2827,16 +2854,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY __pyx_v_A = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/qcprot.pyx":285 + /* "MDAnalysis/lib/qcprot.pyx":310 * cdef np.ndarray[np.float64_t, ndim = 1] A = np.zeros(9,dtype = np.float64) * * E0 = InnerProduct(A, conf, ref, N, weights) # <<<<<<<<<<<<<< * return FastCalcRMSDAndRotation(rot, A, E0, N) * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InnerProduct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InnerProduct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -2853,7 +2880,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[6] = {__pyx_t_3, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_conf), ((PyObject *)__pyx_v_ref), __pyx_t_2, ((PyObject *)__pyx_v_weights)}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2862,14 +2889,14 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[6] = {__pyx_t_3, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_conf), ((PyObject *)__pyx_v_ref), __pyx_t_2, ((PyObject *)__pyx_v_weights)}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -2889,16 +2916,16 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY __Pyx_GIVEREF(((PyObject *)__pyx_v_weights)); PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, ((PyObject *)__pyx_v_weights)); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_E0 = __pyx_t_8; - /* "MDAnalysis/lib/qcprot.pyx":286 + /* "MDAnalysis/lib/qcprot.pyx":311 * * E0 = InnerProduct(A, conf, ref, N, weights) * return FastCalcRMSDAndRotation(rot, A, E0, N) # <<<<<<<<<<<<<< @@ -2906,11 +2933,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY * def FastCalcRMSDAndRotation(np.ndarray[np.float64_t, ndim=1] rot, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FastCalcRMSDAndRotation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FastCalcRMSDAndRotation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_E0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_E0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -2927,7 +2954,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_rot), ((PyObject *)__pyx_v_A), __pyx_t_7, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -2937,7 +2964,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_rot), ((PyObject *)__pyx_v_A), __pyx_t_7, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -2945,7 +2972,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY } else #endif { - __pyx_t_9 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -2962,7 +2989,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_6, __pyx_t_2); __pyx_t_7 = 0; __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -2971,7 +2998,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY __pyx_t_4 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/qcprot.pyx":253 + /* "MDAnalysis/lib/qcprot.pyx":278 * @cython.boundscheck(False) * @cython.wraparound(False) * def CalcRMSDRotationalMatrix(np.ndarray[np.float64_t, ndim=2] ref, # <<<<<<<<<<<<<< @@ -3013,7 +3040,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_2CalcRMSDRotationalMatrix(CY return __pyx_r; } -/* "MDAnalysis/lib/qcprot.pyx":288 +/* "MDAnalysis/lib/qcprot.pyx":313 * return FastCalcRMSDAndRotation(rot, A, E0, N) * * def FastCalcRMSDAndRotation(np.ndarray[np.float64_t, ndim=1] rot, # <<<<<<<<<<<<<< @@ -3060,23 +3087,23 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_6qcprot_5FastCalcRMSDAndRotation(PyO case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, 1); __PYX_ERR(0, 288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, 1); __PYX_ERR(0, 313, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_E0)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, 2); __PYX_ERR(0, 288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, 2); __PYX_ERR(0, 313, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, 3); __PYX_ERR(0, 288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, 3); __PYX_ERR(0, 313, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "FastCalcRMSDAndRotation") < 0)) __PYX_ERR(0, 288, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "FastCalcRMSDAndRotation") < 0)) __PYX_ERR(0, 313, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -3088,19 +3115,19 @@ static PyObject *__pyx_pw_10MDAnalysis_3lib_6qcprot_5FastCalcRMSDAndRotation(PyO } __pyx_v_rot = ((PyArrayObject *)values[0]); __pyx_v_A = ((PyArrayObject *)values[1]); - __pyx_v_E0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_E0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) - __pyx_v_N = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) + __pyx_v_E0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_E0 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L3_error) + __pyx_v_N = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 288, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("FastCalcRMSDAndRotation", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 313, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("MDAnalysis.lib.qcprot.FastCalcRMSDAndRotation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rot), __pyx_ptype_5numpy_ndarray, 1, "rot", 0))) __PYX_ERR(0, 288, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rot), __pyx_ptype_5numpy_ndarray, 1, "rot", 0))) __PYX_ERR(0, 313, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 314, __pyx_L1_error) __pyx_r = __pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(__pyx_self, __pyx_v_rot, __pyx_v_A, __pyx_v_E0, __pyx_v_N); /* function exit code */ @@ -3261,37 +3288,37 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rot.rcbuffer->pybuffer, (PyObject*)__pyx_v_rot, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rot.rcbuffer->pybuffer, (PyObject*)__pyx_v_rot, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 313, __pyx_L1_error) } __pyx_pybuffernd_rot.diminfo[0].strides = __pyx_pybuffernd_rot.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rot.diminfo[0].shape = __pyx_pybuffernd_rot.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 313, __pyx_L1_error) } __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; - /* "MDAnalysis/lib/qcprot.pyx":321 + /* "MDAnalysis/lib/qcprot.pyx":346 * cdef double SxzmSzx, SxymSyx, SxxpSyy, SxxmSyy * * cdef np.ndarray[np.float64_t, ndim=1] C = np.zeros(4,) # <<<<<<<<<<<<<< * cdef unsigned int i * cdef double mxEigenV */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 321, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 346, __pyx_L1_error) __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_C.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_C = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_C.rcbuffer->pybuffer.buf = NULL; - __PYX_ERR(0, 321, __pyx_L1_error) + __PYX_ERR(0, 346, __pyx_L1_error) } else {__pyx_pybuffernd_C.diminfo[0].strides = __pyx_pybuffernd_C.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_C.diminfo[0].shape = __pyx_pybuffernd_C.rcbuffer->pybuffer.shape[0]; } } @@ -3299,7 +3326,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_v_C = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/qcprot.pyx":324 + /* "MDAnalysis/lib/qcprot.pyx":349 * cdef unsigned int i * cdef double mxEigenV * cdef double oldg = 0.0 # <<<<<<<<<<<<<< @@ -3308,7 +3335,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_oldg = 0.0; - /* "MDAnalysis/lib/qcprot.pyx":332 + /* "MDAnalysis/lib/qcprot.pyx":357 * cdef double xy, az, zx, ay, yz, ax * cdef double a3344_4334, a3244_4234, a3243_4233, a3143_4133,a3144_4134, a3142_4132 * cdef double evecprec = 1e-6 # <<<<<<<<<<<<<< @@ -3317,7 +3344,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_evecprec = 1e-6; - /* "MDAnalysis/lib/qcprot.pyx":333 + /* "MDAnalysis/lib/qcprot.pyx":358 * cdef double a3344_4334, a3244_4234, a3243_4233, a3143_4133,a3144_4134, a3142_4132 * cdef double evecprec = 1e-6 * cdef double evalprec = 1e-14 # <<<<<<<<<<<<<< @@ -3326,7 +3353,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_evalprec = 1e-14; - /* "MDAnalysis/lib/qcprot.pyx":336 + /* "MDAnalysis/lib/qcprot.pyx":361 * * cdef double a1324_1423, a1224_1422, a1223_1322, a1124_1421, a1123_1321, a1122_1221 * Sxx = A[0] # <<<<<<<<<<<<<< @@ -3341,11 +3368,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 336, __pyx_L1_error) + __PYX_ERR(0, 361, __pyx_L1_error) } __pyx_v_Sxx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":337 + /* "MDAnalysis/lib/qcprot.pyx":362 * cdef double a1324_1423, a1224_1422, a1223_1322, a1124_1421, a1123_1321, a1122_1221 * Sxx = A[0] * Sxy = A[1] # <<<<<<<<<<<<<< @@ -3360,11 +3387,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 337, __pyx_L1_error) + __PYX_ERR(0, 362, __pyx_L1_error) } __pyx_v_Sxy = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":338 + /* "MDAnalysis/lib/qcprot.pyx":363 * Sxx = A[0] * Sxy = A[1] * Sxz = A[2] # <<<<<<<<<<<<<< @@ -3379,11 +3406,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 338, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) } __pyx_v_Sxz = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":339 + /* "MDAnalysis/lib/qcprot.pyx":364 * Sxy = A[1] * Sxz = A[2] * Syx = A[3] # <<<<<<<<<<<<<< @@ -3398,11 +3425,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 339, __pyx_L1_error) + __PYX_ERR(0, 364, __pyx_L1_error) } __pyx_v_Syx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":340 + /* "MDAnalysis/lib/qcprot.pyx":365 * Sxz = A[2] * Syx = A[3] * Syy = A[4] # <<<<<<<<<<<<<< @@ -3417,11 +3444,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 340, __pyx_L1_error) + __PYX_ERR(0, 365, __pyx_L1_error) } __pyx_v_Syy = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":341 + /* "MDAnalysis/lib/qcprot.pyx":366 * Syx = A[3] * Syy = A[4] * Syz = A[5] # <<<<<<<<<<<<<< @@ -3436,11 +3463,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 341, __pyx_L1_error) + __PYX_ERR(0, 366, __pyx_L1_error) } __pyx_v_Syz = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":342 + /* "MDAnalysis/lib/qcprot.pyx":367 * Syy = A[4] * Syz = A[5] * Szx = A[6] # <<<<<<<<<<<<<< @@ -3455,11 +3482,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 342, __pyx_L1_error) + __PYX_ERR(0, 367, __pyx_L1_error) } __pyx_v_Szx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":343 + /* "MDAnalysis/lib/qcprot.pyx":368 * Syz = A[5] * Szx = A[6] * Szy = A[7] # <<<<<<<<<<<<<< @@ -3474,11 +3501,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 343, __pyx_L1_error) + __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_v_Szy = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":344 + /* "MDAnalysis/lib/qcprot.pyx":369 * Szx = A[6] * Szy = A[7] * Szz = A[8] # <<<<<<<<<<<<<< @@ -3493,11 +3520,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_A.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 344, __pyx_L1_error) + __PYX_ERR(0, 369, __pyx_L1_error) } __pyx_v_Szz = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_A.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_A.diminfo[0].strides)); - /* "MDAnalysis/lib/qcprot.pyx":346 + /* "MDAnalysis/lib/qcprot.pyx":371 * Szz = A[8] * * Sxx2 = Sxx * Sxx # <<<<<<<<<<<<<< @@ -3506,7 +3533,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Sxx2 = (__pyx_v_Sxx * __pyx_v_Sxx); - /* "MDAnalysis/lib/qcprot.pyx":347 + /* "MDAnalysis/lib/qcprot.pyx":372 * * Sxx2 = Sxx * Sxx * Syy2 = Syy * Syy # <<<<<<<<<<<<<< @@ -3515,7 +3542,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Syy2 = (__pyx_v_Syy * __pyx_v_Syy); - /* "MDAnalysis/lib/qcprot.pyx":348 + /* "MDAnalysis/lib/qcprot.pyx":373 * Sxx2 = Sxx * Sxx * Syy2 = Syy * Syy * Szz2 = Szz * Szz # <<<<<<<<<<<<<< @@ -3524,7 +3551,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Szz2 = (__pyx_v_Szz * __pyx_v_Szz); - /* "MDAnalysis/lib/qcprot.pyx":350 + /* "MDAnalysis/lib/qcprot.pyx":375 * Szz2 = Szz * Szz * * Sxy2 = Sxy * Sxy # <<<<<<<<<<<<<< @@ -3533,7 +3560,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Sxy2 = (__pyx_v_Sxy * __pyx_v_Sxy); - /* "MDAnalysis/lib/qcprot.pyx":351 + /* "MDAnalysis/lib/qcprot.pyx":376 * * Sxy2 = Sxy * Sxy * Syz2 = Syz * Syz # <<<<<<<<<<<<<< @@ -3542,7 +3569,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Syz2 = (__pyx_v_Syz * __pyx_v_Syz); - /* "MDAnalysis/lib/qcprot.pyx":352 + /* "MDAnalysis/lib/qcprot.pyx":377 * Sxy2 = Sxy * Sxy * Syz2 = Syz * Syz * Sxz2 = Sxz * Sxz # <<<<<<<<<<<<<< @@ -3551,7 +3578,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Sxz2 = (__pyx_v_Sxz * __pyx_v_Sxz); - /* "MDAnalysis/lib/qcprot.pyx":354 + /* "MDAnalysis/lib/qcprot.pyx":379 * Sxz2 = Sxz * Sxz * * Syx2 = Syx * Syx # <<<<<<<<<<<<<< @@ -3560,7 +3587,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Syx2 = (__pyx_v_Syx * __pyx_v_Syx); - /* "MDAnalysis/lib/qcprot.pyx":355 + /* "MDAnalysis/lib/qcprot.pyx":380 * * Syx2 = Syx * Syx * Szy2 = Szy * Szy # <<<<<<<<<<<<<< @@ -3569,7 +3596,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Szy2 = (__pyx_v_Szy * __pyx_v_Szy); - /* "MDAnalysis/lib/qcprot.pyx":356 + /* "MDAnalysis/lib/qcprot.pyx":381 * Syx2 = Syx * Syx * Szy2 = Szy * Szy * Szx2 = Szx * Szx # <<<<<<<<<<<<<< @@ -3578,7 +3605,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Szx2 = (__pyx_v_Szx * __pyx_v_Szx); - /* "MDAnalysis/lib/qcprot.pyx":358 + /* "MDAnalysis/lib/qcprot.pyx":383 * Szx2 = Szx * Szx * * SyzSzymSyySzz2 = 2.0 * (Syz*Szy - Syy*Szz) # <<<<<<<<<<<<<< @@ -3587,7 +3614,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SyzSzymSyySzz2 = (2.0 * ((__pyx_v_Syz * __pyx_v_Szy) - (__pyx_v_Syy * __pyx_v_Szz))); - /* "MDAnalysis/lib/qcprot.pyx":359 + /* "MDAnalysis/lib/qcprot.pyx":384 * * SyzSzymSyySzz2 = 2.0 * (Syz*Szy - Syy*Szz) * Sxx2Syy2Szz2Syz2Szy2 = Syy2 + Szz2 - Sxx2 + Syz2 + Szy2 # <<<<<<<<<<<<<< @@ -3596,7 +3623,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Sxx2Syy2Szz2Syz2Szy2 = ((((__pyx_v_Syy2 + __pyx_v_Szz2) - __pyx_v_Sxx2) + __pyx_v_Syz2) + __pyx_v_Szy2); - /* "MDAnalysis/lib/qcprot.pyx":361 + /* "MDAnalysis/lib/qcprot.pyx":386 * Sxx2Syy2Szz2Syz2Szy2 = Syy2 + Szz2 - Sxx2 + Syz2 + Szy2 * * C[2] = -2.0 * (Sxx2 + Syy2 + Szz2 + Sxy2 + Syx2 + Sxz2 + Szx2 + Syz2 + Szy2) # <<<<<<<<<<<<<< @@ -3611,11 +3638,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_C.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 361, __pyx_L1_error) + __PYX_ERR(0, 386, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_C.diminfo[0].strides) = (-2.0 * ((((((((__pyx_v_Sxx2 + __pyx_v_Syy2) + __pyx_v_Szz2) + __pyx_v_Sxy2) + __pyx_v_Syx2) + __pyx_v_Sxz2) + __pyx_v_Szx2) + __pyx_v_Syz2) + __pyx_v_Szy2)); - /* "MDAnalysis/lib/qcprot.pyx":362 + /* "MDAnalysis/lib/qcprot.pyx":387 * * C[2] = -2.0 * (Sxx2 + Syy2 + Szz2 + Sxy2 + Syx2 + Sxz2 + Szx2 + Syz2 + Szy2) * C[1] = 8.0 * (Sxx*Syz*Szy + Syy*Szx*Sxz + Szz*Sxy*Syx - Sxx*Syy*Szz - Syz*Szx*Sxy - Szy*Syx*Sxz) # <<<<<<<<<<<<<< @@ -3630,11 +3657,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_C.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 362, __pyx_L1_error) + __PYX_ERR(0, 387, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_C.diminfo[0].strides) = (8.0 * (((((((__pyx_v_Sxx * __pyx_v_Syz) * __pyx_v_Szy) + ((__pyx_v_Syy * __pyx_v_Szx) * __pyx_v_Sxz)) + ((__pyx_v_Szz * __pyx_v_Sxy) * __pyx_v_Syx)) - ((__pyx_v_Sxx * __pyx_v_Syy) * __pyx_v_Szz)) - ((__pyx_v_Syz * __pyx_v_Szx) * __pyx_v_Sxy)) - ((__pyx_v_Szy * __pyx_v_Syx) * __pyx_v_Sxz))); - /* "MDAnalysis/lib/qcprot.pyx":364 + /* "MDAnalysis/lib/qcprot.pyx":389 * C[1] = 8.0 * (Sxx*Syz*Szy + Syy*Szx*Sxz + Szz*Sxy*Syx - Sxx*Syy*Szz - Syz*Szx*Sxy - Szy*Syx*Sxz) * * SxzpSzx = Sxz + Szx # <<<<<<<<<<<<<< @@ -3643,7 +3670,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SxzpSzx = (__pyx_v_Sxz + __pyx_v_Szx); - /* "MDAnalysis/lib/qcprot.pyx":365 + /* "MDAnalysis/lib/qcprot.pyx":390 * * SxzpSzx = Sxz + Szx * SyzpSzy = Syz + Szy # <<<<<<<<<<<<<< @@ -3652,7 +3679,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SyzpSzy = (__pyx_v_Syz + __pyx_v_Szy); - /* "MDAnalysis/lib/qcprot.pyx":366 + /* "MDAnalysis/lib/qcprot.pyx":391 * SxzpSzx = Sxz + Szx * SyzpSzy = Syz + Szy * SxypSyx = Sxy + Syx # <<<<<<<<<<<<<< @@ -3661,7 +3688,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SxypSyx = (__pyx_v_Sxy + __pyx_v_Syx); - /* "MDAnalysis/lib/qcprot.pyx":367 + /* "MDAnalysis/lib/qcprot.pyx":392 * SyzpSzy = Syz + Szy * SxypSyx = Sxy + Syx * SyzmSzy = Syz - Szy # <<<<<<<<<<<<<< @@ -3670,7 +3697,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SyzmSzy = (__pyx_v_Syz - __pyx_v_Szy); - /* "MDAnalysis/lib/qcprot.pyx":368 + /* "MDAnalysis/lib/qcprot.pyx":393 * SxypSyx = Sxy + Syx * SyzmSzy = Syz - Szy * SxzmSzx = Sxz - Szx # <<<<<<<<<<<<<< @@ -3679,7 +3706,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SxzmSzx = (__pyx_v_Sxz - __pyx_v_Szx); - /* "MDAnalysis/lib/qcprot.pyx":369 + /* "MDAnalysis/lib/qcprot.pyx":394 * SyzmSzy = Syz - Szy * SxzmSzx = Sxz - Szx * SxymSyx = Sxy - Syx # <<<<<<<<<<<<<< @@ -3688,7 +3715,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SxymSyx = (__pyx_v_Sxy - __pyx_v_Syx); - /* "MDAnalysis/lib/qcprot.pyx":370 + /* "MDAnalysis/lib/qcprot.pyx":395 * SxzmSzx = Sxz - Szx * SxymSyx = Sxy - Syx * SxxpSyy = Sxx + Syy # <<<<<<<<<<<<<< @@ -3697,7 +3724,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SxxpSyy = (__pyx_v_Sxx + __pyx_v_Syy); - /* "MDAnalysis/lib/qcprot.pyx":371 + /* "MDAnalysis/lib/qcprot.pyx":396 * SxymSyx = Sxy - Syx * SxxpSyy = Sxx + Syy * SxxmSyy = Sxx - Syy # <<<<<<<<<<<<<< @@ -3706,7 +3733,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_SxxmSyy = (__pyx_v_Sxx - __pyx_v_Syy); - /* "MDAnalysis/lib/qcprot.pyx":372 + /* "MDAnalysis/lib/qcprot.pyx":397 * SxxpSyy = Sxx + Syy * SxxmSyy = Sxx - Syy * Sxy2Sxz2Syx2Szx2 = Sxy2 + Sxz2 - Syx2 - Szx2 # <<<<<<<<<<<<<< @@ -3715,7 +3742,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_Sxy2Sxz2Syx2Szx2 = (((__pyx_v_Sxy2 + __pyx_v_Sxz2) - __pyx_v_Syx2) - __pyx_v_Szx2); - /* "MDAnalysis/lib/qcprot.pyx":374 + /* "MDAnalysis/lib/qcprot.pyx":399 * Sxy2Sxz2Syx2Szx2 = Sxy2 + Sxz2 - Syx2 - Szx2 * * C[0] = (Sxy2Sxz2Syx2Szx2 * Sxy2Sxz2Syx2Szx2 # <<<<<<<<<<<<<< @@ -3730,11 +3757,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_C.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 374, __pyx_L1_error) + __PYX_ERR(0, 399, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_C.diminfo[0].strides) = ((((((__pyx_v_Sxy2Sxz2Syx2Szx2 * __pyx_v_Sxy2Sxz2Syx2Szx2) + ((__pyx_v_Sxx2Syy2Szz2Syz2Szy2 + __pyx_v_SyzSzymSyySzz2) * (__pyx_v_Sxx2Syy2Szz2Syz2Szy2 - __pyx_v_SyzSzymSyySzz2))) + ((((-__pyx_v_SxzpSzx) * __pyx_v_SyzmSzy) + (__pyx_v_SxymSyx * (__pyx_v_SxxmSyy - __pyx_v_Szz))) * (((-__pyx_v_SxzmSzx) * __pyx_v_SyzpSzy) + (__pyx_v_SxymSyx * (__pyx_v_SxxmSyy + __pyx_v_Szz))))) + ((((-__pyx_v_SxzpSzx) * __pyx_v_SyzpSzy) - (__pyx_v_SxypSyx * (__pyx_v_SxxpSyy - __pyx_v_Szz))) * (((-__pyx_v_SxzmSzx) * __pyx_v_SyzmSzy) - (__pyx_v_SxypSyx * (__pyx_v_SxxpSyy + __pyx_v_Szz))))) + (((__pyx_v_SxypSyx * __pyx_v_SyzpSzy) + (__pyx_v_SxzpSzx * (__pyx_v_SxxmSyy + __pyx_v_Szz))) * (((-__pyx_v_SxymSyx) * __pyx_v_SyzmSzy) + (__pyx_v_SxzpSzx * (__pyx_v_SxxpSyy + __pyx_v_Szz))))) + (((__pyx_v_SxypSyx * __pyx_v_SyzmSzy) + (__pyx_v_SxzmSzx * (__pyx_v_SxxmSyy - __pyx_v_Szz))) * (((-__pyx_v_SxymSyx) * __pyx_v_SyzpSzy) + (__pyx_v_SxzmSzx * (__pyx_v_SxxpSyy - __pyx_v_Szz))))); - /* "MDAnalysis/lib/qcprot.pyx":381 + /* "MDAnalysis/lib/qcprot.pyx":406 * + (+(SxypSyx)*(SyzmSzy)+(SxzmSzx)*(SxxmSyy-Szz)) * (-(SxymSyx)*(SyzpSzy)+(SxzmSzx)*(SxxpSyy-Szz))) * * mxEigenV = E0 # <<<<<<<<<<<<<< @@ -3743,7 +3770,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_mxEigenV = __pyx_v_E0; - /* "MDAnalysis/lib/qcprot.pyx":382 + /* "MDAnalysis/lib/qcprot.pyx":407 * * mxEigenV = E0 * for i in range(50): # <<<<<<<<<<<<<< @@ -3753,7 +3780,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT for (__pyx_t_17 = 0; __pyx_t_17 < 50; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; - /* "MDAnalysis/lib/qcprot.pyx":383 + /* "MDAnalysis/lib/qcprot.pyx":408 * mxEigenV = E0 * for i in range(50): * oldg = mxEigenV # <<<<<<<<<<<<<< @@ -3762,7 +3789,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_oldg = __pyx_v_mxEigenV; - /* "MDAnalysis/lib/qcprot.pyx":384 + /* "MDAnalysis/lib/qcprot.pyx":409 * for i in range(50): * oldg = mxEigenV * x2 = mxEigenV*mxEigenV # <<<<<<<<<<<<<< @@ -3771,7 +3798,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_x2 = (__pyx_v_mxEigenV * __pyx_v_mxEigenV); - /* "MDAnalysis/lib/qcprot.pyx":385 + /* "MDAnalysis/lib/qcprot.pyx":410 * oldg = mxEigenV * x2 = mxEigenV*mxEigenV * b = (x2 + C[2])*mxEigenV # <<<<<<<<<<<<<< @@ -3786,11 +3813,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_C.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 385, __pyx_L1_error) + __PYX_ERR(0, 410, __pyx_L1_error) } __pyx_v_b = ((__pyx_v_x2 + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_C.diminfo[0].strides))) * __pyx_v_mxEigenV); - /* "MDAnalysis/lib/qcprot.pyx":386 + /* "MDAnalysis/lib/qcprot.pyx":411 * x2 = mxEigenV*mxEigenV * b = (x2 + C[2])*mxEigenV * a = b + C[1] # <<<<<<<<<<<<<< @@ -3805,11 +3832,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_C.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 386, __pyx_L1_error) + __PYX_ERR(0, 411, __pyx_L1_error) } __pyx_v_a = (__pyx_v_b + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_C.diminfo[0].strides))); - /* "MDAnalysis/lib/qcprot.pyx":387 + /* "MDAnalysis/lib/qcprot.pyx":412 * b = (x2 + C[2])*mxEigenV * a = b + C[1] * delta = ((a*mxEigenV + C[0])/(2.0*x2*mxEigenV + b + a)) # <<<<<<<<<<<<<< @@ -3824,17 +3851,17 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_C.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 412, __pyx_L1_error) } __pyx_t_21 = ((__pyx_v_a * __pyx_v_mxEigenV) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_C.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_C.diminfo[0].strides))); __pyx_t_22 = ((((2.0 * __pyx_v_x2) * __pyx_v_mxEigenV) + __pyx_v_b) + __pyx_v_a); if (unlikely(__pyx_t_22 == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 387, __pyx_L1_error) + __PYX_ERR(0, 412, __pyx_L1_error) } __pyx_v_delta = (__pyx_t_21 / __pyx_t_22); - /* "MDAnalysis/lib/qcprot.pyx":388 + /* "MDAnalysis/lib/qcprot.pyx":413 * a = b + C[1] * delta = ((a*mxEigenV + C[0])/(2.0*x2*mxEigenV + b + a)) * mxEigenV -= delta # <<<<<<<<<<<<<< @@ -3843,7 +3870,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_mxEigenV = (__pyx_v_mxEigenV - __pyx_v_delta); - /* "MDAnalysis/lib/qcprot.pyx":389 + /* "MDAnalysis/lib/qcprot.pyx":414 * delta = ((a*mxEigenV + C[0])/(2.0*x2*mxEigenV + b + a)) * mxEigenV -= delta * if (fabs(mxEigenV - oldg) < fabs((evalprec)*mxEigenV)): # <<<<<<<<<<<<<< @@ -3853,7 +3880,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_t_23 = ((fabs((__pyx_v_mxEigenV - __pyx_v_oldg)) < fabs((__pyx_v_evalprec * __pyx_v_mxEigenV))) != 0); if (__pyx_t_23) { - /* "MDAnalysis/lib/qcprot.pyx":390 + /* "MDAnalysis/lib/qcprot.pyx":415 * mxEigenV -= delta * if (fabs(mxEigenV - oldg) < fabs((evalprec)*mxEigenV)): * break # <<<<<<<<<<<<<< @@ -3862,7 +3889,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ goto __pyx_L4_break; - /* "MDAnalysis/lib/qcprot.pyx":389 + /* "MDAnalysis/lib/qcprot.pyx":414 * delta = ((a*mxEigenV + C[0])/(2.0*x2*mxEigenV + b + a)) * mxEigenV -= delta * if (fabs(mxEigenV - oldg) < fabs((evalprec)*mxEigenV)): # <<<<<<<<<<<<<< @@ -3873,7 +3900,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } __pyx_L4_break:; - /* "MDAnalysis/lib/qcprot.pyx":397 + /* "MDAnalysis/lib/qcprot.pyx":422 * # the fabs() is to guard against extremely small, * # but *negative* numbers due to floating point error * rms = sqrt(fabs(2.0 * (E0 - mxEigenV)/N)) # <<<<<<<<<<<<<< @@ -3883,11 +3910,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_t_22 = (2.0 * (__pyx_v_E0 - __pyx_v_mxEigenV)); if (unlikely(__pyx_v_N == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 397, __pyx_L1_error) + __PYX_ERR(0, 422, __pyx_L1_error) } __pyx_v_rms = sqrt(fabs((__pyx_t_22 / __pyx_v_N))); - /* "MDAnalysis/lib/qcprot.pyx":399 + /* "MDAnalysis/lib/qcprot.pyx":424 * rms = sqrt(fabs(2.0 * (E0 - mxEigenV)/N)) * * if (rot is None): # <<<<<<<<<<<<<< @@ -3898,7 +3925,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_t_24 = (__pyx_t_23 != 0); if (__pyx_t_24) { - /* "MDAnalysis/lib/qcprot.pyx":400 + /* "MDAnalysis/lib/qcprot.pyx":425 * * if (rot is None): * return rms # Don't bother with rotation. # <<<<<<<<<<<<<< @@ -3906,13 +3933,13 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT * a11 = SxxpSyy + Szz-mxEigenV */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/qcprot.pyx":399 + /* "MDAnalysis/lib/qcprot.pyx":424 * rms = sqrt(fabs(2.0 * (E0 - mxEigenV)/N)) * * if (rot is None): # <<<<<<<<<<<<<< @@ -3921,7 +3948,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ } - /* "MDAnalysis/lib/qcprot.pyx":402 + /* "MDAnalysis/lib/qcprot.pyx":427 * return rms # Don't bother with rotation. * * a11 = SxxpSyy + Szz-mxEigenV # <<<<<<<<<<<<<< @@ -3930,7 +3957,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a11 = ((__pyx_v_SxxpSyy + __pyx_v_Szz) - __pyx_v_mxEigenV); - /* "MDAnalysis/lib/qcprot.pyx":403 + /* "MDAnalysis/lib/qcprot.pyx":428 * * a11 = SxxpSyy + Szz-mxEigenV * a12 = SyzmSzy # <<<<<<<<<<<<<< @@ -3939,7 +3966,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a12 = __pyx_v_SyzmSzy; - /* "MDAnalysis/lib/qcprot.pyx":404 + /* "MDAnalysis/lib/qcprot.pyx":429 * a11 = SxxpSyy + Szz-mxEigenV * a12 = SyzmSzy * a13 = - SxzmSzx # <<<<<<<<<<<<<< @@ -3948,7 +3975,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a13 = (-__pyx_v_SxzmSzx); - /* "MDAnalysis/lib/qcprot.pyx":405 + /* "MDAnalysis/lib/qcprot.pyx":430 * a12 = SyzmSzy * a13 = - SxzmSzx * a14 = SxymSyx # <<<<<<<<<<<<<< @@ -3957,7 +3984,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a14 = __pyx_v_SxymSyx; - /* "MDAnalysis/lib/qcprot.pyx":406 + /* "MDAnalysis/lib/qcprot.pyx":431 * a13 = - SxzmSzx * a14 = SxymSyx * a21 = SyzmSzy # <<<<<<<<<<<<<< @@ -3966,7 +3993,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a21 = __pyx_v_SyzmSzy; - /* "MDAnalysis/lib/qcprot.pyx":407 + /* "MDAnalysis/lib/qcprot.pyx":432 * a14 = SxymSyx * a21 = SyzmSzy * a22 = SxxmSyy - Szz-mxEigenV # <<<<<<<<<<<<<< @@ -3975,7 +4002,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a22 = ((__pyx_v_SxxmSyy - __pyx_v_Szz) - __pyx_v_mxEigenV); - /* "MDAnalysis/lib/qcprot.pyx":408 + /* "MDAnalysis/lib/qcprot.pyx":433 * a21 = SyzmSzy * a22 = SxxmSyy - Szz-mxEigenV * a23 = SxypSyx # <<<<<<<<<<<<<< @@ -3984,7 +4011,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a23 = __pyx_v_SxypSyx; - /* "MDAnalysis/lib/qcprot.pyx":409 + /* "MDAnalysis/lib/qcprot.pyx":434 * a22 = SxxmSyy - Szz-mxEigenV * a23 = SxypSyx * a24= SxzpSzx # <<<<<<<<<<<<<< @@ -3993,7 +4020,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a24 = __pyx_v_SxzpSzx; - /* "MDAnalysis/lib/qcprot.pyx":410 + /* "MDAnalysis/lib/qcprot.pyx":435 * a23 = SxypSyx * a24= SxzpSzx * a31 = a13 # <<<<<<<<<<<<<< @@ -4002,7 +4029,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a31 = __pyx_v_a13; - /* "MDAnalysis/lib/qcprot.pyx":411 + /* "MDAnalysis/lib/qcprot.pyx":436 * a24= SxzpSzx * a31 = a13 * a32 = a23 # <<<<<<<<<<<<<< @@ -4011,7 +4038,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a32 = __pyx_v_a23; - /* "MDAnalysis/lib/qcprot.pyx":412 + /* "MDAnalysis/lib/qcprot.pyx":437 * a31 = a13 * a32 = a23 * a33 = Syy-Sxx-Szz - mxEigenV # <<<<<<<<<<<<<< @@ -4020,7 +4047,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a33 = (((__pyx_v_Syy - __pyx_v_Sxx) - __pyx_v_Szz) - __pyx_v_mxEigenV); - /* "MDAnalysis/lib/qcprot.pyx":413 + /* "MDAnalysis/lib/qcprot.pyx":438 * a32 = a23 * a33 = Syy-Sxx-Szz - mxEigenV * a34 = SyzpSzy # <<<<<<<<<<<<<< @@ -4029,7 +4056,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a34 = __pyx_v_SyzpSzy; - /* "MDAnalysis/lib/qcprot.pyx":414 + /* "MDAnalysis/lib/qcprot.pyx":439 * a33 = Syy-Sxx-Szz - mxEigenV * a34 = SyzpSzy * a41 = a14 # <<<<<<<<<<<<<< @@ -4038,7 +4065,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a41 = __pyx_v_a14; - /* "MDAnalysis/lib/qcprot.pyx":415 + /* "MDAnalysis/lib/qcprot.pyx":440 * a34 = SyzpSzy * a41 = a14 * a42 = a24 # <<<<<<<<<<<<<< @@ -4047,7 +4074,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a42 = __pyx_v_a24; - /* "MDAnalysis/lib/qcprot.pyx":416 + /* "MDAnalysis/lib/qcprot.pyx":441 * a41 = a14 * a42 = a24 * a43 = a34 # <<<<<<<<<<<<<< @@ -4056,7 +4083,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a43 = __pyx_v_a34; - /* "MDAnalysis/lib/qcprot.pyx":417 + /* "MDAnalysis/lib/qcprot.pyx":442 * a42 = a24 * a43 = a34 * a44 = Szz - SxxpSyy - mxEigenV # <<<<<<<<<<<<<< @@ -4065,7 +4092,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a44 = ((__pyx_v_Szz - __pyx_v_SxxpSyy) - __pyx_v_mxEigenV); - /* "MDAnalysis/lib/qcprot.pyx":418 + /* "MDAnalysis/lib/qcprot.pyx":443 * a43 = a34 * a44 = Szz - SxxpSyy - mxEigenV * a3344_4334 = a33 * a44 - a43 * a34 # <<<<<<<<<<<<<< @@ -4074,7 +4101,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a3344_4334 = ((__pyx_v_a33 * __pyx_v_a44) - (__pyx_v_a43 * __pyx_v_a34)); - /* "MDAnalysis/lib/qcprot.pyx":419 + /* "MDAnalysis/lib/qcprot.pyx":444 * a44 = Szz - SxxpSyy - mxEigenV * a3344_4334 = a33 * a44 - a43 * a34 * a3244_4234 = a32 * a44-a42*a34 # <<<<<<<<<<<<<< @@ -4083,7 +4110,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a3244_4234 = ((__pyx_v_a32 * __pyx_v_a44) - (__pyx_v_a42 * __pyx_v_a34)); - /* "MDAnalysis/lib/qcprot.pyx":420 + /* "MDAnalysis/lib/qcprot.pyx":445 * a3344_4334 = a33 * a44 - a43 * a34 * a3244_4234 = a32 * a44-a42*a34 * a3243_4233 = a32 * a43 - a42 * a33 # <<<<<<<<<<<<<< @@ -4092,7 +4119,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a3243_4233 = ((__pyx_v_a32 * __pyx_v_a43) - (__pyx_v_a42 * __pyx_v_a33)); - /* "MDAnalysis/lib/qcprot.pyx":421 + /* "MDAnalysis/lib/qcprot.pyx":446 * a3244_4234 = a32 * a44-a42*a34 * a3243_4233 = a32 * a43 - a42 * a33 * a3143_4133 = a31 * a43-a41*a33 # <<<<<<<<<<<<<< @@ -4101,7 +4128,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a3143_4133 = ((__pyx_v_a31 * __pyx_v_a43) - (__pyx_v_a41 * __pyx_v_a33)); - /* "MDAnalysis/lib/qcprot.pyx":422 + /* "MDAnalysis/lib/qcprot.pyx":447 * a3243_4233 = a32 * a43 - a42 * a33 * a3143_4133 = a31 * a43-a41*a33 * a3144_4134 = a31 * a44 - a41 * a34 # <<<<<<<<<<<<<< @@ -4110,7 +4137,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a3144_4134 = ((__pyx_v_a31 * __pyx_v_a44) - (__pyx_v_a41 * __pyx_v_a34)); - /* "MDAnalysis/lib/qcprot.pyx":423 + /* "MDAnalysis/lib/qcprot.pyx":448 * a3143_4133 = a31 * a43-a41*a33 * a3144_4134 = a31 * a44 - a41 * a34 * a3142_4132 = a31 * a42-a41*a32 # <<<<<<<<<<<<<< @@ -4119,7 +4146,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a3142_4132 = ((__pyx_v_a31 * __pyx_v_a42) - (__pyx_v_a41 * __pyx_v_a32)); - /* "MDAnalysis/lib/qcprot.pyx":424 + /* "MDAnalysis/lib/qcprot.pyx":449 * a3144_4134 = a31 * a44 - a41 * a34 * a3142_4132 = a31 * a42-a41*a32 * q1 = a22*a3344_4334-a23*a3244_4234+a24*a3243_4233 # <<<<<<<<<<<<<< @@ -4128,7 +4155,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q1 = (((__pyx_v_a22 * __pyx_v_a3344_4334) - (__pyx_v_a23 * __pyx_v_a3244_4234)) + (__pyx_v_a24 * __pyx_v_a3243_4233)); - /* "MDAnalysis/lib/qcprot.pyx":425 + /* "MDAnalysis/lib/qcprot.pyx":450 * a3142_4132 = a31 * a42-a41*a32 * q1 = a22*a3344_4334-a23*a3244_4234+a24*a3243_4233 * q2 = -a21*a3344_4334+a23*a3144_4134-a24*a3143_4133 # <<<<<<<<<<<<<< @@ -4137,7 +4164,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q2 = ((((-__pyx_v_a21) * __pyx_v_a3344_4334) + (__pyx_v_a23 * __pyx_v_a3144_4134)) - (__pyx_v_a24 * __pyx_v_a3143_4133)); - /* "MDAnalysis/lib/qcprot.pyx":426 + /* "MDAnalysis/lib/qcprot.pyx":451 * q1 = a22*a3344_4334-a23*a3244_4234+a24*a3243_4233 * q2 = -a21*a3344_4334+a23*a3144_4134-a24*a3143_4133 * q3 = a21*a3244_4234-a22*a3144_4134+a24*a3142_4132 # <<<<<<<<<<<<<< @@ -4146,7 +4173,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q3 = (((__pyx_v_a21 * __pyx_v_a3244_4234) - (__pyx_v_a22 * __pyx_v_a3144_4134)) + (__pyx_v_a24 * __pyx_v_a3142_4132)); - /* "MDAnalysis/lib/qcprot.pyx":427 + /* "MDAnalysis/lib/qcprot.pyx":452 * q2 = -a21*a3344_4334+a23*a3144_4134-a24*a3143_4133 * q3 = a21*a3244_4234-a22*a3144_4134+a24*a3142_4132 * q4 = -a21*a3243_4233+a22*a3143_4133-a23*a3142_4132 # <<<<<<<<<<<<<< @@ -4155,7 +4182,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q4 = ((((-__pyx_v_a21) * __pyx_v_a3243_4233) + (__pyx_v_a22 * __pyx_v_a3143_4133)) - (__pyx_v_a23 * __pyx_v_a3142_4132)); - /* "MDAnalysis/lib/qcprot.pyx":429 + /* "MDAnalysis/lib/qcprot.pyx":454 * q4 = -a21*a3243_4233+a22*a3143_4133-a23*a3142_4132 * * qsqr = q1 * q1 + q2 * q2 + q3 * q3 + q4 * q4 # <<<<<<<<<<<<<< @@ -4164,7 +4191,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_qsqr = ((((__pyx_v_q1 * __pyx_v_q1) + (__pyx_v_q2 * __pyx_v_q2)) + (__pyx_v_q3 * __pyx_v_q3)) + (__pyx_v_q4 * __pyx_v_q4)); - /* "MDAnalysis/lib/qcprot.pyx":436 + /* "MDAnalysis/lib/qcprot.pyx":461 * # uncommented, but it is most likely unnecessary. * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4174,7 +4201,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_t_24 = ((__pyx_v_qsqr < __pyx_v_evecprec) != 0); if (__pyx_t_24) { - /* "MDAnalysis/lib/qcprot.pyx":437 + /* "MDAnalysis/lib/qcprot.pyx":462 * * if (qsqr < evecprec): * q1 = a12*a3344_4334 - a13*a3244_4234 + a14*a3243_4233 # <<<<<<<<<<<<<< @@ -4183,7 +4210,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q1 = (((__pyx_v_a12 * __pyx_v_a3344_4334) - (__pyx_v_a13 * __pyx_v_a3244_4234)) + (__pyx_v_a14 * __pyx_v_a3243_4233)); - /* "MDAnalysis/lib/qcprot.pyx":438 + /* "MDAnalysis/lib/qcprot.pyx":463 * if (qsqr < evecprec): * q1 = a12*a3344_4334 - a13*a3244_4234 + a14*a3243_4233 * q2 = -a11*a3344_4334 + a13*a3144_4134 - a14*a3143_4133 # <<<<<<<<<<<<<< @@ -4192,7 +4219,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q2 = ((((-__pyx_v_a11) * __pyx_v_a3344_4334) + (__pyx_v_a13 * __pyx_v_a3144_4134)) - (__pyx_v_a14 * __pyx_v_a3143_4133)); - /* "MDAnalysis/lib/qcprot.pyx":439 + /* "MDAnalysis/lib/qcprot.pyx":464 * q1 = a12*a3344_4334 - a13*a3244_4234 + a14*a3243_4233 * q2 = -a11*a3344_4334 + a13*a3144_4134 - a14*a3143_4133 * q3 = a11*a3244_4234 - a12*a3144_4134 + a14*a3142_4132 # <<<<<<<<<<<<<< @@ -4201,7 +4228,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q3 = (((__pyx_v_a11 * __pyx_v_a3244_4234) - (__pyx_v_a12 * __pyx_v_a3144_4134)) + (__pyx_v_a14 * __pyx_v_a3142_4132)); - /* "MDAnalysis/lib/qcprot.pyx":440 + /* "MDAnalysis/lib/qcprot.pyx":465 * q2 = -a11*a3344_4334 + a13*a3144_4134 - a14*a3143_4133 * q3 = a11*a3244_4234 - a12*a3144_4134 + a14*a3142_4132 * q4 = -a11*a3243_4233 + a12*a3143_4133 - a13*a3142_4132 # <<<<<<<<<<<<<< @@ -4210,7 +4237,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q4 = ((((-__pyx_v_a11) * __pyx_v_a3243_4233) + (__pyx_v_a12 * __pyx_v_a3143_4133)) - (__pyx_v_a13 * __pyx_v_a3142_4132)); - /* "MDAnalysis/lib/qcprot.pyx":441 + /* "MDAnalysis/lib/qcprot.pyx":466 * q3 = a11*a3244_4234 - a12*a3144_4134 + a14*a3142_4132 * q4 = -a11*a3243_4233 + a12*a3143_4133 - a13*a3142_4132 * qsqr = q1*q1 + q2 *q2 + q3*q3+q4*q4 # <<<<<<<<<<<<<< @@ -4219,7 +4246,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_qsqr = ((((__pyx_v_q1 * __pyx_v_q1) + (__pyx_v_q2 * __pyx_v_q2)) + (__pyx_v_q3 * __pyx_v_q3)) + (__pyx_v_q4 * __pyx_v_q4)); - /* "MDAnalysis/lib/qcprot.pyx":443 + /* "MDAnalysis/lib/qcprot.pyx":468 * qsqr = q1*q1 + q2 *q2 + q3*q3+q4*q4 * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4229,7 +4256,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_t_24 = ((__pyx_v_qsqr < __pyx_v_evecprec) != 0); if (__pyx_t_24) { - /* "MDAnalysis/lib/qcprot.pyx":444 + /* "MDAnalysis/lib/qcprot.pyx":469 * * if (qsqr < evecprec): * a1324_1423 = a13 * a24 - a14 * a23 # <<<<<<<<<<<<<< @@ -4238,7 +4265,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a1324_1423 = ((__pyx_v_a13 * __pyx_v_a24) - (__pyx_v_a14 * __pyx_v_a23)); - /* "MDAnalysis/lib/qcprot.pyx":445 + /* "MDAnalysis/lib/qcprot.pyx":470 * if (qsqr < evecprec): * a1324_1423 = a13 * a24 - a14 * a23 * a1224_1422 = a12 * a24 - a14 * a22 # <<<<<<<<<<<<<< @@ -4247,7 +4274,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a1224_1422 = ((__pyx_v_a12 * __pyx_v_a24) - (__pyx_v_a14 * __pyx_v_a22)); - /* "MDAnalysis/lib/qcprot.pyx":446 + /* "MDAnalysis/lib/qcprot.pyx":471 * a1324_1423 = a13 * a24 - a14 * a23 * a1224_1422 = a12 * a24 - a14 * a22 * a1223_1322 = a12 * a23 - a13 * a22 # <<<<<<<<<<<<<< @@ -4256,7 +4283,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a1223_1322 = ((__pyx_v_a12 * __pyx_v_a23) - (__pyx_v_a13 * __pyx_v_a22)); - /* "MDAnalysis/lib/qcprot.pyx":447 + /* "MDAnalysis/lib/qcprot.pyx":472 * a1224_1422 = a12 * a24 - a14 * a22 * a1223_1322 = a12 * a23 - a13 * a22 * a1124_1421 = a11 * a24 - a14 * a21 # <<<<<<<<<<<<<< @@ -4265,7 +4292,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a1124_1421 = ((__pyx_v_a11 * __pyx_v_a24) - (__pyx_v_a14 * __pyx_v_a21)); - /* "MDAnalysis/lib/qcprot.pyx":448 + /* "MDAnalysis/lib/qcprot.pyx":473 * a1223_1322 = a12 * a23 - a13 * a22 * a1124_1421 = a11 * a24 - a14 * a21 * a1123_1321 = a11 * a23 - a13 * a21 # <<<<<<<<<<<<<< @@ -4274,7 +4301,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a1123_1321 = ((__pyx_v_a11 * __pyx_v_a23) - (__pyx_v_a13 * __pyx_v_a21)); - /* "MDAnalysis/lib/qcprot.pyx":449 + /* "MDAnalysis/lib/qcprot.pyx":474 * a1124_1421 = a11 * a24 - a14 * a21 * a1123_1321 = a11 * a23 - a13 * a21 * a1122_1221 = a11 * a22 - a12 * a21 # <<<<<<<<<<<<<< @@ -4283,7 +4310,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a1122_1221 = ((__pyx_v_a11 * __pyx_v_a22) - (__pyx_v_a12 * __pyx_v_a21)); - /* "MDAnalysis/lib/qcprot.pyx":451 + /* "MDAnalysis/lib/qcprot.pyx":476 * a1122_1221 = a11 * a22 - a12 * a21 * * q1 = a42 * a1324_1423 - a43 * a1224_1422 + a44 * a1223_1322 # <<<<<<<<<<<<<< @@ -4292,7 +4319,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q1 = (((__pyx_v_a42 * __pyx_v_a1324_1423) - (__pyx_v_a43 * __pyx_v_a1224_1422)) + (__pyx_v_a44 * __pyx_v_a1223_1322)); - /* "MDAnalysis/lib/qcprot.pyx":452 + /* "MDAnalysis/lib/qcprot.pyx":477 * * q1 = a42 * a1324_1423 - a43 * a1224_1422 + a44 * a1223_1322 * q2 = -a41 * a1324_1423 + a43 * a1124_1421 - a44 * a1123_1321 # <<<<<<<<<<<<<< @@ -4301,7 +4328,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q2 = ((((-__pyx_v_a41) * __pyx_v_a1324_1423) + (__pyx_v_a43 * __pyx_v_a1124_1421)) - (__pyx_v_a44 * __pyx_v_a1123_1321)); - /* "MDAnalysis/lib/qcprot.pyx":453 + /* "MDAnalysis/lib/qcprot.pyx":478 * q1 = a42 * a1324_1423 - a43 * a1224_1422 + a44 * a1223_1322 * q2 = -a41 * a1324_1423 + a43 * a1124_1421 - a44 * a1123_1321 * q3 = a41 * a1224_1422 - a42 * a1124_1421 + a44 * a1122_1221 # <<<<<<<<<<<<<< @@ -4310,7 +4337,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q3 = (((__pyx_v_a41 * __pyx_v_a1224_1422) - (__pyx_v_a42 * __pyx_v_a1124_1421)) + (__pyx_v_a44 * __pyx_v_a1122_1221)); - /* "MDAnalysis/lib/qcprot.pyx":454 + /* "MDAnalysis/lib/qcprot.pyx":479 * q2 = -a41 * a1324_1423 + a43 * a1124_1421 - a44 * a1123_1321 * q3 = a41 * a1224_1422 - a42 * a1124_1421 + a44 * a1122_1221 * q4 = -a41 * a1223_1322 + a42 * a1123_1321 - a43 * a1122_1221 # <<<<<<<<<<<<<< @@ -4319,7 +4346,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q4 = ((((-__pyx_v_a41) * __pyx_v_a1223_1322) + (__pyx_v_a42 * __pyx_v_a1123_1321)) - (__pyx_v_a43 * __pyx_v_a1122_1221)); - /* "MDAnalysis/lib/qcprot.pyx":455 + /* "MDAnalysis/lib/qcprot.pyx":480 * q3 = a41 * a1224_1422 - a42 * a1124_1421 + a44 * a1122_1221 * q4 = -a41 * a1223_1322 + a42 * a1123_1321 - a43 * a1122_1221 * qsqr = q1*q1 + q2 *q2 + q3*q3+q4*q4 # <<<<<<<<<<<<<< @@ -4328,7 +4355,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_qsqr = ((((__pyx_v_q1 * __pyx_v_q1) + (__pyx_v_q2 * __pyx_v_q2)) + (__pyx_v_q3 * __pyx_v_q3)) + (__pyx_v_q4 * __pyx_v_q4)); - /* "MDAnalysis/lib/qcprot.pyx":457 + /* "MDAnalysis/lib/qcprot.pyx":482 * qsqr = q1*q1 + q2 *q2 + q3*q3+q4*q4 * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4338,7 +4365,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_t_24 = ((__pyx_v_qsqr < __pyx_v_evecprec) != 0); if (__pyx_t_24) { - /* "MDAnalysis/lib/qcprot.pyx":458 + /* "MDAnalysis/lib/qcprot.pyx":483 * * if (qsqr < evecprec): * q1 = a32 * a1324_1423 - a33 * a1224_1422 + a34 * a1223_1322 # <<<<<<<<<<<<<< @@ -4347,7 +4374,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q1 = (((__pyx_v_a32 * __pyx_v_a1324_1423) - (__pyx_v_a33 * __pyx_v_a1224_1422)) + (__pyx_v_a34 * __pyx_v_a1223_1322)); - /* "MDAnalysis/lib/qcprot.pyx":459 + /* "MDAnalysis/lib/qcprot.pyx":484 * if (qsqr < evecprec): * q1 = a32 * a1324_1423 - a33 * a1224_1422 + a34 * a1223_1322 * q2 = -a31 * a1324_1423 + a33 * a1124_1421 - a34 * a1123_1321 # <<<<<<<<<<<<<< @@ -4356,7 +4383,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q2 = ((((-__pyx_v_a31) * __pyx_v_a1324_1423) + (__pyx_v_a33 * __pyx_v_a1124_1421)) - (__pyx_v_a34 * __pyx_v_a1123_1321)); - /* "MDAnalysis/lib/qcprot.pyx":460 + /* "MDAnalysis/lib/qcprot.pyx":485 * q1 = a32 * a1324_1423 - a33 * a1224_1422 + a34 * a1223_1322 * q2 = -a31 * a1324_1423 + a33 * a1124_1421 - a34 * a1123_1321 * q3 = a31 * a1224_1422 - a32 * a1124_1421 + a34 * a1122_1221 # <<<<<<<<<<<<<< @@ -4365,7 +4392,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q3 = (((__pyx_v_a31 * __pyx_v_a1224_1422) - (__pyx_v_a32 * __pyx_v_a1124_1421)) + (__pyx_v_a34 * __pyx_v_a1122_1221)); - /* "MDAnalysis/lib/qcprot.pyx":461 + /* "MDAnalysis/lib/qcprot.pyx":486 * q2 = -a31 * a1324_1423 + a33 * a1124_1421 - a34 * a1123_1321 * q3 = a31 * a1224_1422 - a32 * a1124_1421 + a34 * a1122_1221 * q4 = -a31 * a1223_1322 + a32 * a1123_1321 - a33 * a1122_1221 # <<<<<<<<<<<<<< @@ -4374,7 +4401,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_q4 = ((((-__pyx_v_a31) * __pyx_v_a1223_1322) + (__pyx_v_a32 * __pyx_v_a1123_1321)) - (__pyx_v_a33 * __pyx_v_a1122_1221)); - /* "MDAnalysis/lib/qcprot.pyx":462 + /* "MDAnalysis/lib/qcprot.pyx":487 * q3 = a31 * a1224_1422 - a32 * a1124_1421 + a34 * a1122_1221 * q4 = -a31 * a1223_1322 + a32 * a1123_1321 - a33 * a1122_1221 * qsqr = q1*q1 + q2 *q2 + q3*q3 + q4*q4 # <<<<<<<<<<<<<< @@ -4383,7 +4410,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_qsqr = ((((__pyx_v_q1 * __pyx_v_q1) + (__pyx_v_q2 * __pyx_v_q2)) + (__pyx_v_q3 * __pyx_v_q3)) + (__pyx_v_q4 * __pyx_v_q4)); - /* "MDAnalysis/lib/qcprot.pyx":464 + /* "MDAnalysis/lib/qcprot.pyx":489 * qsqr = q1*q1 + q2 *q2 + q3*q3 + q4*q4 * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4393,7 +4420,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_t_24 = ((__pyx_v_qsqr < __pyx_v_evecprec) != 0); if (__pyx_t_24) { - /* "MDAnalysis/lib/qcprot.pyx":466 + /* "MDAnalysis/lib/qcprot.pyx":491 * if (qsqr < evecprec): * # if qsqr is still too small, return the identity matrix. # * rot[0] = rot[4] = rot[8] = 1.0 # <<<<<<<<<<<<<< @@ -4408,7 +4435,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 466, __pyx_L1_error) + __PYX_ERR(0, 491, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_rot.diminfo[0].strides) = 1.0; __pyx_t_26 = 4; @@ -4419,7 +4446,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 466, __pyx_L1_error) + __PYX_ERR(0, 491, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_rot.diminfo[0].strides) = 1.0; __pyx_t_27 = 8; @@ -4430,11 +4457,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 466, __pyx_L1_error) + __PYX_ERR(0, 491, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_rot.diminfo[0].strides) = 1.0; - /* "MDAnalysis/lib/qcprot.pyx":467 + /* "MDAnalysis/lib/qcprot.pyx":492 * # if qsqr is still too small, return the identity matrix. # * rot[0] = rot[4] = rot[8] = 1.0 * rot[1] = rot[2] = rot[3] = rot[5] = rot[6] = rot[7] = 0.0 # <<<<<<<<<<<<<< @@ -4449,7 +4476,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 467, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rot.diminfo[0].strides) = 0.0; __pyx_t_29 = 2; @@ -4460,7 +4487,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 467, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_rot.diminfo[0].strides) = 0.0; __pyx_t_30 = 3; @@ -4471,7 +4498,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 467, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_rot.diminfo[0].strides) = 0.0; __pyx_t_31 = 5; @@ -4482,7 +4509,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 467, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_rot.diminfo[0].strides) = 0.0; __pyx_t_32 = 6; @@ -4493,7 +4520,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 467, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_rot.diminfo[0].strides) = 0.0; __pyx_t_33 = 7; @@ -4504,11 +4531,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 467, __pyx_L1_error) + __PYX_ERR(0, 492, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_rot.diminfo[0].strides) = 0.0; - /* "MDAnalysis/lib/qcprot.pyx":469 + /* "MDAnalysis/lib/qcprot.pyx":494 * rot[1] = rot[2] = rot[3] = rot[5] = rot[6] = rot[7] = 0.0 * * return # <<<<<<<<<<<<<< @@ -4519,7 +4546,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "MDAnalysis/lib/qcprot.pyx":464 + /* "MDAnalysis/lib/qcprot.pyx":489 * qsqr = q1*q1 + q2 *q2 + q3*q3 + q4*q4 * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4528,7 +4555,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ } - /* "MDAnalysis/lib/qcprot.pyx":457 + /* "MDAnalysis/lib/qcprot.pyx":482 * qsqr = q1*q1 + q2 *q2 + q3*q3+q4*q4 * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4537,7 +4564,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ } - /* "MDAnalysis/lib/qcprot.pyx":443 + /* "MDAnalysis/lib/qcprot.pyx":468 * qsqr = q1*q1 + q2 *q2 + q3*q3+q4*q4 * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4546,7 +4573,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ } - /* "MDAnalysis/lib/qcprot.pyx":436 + /* "MDAnalysis/lib/qcprot.pyx":461 * # uncommented, but it is most likely unnecessary. * * if (qsqr < evecprec): # <<<<<<<<<<<<<< @@ -4555,7 +4582,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ } - /* "MDAnalysis/lib/qcprot.pyx":472 + /* "MDAnalysis/lib/qcprot.pyx":497 * * * normq = sqrt(qsqr) # <<<<<<<<<<<<<< @@ -4564,7 +4591,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_normq = sqrt(__pyx_v_qsqr); - /* "MDAnalysis/lib/qcprot.pyx":473 + /* "MDAnalysis/lib/qcprot.pyx":498 * * normq = sqrt(qsqr) * q1 /= normq # <<<<<<<<<<<<<< @@ -4573,11 +4600,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ if (unlikely(__pyx_v_normq == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 473, __pyx_L1_error) + __PYX_ERR(0, 498, __pyx_L1_error) } __pyx_v_q1 = (__pyx_v_q1 / __pyx_v_normq); - /* "MDAnalysis/lib/qcprot.pyx":474 + /* "MDAnalysis/lib/qcprot.pyx":499 * normq = sqrt(qsqr) * q1 /= normq * q2 /= normq # <<<<<<<<<<<<<< @@ -4586,11 +4613,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ if (unlikely(__pyx_v_normq == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 474, __pyx_L1_error) + __PYX_ERR(0, 499, __pyx_L1_error) } __pyx_v_q2 = (__pyx_v_q2 / __pyx_v_normq); - /* "MDAnalysis/lib/qcprot.pyx":475 + /* "MDAnalysis/lib/qcprot.pyx":500 * q1 /= normq * q2 /= normq * q3 /= normq # <<<<<<<<<<<<<< @@ -4599,11 +4626,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ if (unlikely(__pyx_v_normq == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 475, __pyx_L1_error) + __PYX_ERR(0, 500, __pyx_L1_error) } __pyx_v_q3 = (__pyx_v_q3 / __pyx_v_normq); - /* "MDAnalysis/lib/qcprot.pyx":476 + /* "MDAnalysis/lib/qcprot.pyx":501 * q2 /= normq * q3 /= normq * q4 /= normq # <<<<<<<<<<<<<< @@ -4612,11 +4639,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ if (unlikely(__pyx_v_normq == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "float division"); - __PYX_ERR(0, 476, __pyx_L1_error) + __PYX_ERR(0, 501, __pyx_L1_error) } __pyx_v_q4 = (__pyx_v_q4 / __pyx_v_normq); - /* "MDAnalysis/lib/qcprot.pyx":478 + /* "MDAnalysis/lib/qcprot.pyx":503 * q4 /= normq * * a2 = q1 * q1 # <<<<<<<<<<<<<< @@ -4625,7 +4652,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_a2 = (__pyx_v_q1 * __pyx_v_q1); - /* "MDAnalysis/lib/qcprot.pyx":479 + /* "MDAnalysis/lib/qcprot.pyx":504 * * a2 = q1 * q1 * x2 = q2 * q2 # <<<<<<<<<<<<<< @@ -4634,7 +4661,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_x2 = (__pyx_v_q2 * __pyx_v_q2); - /* "MDAnalysis/lib/qcprot.pyx":480 + /* "MDAnalysis/lib/qcprot.pyx":505 * a2 = q1 * q1 * x2 = q2 * q2 * y2 = q3 * q3 # <<<<<<<<<<<<<< @@ -4643,7 +4670,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_y2 = (__pyx_v_q3 * __pyx_v_q3); - /* "MDAnalysis/lib/qcprot.pyx":481 + /* "MDAnalysis/lib/qcprot.pyx":506 * x2 = q2 * q2 * y2 = q3 * q3 * z2 = q4 * q4 # <<<<<<<<<<<<<< @@ -4652,7 +4679,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_z2 = (__pyx_v_q4 * __pyx_v_q4); - /* "MDAnalysis/lib/qcprot.pyx":483 + /* "MDAnalysis/lib/qcprot.pyx":508 * z2 = q4 * q4 * * xy = q2 * q3 # <<<<<<<<<<<<<< @@ -4661,7 +4688,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_xy = (__pyx_v_q2 * __pyx_v_q3); - /* "MDAnalysis/lib/qcprot.pyx":484 + /* "MDAnalysis/lib/qcprot.pyx":509 * * xy = q2 * q3 * az = q1 * q4 # <<<<<<<<<<<<<< @@ -4670,7 +4697,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_az = (__pyx_v_q1 * __pyx_v_q4); - /* "MDAnalysis/lib/qcprot.pyx":485 + /* "MDAnalysis/lib/qcprot.pyx":510 * xy = q2 * q3 * az = q1 * q4 * zx = q4 * q2 # <<<<<<<<<<<<<< @@ -4679,7 +4706,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_zx = (__pyx_v_q4 * __pyx_v_q2); - /* "MDAnalysis/lib/qcprot.pyx":486 + /* "MDAnalysis/lib/qcprot.pyx":511 * az = q1 * q4 * zx = q4 * q2 * ay = q1 * q3 # <<<<<<<<<<<<<< @@ -4688,7 +4715,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_ay = (__pyx_v_q1 * __pyx_v_q3); - /* "MDAnalysis/lib/qcprot.pyx":487 + /* "MDAnalysis/lib/qcprot.pyx":512 * zx = q4 * q2 * ay = q1 * q3 * yz = q3 * q4 # <<<<<<<<<<<<<< @@ -4697,7 +4724,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_yz = (__pyx_v_q3 * __pyx_v_q4); - /* "MDAnalysis/lib/qcprot.pyx":488 + /* "MDAnalysis/lib/qcprot.pyx":513 * ay = q1 * q3 * yz = q3 * q4 * ax = q1 * q2 # <<<<<<<<<<<<<< @@ -4706,7 +4733,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT */ __pyx_v_ax = (__pyx_v_q1 * __pyx_v_q2); - /* "MDAnalysis/lib/qcprot.pyx":490 + /* "MDAnalysis/lib/qcprot.pyx":515 * ax = q1 * q2 * * rot[0] = a2 + x2 - y2 - z2 # <<<<<<<<<<<<<< @@ -4721,11 +4748,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 490, __pyx_L1_error) + __PYX_ERR(0, 515, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_rot.diminfo[0].strides) = (((__pyx_v_a2 + __pyx_v_x2) - __pyx_v_y2) - __pyx_v_z2); - /* "MDAnalysis/lib/qcprot.pyx":491 + /* "MDAnalysis/lib/qcprot.pyx":516 * * rot[0] = a2 + x2 - y2 - z2 * rot[1] = 2 * (xy + az) # <<<<<<<<<<<<<< @@ -4740,11 +4767,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 491, __pyx_L1_error) + __PYX_ERR(0, 516, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_rot.diminfo[0].strides) = (2.0 * (__pyx_v_xy + __pyx_v_az)); - /* "MDAnalysis/lib/qcprot.pyx":492 + /* "MDAnalysis/lib/qcprot.pyx":517 * rot[0] = a2 + x2 - y2 - z2 * rot[1] = 2 * (xy + az) * rot[2] = 2 * (zx - ay) # <<<<<<<<<<<<<< @@ -4759,11 +4786,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 492, __pyx_L1_error) + __PYX_ERR(0, 517, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_rot.diminfo[0].strides) = (2.0 * (__pyx_v_zx - __pyx_v_ay)); - /* "MDAnalysis/lib/qcprot.pyx":493 + /* "MDAnalysis/lib/qcprot.pyx":518 * rot[1] = 2 * (xy + az) * rot[2] = 2 * (zx - ay) * rot[3] = 2 * (xy - az) # <<<<<<<<<<<<<< @@ -4778,11 +4805,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 493, __pyx_L1_error) + __PYX_ERR(0, 518, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_rot.diminfo[0].strides) = (2.0 * (__pyx_v_xy - __pyx_v_az)); - /* "MDAnalysis/lib/qcprot.pyx":494 + /* "MDAnalysis/lib/qcprot.pyx":519 * rot[2] = 2 * (zx - ay) * rot[3] = 2 * (xy - az) * rot[4] = a2 - x2 + y2 - z2 # <<<<<<<<<<<<<< @@ -4797,11 +4824,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 494, __pyx_L1_error) + __PYX_ERR(0, 519, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_rot.diminfo[0].strides) = (((__pyx_v_a2 - __pyx_v_x2) + __pyx_v_y2) - __pyx_v_z2); - /* "MDAnalysis/lib/qcprot.pyx":495 + /* "MDAnalysis/lib/qcprot.pyx":520 * rot[3] = 2 * (xy - az) * rot[4] = a2 - x2 + y2 - z2 * rot[5] = 2 * (yz + ax) # <<<<<<<<<<<<<< @@ -4816,11 +4843,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 495, __pyx_L1_error) + __PYX_ERR(0, 520, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_rot.diminfo[0].strides) = (2.0 * (__pyx_v_yz + __pyx_v_ax)); - /* "MDAnalysis/lib/qcprot.pyx":496 + /* "MDAnalysis/lib/qcprot.pyx":521 * rot[4] = a2 - x2 + y2 - z2 * rot[5] = 2 * (yz + ax) * rot[6] = 2 * (zx + ay) # <<<<<<<<<<<<<< @@ -4835,11 +4862,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 496, __pyx_L1_error) + __PYX_ERR(0, 521, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_rot.diminfo[0].strides) = (2.0 * (__pyx_v_zx + __pyx_v_ay)); - /* "MDAnalysis/lib/qcprot.pyx":497 + /* "MDAnalysis/lib/qcprot.pyx":522 * rot[5] = 2 * (yz + ax) * rot[6] = 2 * (zx + ay) * rot[7] = 2 * (yz - ax) # <<<<<<<<<<<<<< @@ -4854,11 +4881,11 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 497, __pyx_L1_error) + __PYX_ERR(0, 522, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_rot.diminfo[0].strides) = (2.0 * (__pyx_v_yz - __pyx_v_ax)); - /* "MDAnalysis/lib/qcprot.pyx":498 + /* "MDAnalysis/lib/qcprot.pyx":523 * rot[6] = 2 * (zx + ay) * rot[7] = 2 * (yz - ax) * rot[8] = a2 - x2 - y2 + z2 # <<<<<<<<<<<<<< @@ -4873,24 +4900,24 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT } else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_rot.diminfo[0].shape)) __pyx_t_5 = 0; if (unlikely(__pyx_t_5 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_5); - __PYX_ERR(0, 498, __pyx_L1_error) + __PYX_ERR(0, 523, __pyx_L1_error) } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_rot.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_rot.diminfo[0].strides) = (((__pyx_v_a2 - __pyx_v_x2) - __pyx_v_y2) + __pyx_v_z2); - /* "MDAnalysis/lib/qcprot.pyx":500 + /* "MDAnalysis/lib/qcprot.pyx":525 * rot[8] = a2 - x2 - y2 + z2 * * return rms # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_rms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "MDAnalysis/lib/qcprot.pyx":288 + /* "MDAnalysis/lib/qcprot.pyx":313 * return FastCalcRMSDAndRotation(rot, A, E0, N) * * def FastCalcRMSDAndRotation(np.ndarray[np.float64_t, ndim=1] rot, # <<<<<<<<<<<<<< @@ -4924,7 +4951,7 @@ static PyObject *__pyx_pf_10MDAnalysis_3lib_6qcprot_4FastCalcRMSDAndRotation(CYT return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -4972,7 +4999,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * cdef int i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4981,7 +5008,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":223 * cdef int i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -4990,7 +5017,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":225 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -4999,7 +5026,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5013,7 +5040,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L4_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":228 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -5024,7 +5051,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5033,7 +5060,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -5046,7 +5073,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 229, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":227 * ndim = PyArray_NDIM(self) * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5055,7 +5082,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5069,7 +5096,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L7_bool_binop_done; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":232 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -5080,7 +5107,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5089,7 +5116,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -5102,7 +5129,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 233, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":231 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5111,7 +5138,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":235 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -5120,7 +5147,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":236 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -5129,7 +5156,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5139,7 +5166,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":240 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) # <<<<<<<<<<<<<< @@ -5148,7 +5175,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim)))); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":241 * # This is allocated as one block, strides first. * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -5157,7 +5184,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":242 * info.strides = PyObject_Malloc(sizeof(Py_ssize_t) * 2 * ndim) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -5169,7 +5196,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":243 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -5178,7 +5205,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":244 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -5188,7 +5215,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5198,7 +5225,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":246 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -5208,7 +5235,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":247 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -5219,7 +5246,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L9:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":248 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -5228,7 +5255,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":249 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -5237,7 +5264,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":250 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -5246,7 +5273,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":253 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -5255,7 +5282,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":254 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -5267,7 +5294,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":257 * cdef int offset * * info.obj = self # <<<<<<<<<<<<<< @@ -5280,7 +5307,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -5290,7 +5317,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":260 * * if not PyDataType_HASFIELDS(descr): * t = descr.type_num # <<<<<<<<<<<<<< @@ -5300,7 +5327,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5320,7 +5347,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L15_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":262 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5337,7 +5364,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = __pyx_t_2; __pyx_L14_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5346,7 +5373,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ if (unlikely(__pyx_t_1)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -5359,7 +5386,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 263, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":261 * if not PyDataType_HASFIELDS(descr): * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5368,7 +5395,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":264 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -5380,7 +5407,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"b"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -5391,7 +5418,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"B"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -5402,7 +5429,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"h"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -5413,7 +5440,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"H"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -5424,7 +5451,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"i"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -5435,7 +5462,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"I"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -5446,7 +5473,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"l"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -5457,7 +5484,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"L"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -5468,7 +5495,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -5479,7 +5506,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Q"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -5490,7 +5517,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"f"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -5501,7 +5528,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"d"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -5512,7 +5539,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"g"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -5523,7 +5550,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zf"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -5534,7 +5561,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zd"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -5545,7 +5572,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = ((char *)"Zg"); break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -5557,7 +5584,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":282 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -5578,7 +5605,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -5587,7 +5614,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -5597,7 +5624,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_r = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":259 * info.obj = self * * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<< @@ -5606,7 +5633,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286 * return * else: * info.format = PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -5616,7 +5643,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P /*else*/ { __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF)); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287 * else: * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -5625,7 +5652,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":288 * info.format = PyObject_Malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -5634,7 +5661,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -5644,7 +5671,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error) __pyx_v_f = __pyx_t_8; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -5654,7 +5681,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":215 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -5686,7 +5713,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5710,7 +5737,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5720,7 +5747,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) # <<<<<<<<<<<<<< @@ -5729,7 +5756,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->format); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":295 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5738,7 +5765,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5748,7 +5775,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":298 * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * PyObject_Free(info.strides) # <<<<<<<<<<<<<< @@ -5757,7 +5784,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ PyObject_Free(__pyx_v_info->strides); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297 * if PyArray_HASFIELDS(self): * PyObject_Free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5766,7 +5793,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":294 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5778,7 +5805,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5792,7 +5819,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -5806,7 +5833,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":775 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -5825,7 +5852,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5839,7 +5866,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -5853,7 +5880,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -5872,7 +5899,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5886,7 +5913,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":782 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -5900,7 +5927,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":781 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5919,7 +5946,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5933,7 +5960,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -5947,7 +5974,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5966,7 +5993,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -5980,7 +6007,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":788 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -5994,7 +6021,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":787 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -6013,7 +6040,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -6027,7 +6054,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ int __pyx_t_1; __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -6037,7 +6064,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) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":792 * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): * return d.subarray.shape # <<<<<<<<<<<<<< @@ -6049,7 +6076,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791 * * cdef inline tuple PyDataType_SHAPE(dtype d): * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<< @@ -6058,7 +6085,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":794 * return d.subarray.shape * else: * return () # <<<<<<<<<<<<<< @@ -6072,7 +6099,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<< @@ -6087,7 +6114,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -6116,7 +6143,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx char *__pyx_t_9; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801 * * cdef dtype child * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6125,7 +6152,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802 * cdef dtype child * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -6134,7 +6161,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -6157,7 +6184,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -6174,7 +6201,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":807 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -6209,7 +6236,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -6226,7 +6253,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -6239,7 +6266,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 810, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -6248,7 +6275,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6268,7 +6295,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -6285,7 +6312,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = __pyx_t_7; __pyx_L7_bool_binop_done:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6294,7 +6321,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -6307,7 +6334,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(1, 814, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6316,7 +6343,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -6332,7 +6359,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -6341,7 +6368,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 0x78; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":826 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -6350,7 +6377,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -6361,7 +6388,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":829 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -6371,7 +6398,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -6381,7 +6408,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":832 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -6393,7 +6420,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -6403,7 +6430,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (unlikely(__pyx_t_6)) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -6416,7 +6443,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(1, 834, __pyx_L1_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -6425,7 +6452,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -6443,7 +6470,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -6461,7 +6488,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":839 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -6479,7 +6506,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -6497,7 +6524,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -6515,7 +6542,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -6533,7 +6560,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -6551,7 +6578,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -6569,7 +6596,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -6587,7 +6614,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":846 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -6605,7 +6632,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -6623,7 +6650,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -6641,7 +6668,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":849 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -6659,7 +6686,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":850 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -6679,7 +6706,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -6699,7 +6726,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -6719,7 +6746,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -6737,7 +6764,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -6756,7 +6783,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -6765,7 +6792,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -6775,7 +6802,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L13; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -6788,7 +6815,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -6798,7 +6825,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":861 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -6808,7 +6835,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":796 * return () * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -6833,7 +6860,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6848,7 +6875,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6859,7 +6886,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":980 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -6868,7 +6895,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_baseptr = NULL; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":979 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -6878,7 +6905,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a goto __pyx_L3; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":982 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -6888,7 +6915,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a /*else*/ { Py_INCREF(__pyx_v_base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":983 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -6899,7 +6926,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":984 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -6908,7 +6935,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":985 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -6917,7 +6944,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6929,7 +6956,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6943,7 +6970,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6953,7 +6980,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":989 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -6964,7 +6991,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":988 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -6973,7 +7000,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":991 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -6987,7 +7014,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":987 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7002,7 +7029,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -7023,7 +7050,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_array", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7039,7 +7066,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":998 * cdef inline int import_array() except -1: * try: * _import_array() # <<<<<<<<<<<<<< @@ -7048,7 +7075,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, 998, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7062,7 +7089,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":999 * try: * _import_array() * except Exception: # <<<<<<<<<<<<<< @@ -7077,7 +7104,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -7093,7 +7120,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":997 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -7108,7 +7135,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":996 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -7131,7 +7158,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -7152,7 +7179,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_umath", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -7168,7 +7195,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1004 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -7177,7 +7204,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, 1004, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -7191,7 +7218,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1005 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -7206,7 +7233,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -7222,7 +7249,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1003 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -7237,7 +7264,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1002 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -7260,7 +7287,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 +/* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -7281,7 +7308,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("import_ufunc", 0); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -7297,7 +7324,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1010 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< @@ -7306,7 +7333,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, 1010, __pyx_L3_error) - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -7320,7 +7347,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1011 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -7334,7 +7361,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -7348,7 +7375,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L5_except_error; __pyx_L5_except_error:; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1009 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -7363,7 +7390,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -7423,9 +7450,12 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_10_1107_s0108767305015266, __pyx_k_10_1107_s0108767305015266, sizeof(__pyx_k_10_1107_s0108767305015266), 0, 0, 1, 0}, {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, + {&__pyx_n_s_BibTeX, __pyx_k_BibTeX, sizeof(__pyx_k_BibTeX), 0, 0, 1, 1}, {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_n_s_CalcRMSDRotationalMatrix, __pyx_k_CalcRMSDRotationalMatrix, sizeof(__pyx_k_CalcRMSDRotationalMatrix), 0, 0, 1, 1}, + {&__pyx_n_s_Doi, __pyx_k_Doi, sizeof(__pyx_k_Doi), 0, 0, 1, 1}, {&__pyx_n_s_E0, __pyx_k_E0, sizeof(__pyx_k_E0), 0, 0, 1, 1}, {&__pyx_n_s_FastCalcRMSDAndRotation, __pyx_k_FastCalcRMSDAndRotation, sizeof(__pyx_k_FastCalcRMSDAndRotation), 0, 0, 1, 1}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, @@ -7434,10 +7464,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_G2, __pyx_k_G2, sizeof(__pyx_k_G2), 0, 0, 1, 1}, {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_InnerProduct, __pyx_k_InnerProduct, sizeof(__pyx_k_InnerProduct), 0, 0, 1, 1}, - {&__pyx_n_s_MDAnalysis_lib_qcprot, __pyx_k_MDAnalysis_lib_qcprot, sizeof(__pyx_k_MDAnalysis_lib_qcprot), 0, 0, 1, 1}, + {&__pyx_kp_s_MDAnalysis_lib_qcprot, __pyx_k_MDAnalysis_lib_qcprot, sizeof(__pyx_k_MDAnalysis_lib_qcprot), 0, 0, 1, 0}, {&__pyx_kp_s_MDAnalysis_lib_qcprot_pyx, __pyx_k_MDAnalysis_lib_qcprot_pyx, sizeof(__pyx_k_MDAnalysis_lib_qcprot_pyx), 0, 0, 1, 0}, {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, + {&__pyx_n_s_QCBIB, __pyx_k_QCBIB, sizeof(__pyx_k_QCBIB), 0, 0, 1, 1}, + {&__pyx_kp_s_QCProt_implementation, __pyx_k_QCProt_implementation, sizeof(__pyx_k_QCProt_implementation), 0, 0, 1, 0}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_Sxx, __pyx_k_Sxx, sizeof(__pyx_k_Sxx), 0, 0, 1, 1}, {&__pyx_n_s_Sxx2, __pyx_k_Sxx2, sizeof(__pyx_k_Sxx2), 0, 0, 1, 1}, @@ -7499,16 +7531,21 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_a42, __pyx_k_a42, sizeof(__pyx_k_a42), 0, 0, 1, 1}, {&__pyx_n_s_a43, __pyx_k_a43, sizeof(__pyx_k_a43), 0, 0, 1, 1}, {&__pyx_n_s_a44, __pyx_k_a44, sizeof(__pyx_k_a44), 0, 0, 1, 1}, + {&__pyx_kp_s_article_qcprot2_author_Pu_Liu_a, __pyx_k_article_qcprot2_author_Pu_Liu_a, sizeof(__pyx_k_article_qcprot2_author_Pu_Liu_a), 0, 0, 1, 0}, {&__pyx_n_s_ax, __pyx_k_ax, sizeof(__pyx_k_ax), 0, 0, 1, 1}, {&__pyx_n_s_ay, __pyx_k_ay, sizeof(__pyx_k_ay), 0, 0, 1, 1}, {&__pyx_n_s_az, __pyx_k_az, sizeof(__pyx_k_az), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_cite, __pyx_k_cite, sizeof(__pyx_k_cite), 0, 0, 1, 1}, + {&__pyx_n_s_cite_module, __pyx_k_cite_module, sizeof(__pyx_k_cite_module), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_conf, __pyx_k_conf, sizeof(__pyx_k_conf), 0, 0, 1, 1}, {&__pyx_n_s_coords1, __pyx_k_coords1, sizeof(__pyx_k_coords1), 0, 0, 1, 1}, {&__pyx_n_s_coords2, __pyx_k_coords2, sizeof(__pyx_k_coords2), 0, 0, 1, 1}, {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1}, + {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, + {&__pyx_n_s_due, __pyx_k_due, sizeof(__pyx_k_due), 0, 0, 1, 1}, {&__pyx_n_s_evalprec, __pyx_k_evalprec, sizeof(__pyx_k_evalprec), 0, 0, 1, 1}, {&__pyx_n_s_evecprec, __pyx_k_evecprec, sizeof(__pyx_k_evecprec), 0, 0, 1, 1}, {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, @@ -7524,6 +7561,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0}, {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0}, {&__pyx_n_s_oldg, __pyx_k_oldg, sizeof(__pyx_k_oldg), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_q1, __pyx_k_q1, sizeof(__pyx_k_q1), 0, 0, 1, 1}, {&__pyx_n_s_q2, __pyx_k_q2, sizeof(__pyx_k_q2), 0, 0, 1, 1}, {&__pyx_n_s_q3, __pyx_k_q3, sizeof(__pyx_k_q3), 0, 0, 1, 1}, @@ -7551,7 +7589,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 223, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 229, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error) __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error) @@ -7564,29 +7602,29 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "MDAnalysis/lib/qcprot.pyx":283 + /* "MDAnalysis/lib/qcprot.pyx":308 * """ * cdef double E0 * cdef np.ndarray[np.float64_t, ndim = 1] A = np.zeros(9,dtype = np.float64) # <<<<<<<<<<<<<< * * E0 = InnerProduct(A, conf, ref, N, weights) */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_9); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_9); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "MDAnalysis/lib/qcprot.pyx":321 + /* "MDAnalysis/lib/qcprot.pyx":346 * cdef double SxzmSzx, SxymSyx, SxxpSyy, SxxmSyy * * cdef np.ndarray[np.float64_t, ndim=1] C = np.zeros(4,) # <<<<<<<<<<<<<< * cdef unsigned int i * cdef double mxEigenV */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":229 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -7597,7 +7635,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":233 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -7608,7 +7646,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -7619,7 +7657,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":810 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -7630,7 +7668,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":814 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -7641,7 +7679,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -7652,7 +7690,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1000 * _import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< @@ -7663,7 +7701,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1006 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -7674,7 +7712,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1012 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< @@ -7683,41 +7721,52 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "MDAnalysis/lib/qcprot.pyx":150 + /* "MDAnalysis/lib/qcprot.pyx":157 + * """ + * + * due.cite(Doi("10.1107/s0108767305015266"), # <<<<<<<<<<<<<< + * description="QCProt implementation", + * path="MDAnalysis.lib.qcprot", + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_10_1107_s0108767305015266); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "MDAnalysis/lib/qcprot.pyx":175 * @cython.boundscheck(False) * @cython.wraparound(False) * def InnerProduct(np.ndarray[np.float64_t, ndim=1] A, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] coords1, * np.ndarray[np.float64_t, ndim=2] coords2, */ - __pyx_tuple__12 = PyTuple_Pack(14, __pyx_n_s_A, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_N, __pyx_n_s_weight, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_z1, __pyx_n_s_z2, __pyx_n_s_i, __pyx_n_s_G1, __pyx_n_s_G2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_qcprot_pyx, __pyx_n_s_InnerProduct, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_tuple__13 = PyTuple_Pack(14, __pyx_n_s_A, __pyx_n_s_coords1, __pyx_n_s_coords2, __pyx_n_s_N, __pyx_n_s_weight, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_z1, __pyx_n_s_z2, __pyx_n_s_i, __pyx_n_s_G1, __pyx_n_s_G2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_qcprot_pyx, __pyx_n_s_InnerProduct, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 175, __pyx_L1_error) - /* "MDAnalysis/lib/qcprot.pyx":253 + /* "MDAnalysis/lib/qcprot.pyx":278 * @cython.boundscheck(False) * @cython.wraparound(False) * def CalcRMSDRotationalMatrix(np.ndarray[np.float64_t, ndim=2] ref, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] conf, * int N, */ - __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_ref, __pyx_n_s_conf, __pyx_n_s_N, __pyx_n_s_rot, __pyx_n_s_weights, __pyx_n_s_E0, __pyx_n_s_A); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_qcprot_pyx, __pyx_n_s_CalcRMSDRotationalMatrix, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_s_ref, __pyx_n_s_conf, __pyx_n_s_N, __pyx_n_s_rot, __pyx_n_s_weights, __pyx_n_s_E0, __pyx_n_s_A); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_qcprot_pyx, __pyx_n_s_CalcRMSDRotationalMatrix, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 278, __pyx_L1_error) - /* "MDAnalysis/lib/qcprot.pyx":288 + /* "MDAnalysis/lib/qcprot.pyx":313 * return FastCalcRMSDAndRotation(rot, A, E0, N) * * def FastCalcRMSDAndRotation(np.ndarray[np.float64_t, ndim=1] rot, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] A, * double E0, int N): */ - __pyx_tuple__16 = PyTuple_Pack(88, __pyx_n_s_rot, __pyx_n_s_A, __pyx_n_s_E0, __pyx_n_s_N, __pyx_n_s_rmsd, __pyx_n_s_Sxx, __pyx_n_s_Sxy, __pyx_n_s_Sxz, __pyx_n_s_Syx, __pyx_n_s_Syy, __pyx_n_s_Syz, __pyx_n_s_Szx, __pyx_n_s_Szy, __pyx_n_s_Szz, __pyx_n_s_Szz2, __pyx_n_s_Syy2, __pyx_n_s_Sxx2, __pyx_n_s_Sxy2, __pyx_n_s_Syz2, __pyx_n_s_Sxz2, __pyx_n_s_Syx2, __pyx_n_s_Szy2, __pyx_n_s_Szx2, __pyx_n_s_SyzSzymSyySzz2, __pyx_n_s_Sxx2Syy2Szz2Syz2Szy2, __pyx_n_s_Sxy2Sxz2Syx2Szx2, __pyx_n_s_SxzpSzx, __pyx_n_s_SyzpSzy, __pyx_n_s_SxypSyx, __pyx_n_s_SyzmSzy, __pyx_n_s_SxzmSzx, __pyx_n_s_SxymSyx, __pyx_n_s_SxxpSyy, __pyx_n_s_SxxmSyy, __pyx_n_s_C, __pyx_n_s_i, __pyx_n_s_mxEigenV, __pyx_n_s_oldg, __pyx_n_s_b, __pyx_n_s_a, __pyx_n_s_delta, __pyx_n_s_rms, __pyx_n_s_qsqr, __pyx_n_s_q1, __pyx_n_s_q2, __pyx_n_s_q3, __pyx_n_s_q4, __pyx_n_s_normq, __pyx_n_s_a11, __pyx_n_s_a12, __pyx_n_s_a13, __pyx_n_s_a14, __pyx_n_s_a21, __pyx_n_s_a22, __pyx_n_s_a23, __pyx_n_s_a24, __pyx_n_s_a31, __pyx_n_s_a32, __pyx_n_s_a33, __pyx_n_s_a34, __pyx_n_s_a41, __pyx_n_s_a42, __pyx_n_s_a43, __pyx_n_s_a44, __pyx_n_s_a2, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_z2, __pyx_n_s_xy, __pyx_n_s_az, __pyx_n_s_zx, __pyx_n_s_ay, __pyx_n_s_yz, __pyx_n_s_ax, __pyx_n_s_a3344_4334, __pyx_n_s_a3244_4234, __pyx_n_s_a3243_4233, __pyx_n_s_a3143_4133, __pyx_n_s_a3144_4134, __pyx_n_s_a3142_4132, __pyx_n_s_evecprec, __pyx_n_s_evalprec, __pyx_n_s_a1324_1423, __pyx_n_s_a1224_1422, __pyx_n_s_a1223_1322, __pyx_n_s_a1124_1421, __pyx_n_s_a1123_1321, __pyx_n_s_a1122_1221); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__16); - __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 88, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_qcprot_pyx, __pyx_n_s_FastCalcRMSDAndRotation, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(88, __pyx_n_s_rot, __pyx_n_s_A, __pyx_n_s_E0, __pyx_n_s_N, __pyx_n_s_rmsd, __pyx_n_s_Sxx, __pyx_n_s_Sxy, __pyx_n_s_Sxz, __pyx_n_s_Syx, __pyx_n_s_Syy, __pyx_n_s_Syz, __pyx_n_s_Szx, __pyx_n_s_Szy, __pyx_n_s_Szz, __pyx_n_s_Szz2, __pyx_n_s_Syy2, __pyx_n_s_Sxx2, __pyx_n_s_Sxy2, __pyx_n_s_Syz2, __pyx_n_s_Sxz2, __pyx_n_s_Syx2, __pyx_n_s_Szy2, __pyx_n_s_Szx2, __pyx_n_s_SyzSzymSyySzz2, __pyx_n_s_Sxx2Syy2Szz2Syz2Szy2, __pyx_n_s_Sxy2Sxz2Syx2Szx2, __pyx_n_s_SxzpSzx, __pyx_n_s_SyzpSzy, __pyx_n_s_SxypSyx, __pyx_n_s_SyzmSzy, __pyx_n_s_SxzmSzx, __pyx_n_s_SxymSyx, __pyx_n_s_SxxpSyy, __pyx_n_s_SxxmSyy, __pyx_n_s_C, __pyx_n_s_i, __pyx_n_s_mxEigenV, __pyx_n_s_oldg, __pyx_n_s_b, __pyx_n_s_a, __pyx_n_s_delta, __pyx_n_s_rms, __pyx_n_s_qsqr, __pyx_n_s_q1, __pyx_n_s_q2, __pyx_n_s_q3, __pyx_n_s_q4, __pyx_n_s_normq, __pyx_n_s_a11, __pyx_n_s_a12, __pyx_n_s_a13, __pyx_n_s_a14, __pyx_n_s_a21, __pyx_n_s_a22, __pyx_n_s_a23, __pyx_n_s_a24, __pyx_n_s_a31, __pyx_n_s_a32, __pyx_n_s_a33, __pyx_n_s_a34, __pyx_n_s_a41, __pyx_n_s_a42, __pyx_n_s_a43, __pyx_n_s_a44, __pyx_n_s_a2, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_z2, __pyx_n_s_xy, __pyx_n_s_az, __pyx_n_s_zx, __pyx_n_s_ay, __pyx_n_s_yz, __pyx_n_s_ax, __pyx_n_s_a3344_4334, __pyx_n_s_a3244_4234, __pyx_n_s_a3243_4233, __pyx_n_s_a3143_4133, __pyx_n_s_a3144_4134, __pyx_n_s_a3142_4132, __pyx_n_s_evecprec, __pyx_n_s_evalprec, __pyx_n_s_a1324_1423, __pyx_n_s_a1224_1422, __pyx_n_s_a1223_1322, __pyx_n_s_a1124_1421, __pyx_n_s_a1123_1321, __pyx_n_s_a1122_1221); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 88, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_MDAnalysis_lib_qcprot_pyx, __pyx_n_s_FastCalcRMSDAndRotation, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7830,8 +7879,8 @@ static int __Pyx_modinit_function_import_code(void) { #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) - #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) +#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) + #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif @@ -7888,6 +7937,9 @@ static int __pyx_pymod_exec_qcprot(PyObject *__pyx_pyinit_module) #endif { PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; @@ -7998,53 +8050,216 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "MDAnalysis/lib/qcprot.pyx":150 + /* "MDAnalysis/lib/qcprot.pyx":142 + * cimport numpy as np + * + * from ..due import due, BibTeX, Doi # <<<<<<<<<<<<<< + * + * # providing DOI for this citation doesnt seem to work (as of 22/04/18) + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_due); + __Pyx_GIVEREF(__pyx_n_s_due); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_due); + __Pyx_INCREF(__pyx_n_s_BibTeX); + __Pyx_GIVEREF(__pyx_n_s_BibTeX); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BibTeX); + __Pyx_INCREF(__pyx_n_s_Doi); + __Pyx_GIVEREF(__pyx_n_s_Doi); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_Doi); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_due, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_due); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_due, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BibTeX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BibTeX, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Doi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Doi, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "MDAnalysis/lib/qcprot.pyx":145 + * + * # providing DOI for this citation doesnt seem to work (as of 22/04/18) + * _QCBIB = """\ # <<<<<<<<<<<<<< + * @article{qcprot2, + * author = {Pu Liu and Dimitris K. Agrafiotis and Douglas L. Theobald}, + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_QCBIB, __pyx_kp_s_article_qcprot2_author_Pu_Liu_a) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + + /* "MDAnalysis/lib/qcprot.pyx":157 + * """ + * + * due.cite(Doi("10.1107/s0108767305015266"), # <<<<<<<<<<<<<< + * description="QCProt implementation", + * path="MDAnalysis.lib.qcprot", + */ + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_due); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Doi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __pyx_t_3 = 0; + + /* "MDAnalysis/lib/qcprot.pyx":158 + * + * due.cite(Doi("10.1107/s0108767305015266"), + * description="QCProt implementation", # <<<<<<<<<<<<<< + * path="MDAnalysis.lib.qcprot", + * cite_module=True) + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_description, __pyx_kp_s_QCProt_implementation) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_path, __pyx_kp_s_MDAnalysis_lib_qcprot) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + + /* "MDAnalysis/lib/qcprot.pyx":160 + * description="QCProt implementation", + * path="MDAnalysis.lib.qcprot", + * cite_module=True) # <<<<<<<<<<<<<< + * due.cite(BibTeX(_QCBIB), + * description="QCProt implementation", + */ + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cite_module, Py_True) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + + /* "MDAnalysis/lib/qcprot.pyx":157 + * """ + * + * due.cite(Doi("10.1107/s0108767305015266"), # <<<<<<<<<<<<<< + * description="QCProt implementation", + * path="MDAnalysis.lib.qcprot", + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "MDAnalysis/lib/qcprot.pyx":161 + * path="MDAnalysis.lib.qcprot", + * cite_module=True) + * due.cite(BibTeX(_QCBIB), # <<<<<<<<<<<<<< + * description="QCProt implementation", + * path="MDAnalysis.lib.qcprot", + */ + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_due); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cite); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_BibTeX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_QCBIB); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + + /* "MDAnalysis/lib/qcprot.pyx":162 + * cite_module=True) + * due.cite(BibTeX(_QCBIB), + * description="QCProt implementation", # <<<<<<<<<<<<<< + * path="MDAnalysis.lib.qcprot", + * cite_module=True) + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_description, __pyx_kp_s_QCProt_implementation) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_path, __pyx_kp_s_MDAnalysis_lib_qcprot) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + + /* "MDAnalysis/lib/qcprot.pyx":164 + * description="QCProt implementation", + * path="MDAnalysis.lib.qcprot", + * cite_module=True) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_cite_module, Py_True) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + + /* "MDAnalysis/lib/qcprot.pyx":161 + * path="MDAnalysis.lib.qcprot", + * cite_module=True) + * due.cite(BibTeX(_QCBIB), # <<<<<<<<<<<<<< + * description="QCProt implementation", + * path="MDAnalysis.lib.qcprot", + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "MDAnalysis/lib/qcprot.pyx":175 * @cython.boundscheck(False) * @cython.wraparound(False) * def InnerProduct(np.ndarray[np.float64_t, ndim=1] A, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] coords1, * np.ndarray[np.float64_t, ndim=2] coords2, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6qcprot_1InnerProduct, NULL, __pyx_n_s_MDAnalysis_lib_qcprot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InnerProduct, __pyx_t_1) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6qcprot_1InnerProduct, NULL, __pyx_kp_s_MDAnalysis_lib_qcprot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InnerProduct, __pyx_t_4) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/qcprot.pyx":253 + /* "MDAnalysis/lib/qcprot.pyx":278 * @cython.boundscheck(False) * @cython.wraparound(False) * def CalcRMSDRotationalMatrix(np.ndarray[np.float64_t, ndim=2] ref, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2] conf, * int N, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6qcprot_3CalcRMSDRotationalMatrix, NULL, __pyx_n_s_MDAnalysis_lib_qcprot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CalcRMSDRotationalMatrix, __pyx_t_1) < 0) __PYX_ERR(0, 253, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6qcprot_3CalcRMSDRotationalMatrix, NULL, __pyx_kp_s_MDAnalysis_lib_qcprot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CalcRMSDRotationalMatrix, __pyx_t_4) < 0) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "MDAnalysis/lib/qcprot.pyx":288 + /* "MDAnalysis/lib/qcprot.pyx":313 * return FastCalcRMSDAndRotation(rot, A, E0, N) * * def FastCalcRMSDAndRotation(np.ndarray[np.float64_t, ndim=1] rot, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1] A, * double E0, int N): */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6qcprot_5FastCalcRMSDAndRotation, NULL, __pyx_n_s_MDAnalysis_lib_qcprot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FastCalcRMSDAndRotation, __pyx_t_1) < 0) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10MDAnalysis_3lib_6qcprot_5FastCalcRMSDAndRotation, NULL, __pyx_kp_s_MDAnalysis_lib_qcprot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FastCalcRMSDAndRotation, __pyx_t_4) < 0) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "MDAnalysis/lib/qcprot.pyx":1 * # ----------------------------------------------------------------------------- # <<<<<<<<<<<<<< * # Author(s) of Original Implementation: * # Douglas L. Theobald */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "../../../miniconda2/envs/mda3/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 + /* "../../../miniconda3/envs/mda/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1008 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -8057,6 +8272,9 @@ if (!__Pyx_RefNanny) { goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init MDAnalysis.lib.qcprot", 0, __pyx_lineno, __pyx_filename); @@ -9337,7 +9555,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; @@ -9352,7 +9570,7 @@ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject * } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -9436,7 +9654,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE - #if PY_VERSION_HEX >= 0x030700A2 + #if PY_VERSION_HEX >= 0x030700A3 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; @@ -9533,6 +9751,20 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) return module; } +/* ImportFrom */ + static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { @@ -9541,6 +9773,9 @@ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_li #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); @@ -10805,14 +11040,42 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return res; } #endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i>> @static_variables(msg='foo calls', calls=0) + ... def foo(): + ... foo.calls += 1 + ... print("{}: {}".format(foo.msg, foo.calls)) + ... + >>> foo() + foo calls: 1 + >>> foo() + foo calls: 2 + + + .. note:: Based on https://stackoverflow.com/a/279586 + by `Claudiu `_ + + .. versionadded:: 0.19.0 + """ + def static_decorator(func): + for kwarg in kwargs: + setattr(func, kwarg, kwargs[kwarg]) + return func + return static_decorator + + +# In a lot of Atom/Residue/SegmentGroup methods such as center_of_geometry() and +# the like, results are biased if the calling group is not unique, i.e., if it +# contains duplicates. +# We therefore raise a `DuplicateWarning` whenever an affected method is called +# from a non-unique group. Since several of the affected methods involve calls +# to other affected methods, simply raising a warning in every affected method +# would potentially lead to a massive amount of warnings. This is exactly where +# the `warn_if_unique` decorator below comes into play. It ensures that a +# warning is only raised once for a method using this decorator, and suppresses +# all such warnings that would potentially be raised in methods called by that +# method. Of course, as it is generally the case with Python warnings, this is +# *not threadsafe*. + +@static_variables(warned=False) +def warn_if_not_unique(groupmethod): + """Decorator triggering a :class:`~MDAnalysis.exceptions.DuplicateWarning` + if the underlying group is not unique. + + Assures that during execution of the decorated method only the first of + potentially multiple warnings concerning the uniqueness of groups is shown. + + Raises + ------ + :class:`~MDAnalysis.exceptions.DuplicateWarning` + If the :class:`~MDAnalysis.core.groups.AtomGroup`, + :class:`~MDAnalysis.core.groups.ResidueGroup`, or + :class:`~MDAnalysis.core.groups.SegmentGroup` of which the decorated + method is a member contains duplicates. + + + .. versionadded:: 0.19.0 + """ + @wraps(groupmethod) + def wrapper(group, *args, **kwargs): + # Proceed as usual if the calling group is unique or a DuplicateWarning + # has already been thrown: + if group.isunique or warn_if_not_unique.warned: + return groupmethod(group, *args, **kwargs) + # Otherwise, throw a DuplicateWarning and execute the method. + method_name = ".".join((group.__class__.__name__, groupmethod.__name__)) + # Try to get the group's variable name(s): + caller_locals = inspect.currentframe().f_back.f_locals.items() + group_names = [] + for name, obj in caller_locals: + try: + if obj is group: + group_names.append("'{}'".format(name)) + except: + pass + if not group_names: + group_name = "'unnamed {}'".format(group.__class__.__name__) + elif len(group_names) == 1: + group_name = group_names[0] + else: + group_name = " a.k.a. ".join(sorted(group_names)) + group_repr = repr(group) + msg = ("{}(): {} {} contains duplicates. Results might be biased!" + "".format(method_name, group_name, group_repr)) + warnings.warn(message=msg, category=DuplicateWarning, stacklevel=2) + warn_if_not_unique.warned = True + try: + result = groupmethod(group, *args, **kwargs) + finally: + warn_if_not_unique.warned = False + return result + return wrapper + + +def check_coords(*coord_names, **options): + """Decorator for automated coordinate array checking. + + This decorator is intended for use especially in + :mod:`MDAnalysis.lib.distances`. + It takes an arbitrary number of positional arguments which must correspond + to names of positional arguments of the decorated function. + It then checks if the corresponding values are valid coordinate arrays. + If all these arrays are single coordinates (i.e., their shape is ``(3,)``), + the decorated function can optionally return a single coordinate (or angle) + instead of an array of coordinates (or angles). This can be used to enable + computations of single observables using functions originally designed to + accept only 2-d coordinate arrays. + + The checks performed on each individual coordinate array are: + + * Check that coordinate arrays are of type :class:`numpy.ndarray`. + * Check that coordinate arrays have a shape of ``(n, 3)`` (or ``(3,)`` if + single coordinates are allowed; see keyword argument `allow_single`). + * Automatic dtype conversion to ``numpy.float32``. + * Optional replacement by a copy; see keyword argument `enforce_copy` . + * If coordinate arrays aren't C-contiguous, they will be automatically + replaced by a C-contiguous copy. + * Optional check for equal length of all coordinate arrays; see optional + keyword argument `check_lengths_match`. + + Parameters + ---------- + *coord_names : tuple + Arbitrary number of strings corresponding to names of positional + arguments of the decorated function. + **options : dict, optional + * **enforce_copy** (:class:`bool`, optional) -- Enforce working on a + copy of the coordinate arrays. This is useful to ensure that the input + arrays are left unchanged. Default: ``True`` + * **allow_single** (:class:`bool`, optional) -- Allow the input + coordinate array to be a single coordinate with shape ``(3,)``. + * **convert_single** (:class:`bool`, optional) -- If ``True``, single + coordinate arrays will be converted to have a shape of ``(1, 3)``. + Only has an effect if `allow_single` is ``True``. Default: ``True`` + * **reduce_result_if_single** (:class:`bool`, optional) -- If ``True`` + and *all* input coordinates are single, a decorated function ``func`` + will return ``func()[0]`` instead of ``func()``. Only has an effect if + `allow_single` is ``True``. Default: ``True`` + * **check_lengths_match** (:class:`bool`, optional) -- If ``True``, a + :class:`ValueError` is raised if not all coordinate arrays contain the + same number of coordinates. Default: ``True`` + + Raises + ------ + ValueError + If the decorator is used without positional arguments (for development + purposes only). + + If any of the positional arguments supplied to the decorator doesn't + correspond to a name of any of the decorated function's positional + arguments. + + If any of the coordinate arrays has a wrong shape. + TypeError + If any of the coordinate arrays is not a :class:`numpy.ndarray`. + + If the dtype of any of the coordinate arrays is not convertible to + ``numpy.float32``. + + Example + ------- + + >>> @check_coords('coords1', 'coords2') + ... def coordsum(coords1, coords2): + ... assert coords1.dtype == np.float32 + ... assert coords2.flags['C_CONTIGUOUS'] + ... return coords1 + coords2 + ... + >>> # automatic dtype conversion: + >>> coordsum(np.zeros(3, dtype=np.int64), np.ones(3)) + array([1., 1., 1.], dtype=float32) + >>> + >>> # automatic handling of non-contiguous arrays: + >>> coordsum(np.zeros(3), np.ones(6)[::2]) + array([1., 1., 1.], dtype=float32) + >>> + >>> # automatic shape checking: + >>> coordsum(np.zeros(3), np.ones(6)) + ValueError: coordsum(): coords2.shape must be (3,) or (n, 3), got (6,). + + + .. versionadded:: 0.19.0 + """ + enforce_copy = options.get('enforce_copy', True) + allow_single = options.get('allow_single', True) + convert_single = options.get('convert_single', True) + reduce_result_if_single = options.get('reduce_result_if_single', True) + check_lengths_match = options.get('check_lengths_match', + len(coord_names) > 1) + if not coord_names: + raise ValueError("Decorator check_coords() cannot be used without " + "positional arguments.") + def check_coords_decorator(func): + fname = func.__name__ + code = func.__code__ + argnames = code.co_varnames + nargs = len(code.co_varnames) + ndefaults = len(func.__defaults__) if func.__defaults__ else 0 + # Create a tuple of positional argument names: + nposargs = code.co_argcount - ndefaults + posargnames = argnames[:nposargs] + # The check_coords() decorator is designed to work only for positional + # arguments: + for name in coord_names: + if name not in posargnames: + raise ValueError("In decorator check_coords(): Name '{}' " + "doesn't correspond to any positional " + "argument of the decorated function {}()." + "".format(name, func.__name__)) + + def _check_coords(coords, argname): + if not isinstance(coords, np.ndarray): + raise TypeError("{}(): Parameter '{}' must be a numpy.ndarray, " + "got {}.".format(fname, argname, type(coords))) + is_single = False + if allow_single: + if (coords.ndim not in (1, 2)) or (coords.shape[-1] != 3): + raise ValueError("{}(): {}.shape must be (3,) or (n, 3), " + "got {}.".format(fname, argname, + coords.shape)) + if coords.ndim == 1: + is_single = True + if convert_single: + coords = coords[None, :] + else: + if (coords.ndim != 2) or (coords.shape[1] != 3): + raise ValueError("{}(): {}.shape must be (n, 3), got {}." + "".format(fname, argname, coords.shape)) + try: + coords = coords.astype(np.float32, order='C', copy=enforce_copy) + except ValueError: + raise TypeError("{}(): {}.dtype must be convertible to float32," + " got {}.".format(fname, argname, coords.dtype)) + return coords, is_single + + @wraps(func) + def wrapper(*args, **kwargs): + # Check for invalid function call: + if len(args) != nposargs: + # set marker for testing purposes: + wrapper._invalid_call = True + if len(args) > nargs: + # too many arguments, invoke call: + return func(*args, **kwargs) + for name in posargnames[:len(args)]: + if name in kwargs: + # duplicate argument, invoke call: + return func(*args, **kwargs) + for name in posargnames[len(args):]: + if name not in kwargs: + # missing argument, invoke call: + return func(*args, **kwargs) + for name in kwargs: + if name not in argnames: + # unexpected kwarg, invoke call: + return func(*args, **kwargs) + # call is valid, unset test marker: + wrapper._invalid_call = False + args = list(args) + ncoords = [] + all_single = allow_single + for name in coord_names: + idx = posargnames.index(name) + if idx < len(args): + args[idx], is_single = _check_coords(args[idx], name) + all_single &= is_single + ncoords.append(args[idx].shape[0]) + else: + kwargs[name], is_single = _check_coords(kwargs[name], + name) + all_single &= is_single + ncoords.append(kwargs[name].shape[0]) + if check_lengths_match and ncoords: + if ncoords.count(ncoords[0]) != len(ncoords): + raise ValueError("{}(): {} must contain the same number of " + "coordinates, got {}." + "".format(fname, ", ".join(coord_names), + ncoords)) + # If all input coordinate arrays were 1-d, so should be the output: + if all_single and reduce_result_if_single: + return func(*args, **kwargs)[0] + return func(*args, **kwargs) + return wrapper + return check_coords_decorator + + +#------------------------------------------------------------------ +# +# our own deprecate function, derived from numpy (see +# https://github.com/MDAnalysis/mdanalysis/pull/1763#issuecomment-403231136) +# +# From numpy/lib/utils.py 1.14.5 (used under the BSD 3-clause licence, +# https://www.numpy.org/license.html#license) and modified + +def _set_function_name(func, name): + func.__name__ = name + return func + +class _Deprecate(object): + """ + Decorator class to deprecate old functions. + + Refer to `deprecate` for details. + + See Also + -------- + deprecate + + + .. versionadded:: 0.19.0 + """ + + def __init__(self, old_name=None, new_name=None, + release=None, remove=None, message=None): + self.old_name = old_name + self.new_name = new_name + if release is None: + raise ValueError("deprecate: provide release in which " + "feature was deprecated.") + self.release = str(release) + self.remove = str(remove) if remove is not None else remove + self.message = message + + def __call__(self, func, *args, **kwargs): + """ + Decorator call. Refer to ``decorate``. + + """ + old_name = self.old_name + new_name = self.new_name + message = self.message + release = self.release + remove = self.remove + + if old_name is None: + try: + old_name = func.__name__ + except AttributeError: + old_name = func.__name__ + if new_name is None: + depdoc = "`{0}` is deprecated!".format(old_name) + else: + depdoc = "`{0}` is deprecated, use `{1}` instead!".format( + old_name, new_name) + + warn_message = depdoc + + remove_text = "" + if remove is not None: + remove_text = "`{0}` will be removed in release {1}.".format( + old_name, remove) + warn_message += "\n" + remove_text + if message is not None: + warn_message += "\n" + message + + def newfunc(*args, **kwds): + """This function is deprecated.""" + warnings.warn(warn_message, DeprecationWarning, stacklevel=2) + return func(*args, **kwds) + + newfunc = _set_function_name(newfunc, old_name) + + # Build the doc string + # First line: func is deprecated, use newfunc instead! + # Normal docs follows. + # Last: .. deprecated:: + + # make sure that we do not mess up indentation, otherwise sphinx + # docs do not build properly + try: + doc = dedent_docstring(func.__doc__) + except TypeError: + doc = "" + + deprecation_text = dedent_docstring("""\n\n + .. deprecated:: {0} + {1} + {2} + """.format(release, + message if message else depdoc, + remove_text)) + + doc = "{0}\n\n{1}\n{2}\n".format(depdoc, doc, deprecation_text) + + newfunc.__doc__ = doc + try: + d = func.__dict__ + except AttributeError: + pass + else: + newfunc.__dict__.update(d) + return newfunc + +def deprecate(*args, **kwargs): + """Issues a DeprecationWarning, adds warning to `old_name`'s + docstring, rebinds ``old_name.__name__`` and returns the new + function object. + + This function may also be used as a decorator. + + It adds a restructured text ``.. deprecated:: release`` block with + the sphinx deprecated role to the end of the docs. The `message` + is added under the deprecation block and contains the `release` in + which the function was deprecated. + + Parameters + ---------- + func : function + The function to be deprecated. + old_name : str, optional + The name of the function to be deprecated. Default is None, in + which case the name of `func` is used. + new_name : str, optional + The new name for the function. Default is None, in which case the + deprecation message is that `old_name` is deprecated. If given, the + deprecation message is that `old_name` is deprecated and `new_name` + should be used instead. + release : str + Release in which the function was deprecated. This is given as + a keyword argument for technical reasons but is required; a + :exc:`ValueError` is raised if it is missing. + remove : str, optional + Release for which removal of the feature is planned. + message : str, optional + Additional explanation of the deprecation. Displayed in the + docstring after the warning. + + Returns + ------- + old_func : function + The deprecated function. + + Examples + -------- + When :func:`deprecate` is used as a function as in the following + example, + + .. code-block:: python + + oldfunc = deprecate(func, release="0.19.0", remove="1.0", + message="Do it yourself instead.") + + then ``oldfunc`` will return a value after printing + :exc:`DeprecationWarning`; ``func`` is still available as it was + before. + + When used as a decorator, ``func`` will be changed and issue the + warning and contain the deprecation note in the do string. + + .. code-block:: python + + @deprecate(release="0.19.0", remove="1.0", + message="Do it yourself instead.") + def func(): + \"\"\"Just pass\"\"\" + pass + + The resulting doc string (``help(func)``) will look like: + + .. code-block:: reST + + `func` is deprecated! + + Just pass. + + .. deprecated:: 0.19.0 + Do it yourself instead. + `func` will be removed in 1.0. + + (It is possible but confusing to change the name of ``func`` with + the decorator so it is not recommended to use the `new_func` + keyword argument with the decorator.) + + .. versionadded:: 0.19.0 + + """ + # Deprecate may be run as a function or as a decorator + # If run as a function, we initialise the decorator class + # and execute its __call__ method. + + if args: + fn = args[0] + args = args[1:] + return _Deprecate(*args, **kwargs)(fn) + else: + return _Deprecate(*args, **kwargs) +# +#------------------------------------------------------------------ + +def dedent_docstring(text): + """Dedent typical python doc string. + + Parameters + ---------- + text : str + string, typically something like ``func.__doc__``. + + Returns + ------- + str + string with the leading common whitespace removed from each + line + + See Also + -------- + textwrap.dedent + + + .. versionadded:: 0.19.0 + """ + lines = text.splitlines() + if len(lines) < 2: + return text.lstrip() + + # treat first line as special (typically no leading whitespace!) which messes up dedent + return lines[0].lstrip() + "\n" + textwrap.dedent("\n".join(lines[1:])) diff --git a/package/MDAnalysis/migration/fixes/fix_agcountmethods.py b/package/MDAnalysis/migration/fixes/fix_agcountmethods.py index af39c4ba705..7473e624e09 100644 --- a/package/MDAnalysis/migration/fixes/fix_agcountmethods.py +++ b/package/MDAnalysis/migration/fixes/fix_agcountmethods.py @@ -31,4 +31,3 @@ def transform(self, node, results): args = head + [pytree.Node(syms.trailer, [Dot(), Name(method_name, prefix = method.prefix)])] new = pytree.Node(syms.power, args) return new - diff --git a/package/MDAnalysis/migration/fixes/fix_agmethods.py b/package/MDAnalysis/migration/fixes/fix_agmethods.py index 3c33fb744d7..8972eb48b25 100644 --- a/package/MDAnalysis/migration/fixes/fix_agmethods.py +++ b/package/MDAnalysis/migration/fixes/fix_agmethods.py @@ -32,4 +32,3 @@ def transform(self, node, results): args = head + [pytree.Node(syms.trailer, [Dot(), Name(method_name, prefix = method.prefix)])] new = pytree.Node(syms.power, args) return new - diff --git a/package/MDAnalysis/migration/fixes/fix_agmethods2.py b/package/MDAnalysis/migration/fixes/fix_agmethods2.py index 8482aab2a13..2f0499ec4f8 100644 --- a/package/MDAnalysis/migration/fixes/fix_agmethods2.py +++ b/package/MDAnalysis/migration/fixes/fix_agmethods2.py @@ -32,4 +32,3 @@ def transform(self, node, results): args = head + [pytree.Node(syms.trailer, [Dot(), Name(method_name, prefix = method.prefix), Dot(), Name('value'), LParen(), RParen()])] new = pytree.Node(syms.power, args) return new - diff --git a/package/MDAnalysis/migration/fixes/fix_agsetterpluralization.py b/package/MDAnalysis/migration/fixes/fix_agsetterpluralization.py index 189c798a372..3fe1a68ed23 100644 --- a/package/MDAnalysis/migration/fixes/fix_agsetterpluralization.py +++ b/package/MDAnalysis/migration/fixes/fix_agsetterpluralization.py @@ -37,4 +37,3 @@ def transform(self, node, results): args = head + [pytree.Node(syms.trailer, [Dot(), Name(method_name, prefix = method.prefix)])] + tail new = pytree.Node(syms.power, args) return new - diff --git a/package/MDAnalysis/migration/fixes/fix_calctorsions.py b/package/MDAnalysis/migration/fixes/fix_calctorsions.py index e94cc7c0afc..4551c8acda7 100644 --- a/package/MDAnalysis/migration/fixes/fix_calctorsions.py +++ b/package/MDAnalysis/migration/fixes/fix_calctorsions.py @@ -30,4 +30,3 @@ def transform(self, node, results): elif 'import_name' in results.keys(): import_name = results['import_name'] import_name.replace(Name(' calc_dihedrals')) - diff --git a/package/MDAnalysis/migration/fixes/fix_camelcase.py b/package/MDAnalysis/migration/fixes/fix_camelcase.py index 34220c78d26..0e6f5475a27 100644 --- a/package/MDAnalysis/migration/fixes/fix_camelcase.py +++ b/package/MDAnalysis/migration/fixes/fix_camelcase.py @@ -32,4 +32,3 @@ def transform(self, node, results): args = [pytree.Node(syms.trailer, [Dot(), Name(method_name)])] new = pytree.Node(syms.power, args) return new - diff --git a/package/MDAnalysis/migration/fixes/fix_framenumberingzerobased2.py b/package/MDAnalysis/migration/fixes/fix_framenumberingzerobased2.py index 18489952f45..2770917fc52 100644 --- a/package/MDAnalysis/migration/fixes/fix_framenumberingzerobased2.py +++ b/package/MDAnalysis/migration/fixes/fix_framenumberingzerobased2.py @@ -36,4 +36,3 @@ def transform(self, node, results): except KeyError: node.set_prefix(comment_string + node.prefix) node.changed() - diff --git a/package/MDAnalysis/migration/fixes/fix_numframes.py b/package/MDAnalysis/migration/fixes/fix_numframes.py index c0d89bd779c..ed27dcb9d98 100644 --- a/package/MDAnalysis/migration/fixes/fix_numframes.py +++ b/package/MDAnalysis/migration/fixes/fix_numframes.py @@ -23,4 +23,3 @@ def transform(self, node, results): args = [pytree.Node(syms.trailer, [Dot(), Name(method_name)])] new = pytree.Node(syms.power, args) return new - diff --git a/package/MDAnalysis/migration/fixes/fix_selectatoms.py b/package/MDAnalysis/migration/fixes/fix_selectatoms.py index 664709a7b22..8cc86d5f121 100644 --- a/package/MDAnalysis/migration/fixes/fix_selectatoms.py +++ b/package/MDAnalysis/migration/fixes/fix_selectatoms.py @@ -20,4 +20,3 @@ def match(self, node): def transform(self, node, results): node.value = 'select_atoms' node.changed() - diff --git a/package/MDAnalysis/migration/fixes/fix_torsionclasses.py b/package/MDAnalysis/migration/fixes/fix_torsionclasses.py index 255a0be195d..70df5cd806e 100644 --- a/package/MDAnalysis/migration/fixes/fix_torsionclasses.py +++ b/package/MDAnalysis/migration/fixes/fix_torsionclasses.py @@ -49,6 +49,3 @@ def transform(self, node, results): child.value = 'Dihedral' if child.value == 'Improper_Torsion': child.value = 'ImproperDihedral' - - - diff --git a/package/MDAnalysis/migration/fixes/fix_torsions.py b/package/MDAnalysis/migration/fixes/fix_torsions.py index dc319ee2144..409ae0a507d 100644 --- a/package/MDAnalysis/migration/fixes/fix_torsions.py +++ b/package/MDAnalysis/migration/fixes/fix_torsions.py @@ -28,4 +28,3 @@ def transform(self, node, results): args = head + [pytree.Node(syms.trailer, [Dot(), Name(method_name, prefix = method.prefix)])] new = pytree.Node(syms.power, args) return new - diff --git a/package/MDAnalysis/migration/test_dummy_torsion.py b/package/MDAnalysis/migration/test_dummy_torsion.py index 0bc2ef3015f..42e9a12dc79 100644 --- a/package/MDAnalysis/migration/test_dummy_torsion.py +++ b/package/MDAnalysis/migration/test_dummy_torsion.py @@ -16,4 +16,3 @@ class NewDihedral(NewParent, Torsion): pass #Improper_Torsion -> ImproperDihedral class NewImproperdihedral(Improper_Torsion): pass - diff --git a/package/MDAnalysis/selections/gromacs.py b/package/MDAnalysis/selections/gromacs.py index 78490405130..40cc9f13906 100644 --- a/package/MDAnalysis/selections/gromacs.py +++ b/package/MDAnalysis/selections/gromacs.py @@ -53,5 +53,3 @@ def _translate(self, atoms, **kwargs): def _write_head(self, out, **kwargs): out.write("[ {name!s} ]\n".format(**kwargs)) - - diff --git a/package/MDAnalysis/tests/__init__.py b/package/MDAnalysis/tests/__init__.py index aea8fddb7fd..f88c206bcd2 100644 --- a/package/MDAnalysis/tests/__init__.py +++ b/package/MDAnalysis/tests/__init__.py @@ -1,5 +1,5 @@ # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- -# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors @@ -36,8 +36,11 @@ Run all the tests with - >>> import MDAnalysis.tests - >>> MDAnalysis.tests.test() +.. code-block:: bash + + pytest --pyargs MDAnalysisTests + + Data ==== @@ -79,11 +82,3 @@ .. _Gromacs: http://www.gromacs.org """ -from __future__ import absolute_import, print_function - -try: - from MDAnalysisTests import run as test -except ImportError: - print("Install MDAnalysisTests first. The source package is available from") - print("http://pypi.python.org/pypi/MDAnalysisTests") - raise ImportError("Package MDAnalysisTests required!") diff --git a/package/MDAnalysis/tests/datafiles.py b/package/MDAnalysis/tests/datafiles.py index 9449ac24959..2b49531b687 100644 --- a/package/MDAnalysis/tests/datafiles.py +++ b/package/MDAnalysis/tests/datafiles.py @@ -50,4 +50,3 @@ print("and download and install the `MDAnalysisTests-x.y.z.tar.gz'") print("that matches your MDAnalysis release.") raise ImportError("MDAnalysisTests package not installed.") - diff --git a/package/MDAnalysis/topology/GSDParser.py b/package/MDAnalysis/topology/GSDParser.py index 0137b19068d..422c81820f3 100644 --- a/package/MDAnalysis/topology/GSDParser.py +++ b/package/MDAnalysis/topology/GSDParser.py @@ -52,7 +52,10 @@ """ from __future__ import absolute_import -import gsd.hoomd +import os +if os.name != 'nt': + # not supported on windows + import gsd.hoomd import numpy as np from . import guessers @@ -106,6 +109,9 @@ def parse(self, **kwargs): .. versionadded:: 0.17.0 """ + if os.name == 'nt': + raise NotImplementedError("GSD format not supported on Windows") + attrs = {} with gsd.hoomd.open(self.filename,mode='rb') as t : diff --git a/package/MDAnalysis/topology/LAMMPSParser.py b/package/MDAnalysis/topology/LAMMPSParser.py index 3d780b8b94e..b2a9bd1f435 100644 --- a/package/MDAnalysis/topology/LAMMPSParser.py +++ b/package/MDAnalysis/topology/LAMMPSParser.py @@ -24,10 +24,11 @@ LAMMPSParser ============ -Parses data_ files produced by LAMMPS_. +Parses data_ or dump_ files produced by LAMMPS_. .. _LAMMPS: http://lammps.sandia.gov/ .. _data: DATA file format: :http://lammps.sandia.gov/doc/2001/data_format.html +.. _dump: http://lammps.sandia.gov/doc/dump.html .. _atom_style_kwarg: @@ -65,6 +66,9 @@ :members: :inherited-members: +.. autoclass:: LammpsDumpParser + :members: + Deprecated classes ------------------ @@ -80,6 +84,7 @@ import logging import string import functools +import warnings from . import guessers from ..lib.util import openany, conv_float @@ -575,6 +580,54 @@ def _parse_box(self, header): return unitcell +class LammpsDumpParser(TopologyReaderBase): + """Parses Lammps ascii dump files in 'atom' format + + Only reads atom ids. Sets all masses to 1.0. + + .. versionadded:: 0.19.0 + """ + format = 'LAMMPSDUMP' + + def parse(self, **kwargs): + with openany(self.filename) as fin: + fin.readline() # ITEM TIMESTEP + fin.readline() # 0 + + fin.readline() # ITEM NUMBER OF ATOMS + natoms = int(fin.readline()) + + fin.readline() # ITEM BOX + fin.readline() # x + fin.readline() # y + fin.readline() # z + + indices = np.zeros(natoms, dtype=int) + types = np.zeros(natoms, dtype=object) + + fin.readline() # ITEM ATOMS + for i in range(natoms): + idx, atype, _, _, _ = fin.readline().split() + + indices[i] = idx + types[i] = atype + + order = np.argsort(indices) + indices = indices[order] + types = types[order] + + attrs = [] + attrs.append(Atomids(indices)) + attrs.append(Atomtypes(types)) + attrs.append(Masses(np.ones(natoms, dtype=np.float64), guessed=True)) + warnings.warn('Guessed all Masses to 1.0') + attrs.append(Resids(np.array([1], dtype=int))) + attrs.append(Resnums(np.array([1], dtype=int))) + attrs.append(Segids(np.array(['SYSTEM'], dtype=object))) + + return Topology(natoms, 1, 1, attrs=attrs) + + @functools.total_ordering class LAMMPSAtom(object): # pragma: no cover __slots__ = ("index", "name", "type", "chainid", "charge", "mass", "_positions") diff --git a/package/MDAnalysis/topology/MMTFParser.py b/package/MDAnalysis/topology/MMTFParser.py index 6f8a15d09e4..ea7cbd68916 100644 --- a/package/MDAnalysis/topology/MMTFParser.py +++ b/package/MDAnalysis/topology/MMTFParser.py @@ -92,6 +92,7 @@ SegmentAttr, # for model ) from ..core.selection import RangeSelection +from ..due import due, Doi def _parse_mmtf(fn): @@ -148,6 +149,11 @@ def apply(self, group): class MMTFParser(base.TopologyReaderBase): format = 'MMTF' + @due.dcite( + Doi('10.1371/journal.pcbi.1005575'), + description="MMTF Parser", + path='MDAnalysis.topology.MMTFParser', + ) def parse(self, **kwargs): if isinstance(self.filename, mmtf.MMTFDecoder): mtop = self.filename diff --git a/package/MDAnalysis/topology/PDBParser.py b/package/MDAnalysis/topology/PDBParser.py index a3ac2d5905f..5a1391285b1 100644 --- a/package/MDAnalysis/topology/PDBParser.py +++ b/package/MDAnalysis/topology/PDBParser.py @@ -59,6 +59,7 @@ import numpy as np import warnings +from six.moves import range from .guessers import guess_masses, guess_types from ..lib import util from .base import TopologyReaderBase, change_squash @@ -87,6 +88,63 @@ def float_or_default(val, default): except ValueError: return default +DIGITS_UPPER = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" +DIGITS_LOWER = DIGITS_UPPER.lower() +DIGITS_UPPER_VALUES = dict([pair for pair in zip(DIGITS_UPPER, range(36))]) +DIGITS_LOWER_VALUES = dict([pair for pair in zip(DIGITS_LOWER, range(36))]) + +def decode_pure(digits_values, s): + """Decodes the string s using the digit, value associations for each + character. + + Parameters + ---------- + digits_values: dict + A dictionary containing the base-10 numbers that each hexadecimal + number corresponds to. + s: str + The contents of the pdb index columns. + + Returns + ------- + The integer in base-10 corresponding to traditional base-36. + """ + result = 0 + n = len(digits_values) + for c in s: + result *= n + result += digits_values[c] + return result + + +def hy36decode(width, s): + """ + Decodes base-10/upper-case base-36/lower-case base-36 hybrid. + + Parameters + ---------- + width: int + The number of columns in the pdb file store atom index. + s: str + The contents of the pdb index columns. + + Returns + ------- + int + Base-10 integer corresponding to hybrid36. + """ + if (len(s) == width): + f = s[0] + if (f == "-" or f == " " or f.isdigit()): + return int(s) + elif (f in DIGITS_UPPER_VALUES): + return decode_pure(digits_values=DIGITS_UPPER_VALUES, + s=s) - 10 * 36 ** (width - 1) + 10 ** width + elif (f in DIGITS_LOWER_VALUES): + return decode_pure(digits_values=DIGITS_LOWER_VALUES, + s=s) + 16 * 36 ** (width - 1) + 10 ** width + raise ValueError("invalid number literal.") + class PDBParser(TopologyReaderBase): """Parser that obtains a list of atoms from a standard PDB file. @@ -167,11 +225,14 @@ def _parseatoms(self): record_types.append(line[:6].strip()) try: serial = int(line[6:11]) - except ValueError: - # serial can become '***' when they get too high - self._wrapped_serials = True - serial = last_wrapped_serial - last_wrapped_serial += 1 + except: + try: + serial = hy36decode(5, line[6:11]) + except ValueError: + # serial can become '***' when they get too high + self._wrapped_serials = True + serial = last_wrapped_serial + last_wrapped_serial += 1 finally: serials.append(serial) diff --git a/package/MDAnalysis/topology/TOPParser.py b/package/MDAnalysis/topology/TOPParser.py index 2717f6219b5..a5c5926fb56 100644 --- a/package/MDAnalysis/topology/TOPParser.py +++ b/package/MDAnalysis/topology/TOPParser.py @@ -1,5 +1,5 @@ # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- -# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors @@ -28,28 +28,37 @@ Amber keywords are turned into the following attributes: -+-----------------+----------------------+ -| AMBER flag | MDAnalysis attribute | -+-----------------+----------------------+ -| ATOM_NAME | names | -+-----------------+----------------------+ -| CHARGE | charges | -+-----------------+----------------------+ -| ATOMIC_NUMBER | elements | -+-----------------+----------------------+ -| MASS | masses | -+-----------------+----------------------+ -| ATOM_TYPE_INDEX | type_indices | -+-----------------+----------------------+ -| AMBER_ATOM_TYPE | types | -+-----------------+----------------------+ -| RESIDUE_LABEL | resnames | -+-----------------+----------------------+ -| RESIDUE_POINTER | residues | -+-----------------+----------------------+ ++----------------------------+----------------------+ +| AMBER flag | MDAnalysis attribute | ++----------------------------+----------------------+ +| ATOM_NAME | names | ++----------------------------+----------------------+ +| CHARGE | charges | ++----------------------------+----------------------+ +| ATOMIC_NUMBER | elements | ++----------------------------+----------------------+ +| MASS | masses | ++----------------------------+----------------------+ +| BONDS_INC_HYDROGEN | bonds | +| BONDS_WITHOUT_HYDROGEN | | ++----------------------------+----------------------+ +| ANGLES_INC_HYDROGEN | angles | +| ANGLES_WITHOUT_HYDROGEN | | ++----------------------------+----------------------+ +| DIHEDRALS_INC_HYDROGEN | dihedrals / improper | +| DIHEDRALS_WITHOUT_HYDROGEN | | ++----------------------------+----------------------+ +| ATOM_TYPE_INDEX | type_indices | ++----------------------------+----------------------+ +| AMBER_ATOM_TYPE | types | ++----------------------------+----------------------+ +| RESIDUE_LABEL | resnames | ++----------------------------+----------------------+ +| RESIDUE_POINTER | residues | ++----------------------------+----------------------+ TODO: - Add reading of bonds etc + More stringent tests .. Note:: @@ -74,6 +83,7 @@ import numpy as np import functools from math import ceil +import itertools from . import guessers from .tables import NUMBER_TO_ELEMENT @@ -92,6 +102,10 @@ Resnums, Segids, AtomAttr, + Bonds, + Angles, + Dihedrals, + Impropers ) @@ -113,6 +127,9 @@ class TOPParser(TopologyReaderBase): - Atomtypes - Resnames - Type_indices + - Bonds + - Angles + - Dihedrals (inc. impropers) Guesses the following attributes: - Elements (if not included in topology) @@ -124,8 +141,10 @@ class TOPParser(TopologyReaderBase): .. _`PARM parameter/topology file specification`: http://ambermd.org/formats.html#topology - .. versionchanged:: 0.7.6 + .. versionchanged:: 0.7.6 parses both amber10 and amber12 formats + .. versionchanged:: 0.19.0 + parses bonds, angles, dihedrals, and impropers """ format = ['TOP', 'PRMTOP', 'PARM7'] @@ -145,7 +164,13 @@ def parse(self, **kwargs): "ATOM_TYPE_INDEX": (1, 10, self.parse_type_indices, "type_indices", 0), "AMBER_ATOM_TYPE": (1, 20, self.parse_types, "types", 0), "RESIDUE_LABEL": (1, 20, self.parse_resnames, "resname", 11), - "RESIDUE_POINTER": (2, 10, self.parse_residx, "respoint", 11), + "RESIDUE_POINTER": (1, 10, self.parse_residx, "respoint", 11), + "BONDS_INC_HYDROGEN": (3, 10, self.parse_bonded, "bondh", 2), + "BONDS_WITHOUT_HYDROGEN": (3, 10, self.parse_bonded, "bonda", 3), + "ANGLES_INC_HYDROGEN": (4, 10, self.parse_bonded, "angh", 4), + "ANGLES_WITHOUT_HYDROGEN": (4, 10, self.parse_bonded, "anga", 5), + "DIHEDRALS_INC_HYDROGEN": (5, 10, self.parse_bonded, "dihh", 6), + "DIHEDRALS_WITHOUT_HYDROGEN": (5, 10, self.parse_bonded, "diha", 7) } attrs = {} # empty dict for attrs that we'll fill @@ -176,28 +201,36 @@ def parse(self, **kwargs): while next_section is not None: try: - (atoms_per, per_line, + (num_per_record, per_line, func, name, sect_num) = sections[next_section] except KeyError: def next_getter(): return self.skipper() else: - num = sys_info[sect_num] + num = sys_info[sect_num] * num_per_record numlines = (num // per_line) if num % per_line != 0: numlines += 1 - attrs[name] = func(atoms_per, numlines) + attrs[name] = func(num_per_record, numlines) def next_getter(): return next(self.topfile) try: line = next_getter() + # Capture case where section is empty w/ 1 empty line + if numlines == 0 and not line.strip(): + line = next_getter() except StopIteration: next_section = None else: - next_section = line.split("%FLAG")[1].strip() + try: + next_section = line.split("%FLAG")[1].strip() + except IndexError: + msg = ("%FLAG section not found, formatting error " + "for PARM7 file {0} ".format(self.filename)) + raise IndexError(msg) # strip out a few values to play with them n_atoms = len(attrs['name']) @@ -210,6 +243,16 @@ def next_getter(): n_res = len(attrs['resname']) + # Deal with recreating bonds and angle records here + attrs['bonds'] = Bonds([i for i in itertools.chain( + attrs.pop('bonda'), attrs.pop('bondh'))]) + + attrs['angles'] = Angles([i for i in itertools.chain( + attrs.pop('anga'), attrs.pop('angh'))]) + + attrs['dihedrals'], attrs['impropers'] = self.parse_dihedrals( + attrs.pop('diha'), attrs.pop('dihh')) + # Guess elements if not in topology if not 'elements' in attrs: attrs['elements'] = Elements( @@ -230,73 +273,248 @@ def next_getter(): return top def skipper(self): - """Skip until we find the next %FLAG entry and return that""" + """TOPParser :class: helper function, skips lines of input parm7 file + until we find the next %FLAG entry and return that + + Returns + ------- + line : string + String containing the current line of the parm7 file + """ line = next(self.topfile) while not line.startswith("%FLAG"): line = next(self.topfile) return line - def parse_names(self, atoms_per, numlines): - vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: x) + def parse_names(self, num_per_record, numlines): + """Extracts atoms names from parm7 file + + Parameters + ---------- + num_per_record : int + The number of entries for each record in the section (unused input) + numlines : int + The number of lines to be parsed in current section + + Returns + ------- + attr : :class:`Atomnames` + A :class:`Atomnames` instance containing the names of each atom as + defined in the parm7 file + """ + vals = self.parsesection_mapper(numlines, lambda x: x) attr = Atomnames(np.array(vals, dtype=object)) return attr - def parse_resnames(self, atoms_per, numlines): - vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: x) + def parse_resnames(self, num_per_record, numlines): + """Extracts the names of each residue + + Parameters + ---------- + num_per_record : int + The number of entries for each recrod in section (unused input) + numlines : int + The number of lines to be parsed in current section + + Returns + ------- + attr : :class:`Resnames` + A :class:`Resnames` instance containing the names of each residue + as defined in the parm7 file + """ + vals = self.parsesection_mapper(numlines, lambda x: x) attr = Resnames(np.array(vals, dtype=object)) return attr - def parse_charges(self, atoms_per, numlines): - vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: float(x)) + def parse_charges(self, num_per_record, numlines): + """Extracts the partial charges for each atom + + Parameters + ---------- + num_per_record : int + The number of entries for each record in section (unused input) + numlines : int + The number of lines to be parsed in current section + + Returns + ------- + attr : :class:`Charges` + A :class:`Charges` instance containing the partial charges of each + atom as defined in the parm7 file + """ + vals = self.parsesection_mapper(numlines, lambda x: float(x)) charges = np.array(vals, dtype=np.float32) charges /= 18.2223 # to electron charge units attr = Charges(charges) return attr - def parse_masses(self, atoms_per, numlines): - vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: float(x)) + def parse_masses(self, num_per_record, numlines): + """Extracts the mass of each atom + + Parameters + ---------- + num_per_record : int + The number of entries for each record in section (unused input) + numlines : int + The number of lines to be parsed in current section + + Returns + ------- + attr : :class:`Masses` + A :class:`Masses` instance containing the mass of each atom as + defined in the parm7 file + """ + vals = self.parsesection_mapper(numlines, lambda x: float(x)) attr = Masses(vals) return attr - def parse_elements(self, atoms_per, numlines): + def parse_elements(self, num_per_record, numlines): + """Extracts the atomic numbers of each atom and converts to element type + + Parameters + ---------- + num_per_record : int + The number of entries for each record in section(unused input) + numlines : int + The number of lines to be pasred in current section + + Returns + ------- + attr : :class:`Elements` + A :class:`Elements` instance containing the element of each atom + as defined in the parm7 file + """ vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: NUMBER_TO_ELEMENT[int(x)]) + numlines, lambda x: NUMBER_TO_ELEMENT[int(x)]) attr = Elements(np.array(vals, dtype=object)) return attr - def parse_types(self, atoms_per, numlines): - vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: x) + def parse_types(self, num_per_record, numlines): + """Extracts the force field atom types of each atom + + Parameters + ---------- + num_per_record : int + The number of entries for each record in section (unused input) + numlines : int + The number of lines to be parsed in current section + + Returns + ------- + attr : :class:`Atomtypes` + A :class:`Atomtypes` instance containing the atom types for each + atom as defined in the parm7 file + """ + vals = self.parsesection_mapper(numlines, lambda x: x) attr = Atomtypes(np.array(vals, dtype=object)) return attr - def parse_type_indices(self, atoms_per, numlines): - vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: int(x)) + def parse_type_indices(self, num_per_record, numlines): + """Extracts the index of atom types of the each atom involved in Lennard + Jones (6-12) interactions. + + Parameters + ---------- + num_per_record : int + The number of entries for each record in section (unused input) + numlines : int + The number of lines to be parsed in current section + + Returns + ------- + attr :class:`TypeIndices` + A :class:`TypeIndices` instance containing the LJ 6-12 atom type + index for each atom + """ + vals = self.parsesection_mapper(numlines, lambda x: int(x)) attr = TypeIndices(np.array(vals, dtype=np.int32)) return attr - def parse_residx(self, atoms_per, numlines): - vals = self.parsesection_mapper( - atoms_per, numlines, lambda x: int(x) - 1) + def parse_residx(self, num_per_record, numlines): + """Extracts the residue pointers for each atom + + Parameters + ---------- + num_per_record : int + The number of entries for each record in section (unused input) + numlines : int + The number of lines to be parsed in current section + + Returns + ------- + vals : list of int + A list of zero-formatted residue pointers for each atom + """ + vals = self.parsesection_mapper(numlines, lambda x: int(x) - 1) return vals - def parsebond(self, atoms_per, numlines): - y = next(self.topfile).strip("%FORMAT(") - section = [] - for i in range(numlines): - l = next(self.topfile) - # Subtract 1 from each number to ensure zero-indexing for the atoms - fields = np.int64(l.split()) - 1 - for j in range(0, len(fields), atoms_per): - section.append(tuple(fields[j:j+atoms_per])) + def parse_chunks(self, data, chunksize): + """Helper function to parse AMBER PRMTOP bonds/angles. + + Parameters + ---------- + data : list of int + Input list of the parm7 bond/angle section, zero-indexed + num_per_record : int + The number of entries for each record in the input list + + Returns + ------- + vals : list of int tuples + A list of tuples containing the atoms involved in a given bonded + interaction + + Note + ---- + In the parm7 format this information is structured in the following + format: [ atoms 1:n, internal index ] + Where 1:n represent the ids of the n atoms involved in the bond/angle + and the internal index links to a given set of FF parameters. + Therefore, to extract the required information, we split out the list + into chunks of size num_per_record, and only extract the atom ids. + """ + vals = [tuple(data[x:x+chunksize-1]) + for x in range(0, len(data), chunksize)] + return vals + + def parse_bonded(self, num_per_record, numlines): + """Extracts bond information from PARM7 format files + + Parameters + ---------- + num_per_record : int + The number of entries for each record in section + numlines : int + The number of lines to be parsed for this section + + Note + ---- + For the bond/angle sections of parm7 files, the atom numbers are set to + coordinate array index values. As detailed in + http://ambermd.org/formats.html to recover the actual atom number, one + should divide the values by 3 and add 1. Here, since we want to satisfy + zero-indexing, we only divide by 3. + """ + fields = self.parsesection_mapper(numlines, lambda x: int(x) // 3) + section = self.parse_chunks(fields, num_per_record) return section - def parsesection_mapper(self, atoms_per, numlines, mapper): + def parsesection_mapper(self, numlines, mapper): + """Parses FORTRAN formatted section, and returns a list of all entries + in each line + + Parameters + ---------- + numlines : int + The number of lines to be parsed in this section + mapper : lambda operator + Operator to format entries in current section + + Returns + ------- + section : list + A list of all entries in a given parm7 section + """ section = [] y = next(self.topfile).strip("%FORMAT(") y.strip(")") @@ -308,3 +526,50 @@ def parsesection_mapper(self, atoms_per, numlines, mapper): if val: section.append(mapper(val)) return section + + def parse_dihedrals(self, diha, dihh): + """Combines hydrogen and non-hydrogen containing AMBER dihedral lists + and extracts sublists for conventional dihedrals and improper angles + + Parameters + ---------- + diha : list of tuples + The atom ids of dihedrals not involving hydrogens + dihh : list of tuples + The atom ids of dihedrals involving hydrogens + + Returns + ------- + dihedrals : :class:`Dihedrals` + A :class:`Dihedrals` instance containing a list of all unique + dihedrals as defined by the parm7 file + impropers : :class:`Impropers` + A :class:`Impropers` instance containing a list of all unique + improper dihedrals as defined by the parm7 file + + Note + ---- + As detailed in http://ambermd.org/formats.html, the dihedral sections + of parm7 files contain information about both conventional dihedrals + and impropers. The following must be accounted for: + 1) If the fourth atom in a dihedral entry is given a negative value, + this indicates that it is an improper. + 2) If the third atom in a dihedral entry is given a negative value, + this indicates that it 1-4 NB interactions are ignored for this + dihedrals. This could be due to the dihedral within a ring, or if it is + part of a multi-term dihedral definition or if it is an improper. + """ + improp = [] + dihed = [] + for i in itertools.chain(diha, dihh): + if i[3] < 0: + improp.append(i[:2]+(abs(i[2]),)+(abs(i[3]),)) + elif i[2] < 0: + vals = i[:2] + (abs(i[2]),) + i[3:] + dihed.append(vals) + else: + dihed.append(i) + dihed = sorted(set(dihed)) + dihedrals = Dihedrals(dihed) + impropers = Impropers(improp) + return dihedrals, impropers diff --git a/package/MDAnalysis/topology/TPRParser.py b/package/MDAnalysis/topology/TPRParser.py index 43cbfbfe892..06205f9b213 100644 --- a/package/MDAnalysis/topology/TPRParser.py +++ b/package/MDAnalysis/topology/TPRParser.py @@ -76,7 +76,7 @@ tabulated potential with exclusion/connection (type 8), tabulated potential without exclusion/connection (type 9), constraints with exclusion/connection (type 1), constraints without exclusion/connection (type - 2) + 2), SETTLE constraints * angles: regular angles (type 1), G96 angles (type 2), cross bond-bond (type3), cross-bond-angle (type 4), Urey-Bradley (type 5), quartic angles (type 6), restricted bending potential (type 10), tabulated angles (type 8) diff --git a/package/MDAnalysis/topology/TXYZParser.py b/package/MDAnalysis/topology/TXYZParser.py index 63698602d06..74bfdce4513 100644 --- a/package/MDAnalysis/topology/TXYZParser.py +++ b/package/MDAnalysis/topology/TXYZParser.py @@ -43,7 +43,10 @@ """ from __future__ import absolute_import + +import itertools import numpy as np +from six.moves import zip from . import guessers from ..lib.util import openany @@ -88,9 +91,22 @@ def parse(self, **kwargs): names = np.zeros(natoms, dtype=object) types = np.zeros(natoms, dtype=np.int) bonds = [] + # Find first atom line, maybe there's box information + fline = inf.readline() + try: + # If a box second value will be a float + # If an atom, second value will be a string + float(fline.split()[1]) + except ValueError: + # If float conversion failed, we have first atom line + pass + else: + # If previous try succeeded it was a box + # so read another line to find the first atom line + fline = inf.readline() # Can't infinitely read as XYZ files can be multiframe - for i in range(natoms): - line = inf.readline().split() + for i, line in zip(range(natoms), itertools.chain([fline], inf)): + line = line.split() atomids[i]= line[0] names[i] = line[1] types[i] = line[5] diff --git a/package/MDAnalysis/topology/__init__.py b/package/MDAnalysis/topology/__init__.py index 073ab93313e..5c0cf1c13a9 100644 --- a/package/MDAnalysis/topology/__init__.py +++ b/package/MDAnalysis/topology/__init__.py @@ -43,118 +43,121 @@ .. table:: Table of Supported Topology Formats - ================= ========= ================= =================================================== - Name extension attributes remarks - ================= ========= ================= =================================================== - CHARMM/XPLOR PSF psf resnames, :mod:`MDAnalysis.topology.PSFParser` - names, types, - charges, - bonds, angles, - dihedrals, - impropers - - CHARMM CARD [#a]_ crd names, "CARD" coordinate output from CHARMM; deals with - tempfactors, either standard or EXTended format; - resnames, :mod:`MDAnalysis.topology.CRDParser` - - Brookhaven [#a]_ pdb/ent names, bonds, a simplified PDB format (as used in MD simulations) - resids, resnums, is read by default - types, - chainids, - occupancies, - bfactors, - resids, icodes, - resnames, - segids, - - XPDB [#a]_ pdb As PDB except Extended PDB format (can use 5-digit residue - icodes numbers). To use, specify the format "XPBD" - explicitly: - ``Universe(..., topology_format="XPDB")``. - Module :mod:`MDAnalysis.coordinates.PDB` - - PQR [#a]_ pqr names, charges, PDB-like but whitespace-separated files with charge - types, and radius information; - radii, resids, :mod:`MDAnalysis.topology.PQRParser` - resnames, icodes, - segids - - PDBQT [#a]_ pdbqt names, types, file format used by AutoDock with atom types and - altLocs, charges, partial charges. Module: - resnames, :mod:`MDAnalysis.topology.PDBQTParser` - resids, - icodes, - occupancies, - tempfactors, - segids, - - GROMOS96 [#a]_ gro names, resids, GROMOS96 coordinate file; - resnames, :mod:`MDAnalysis.topology.GROParser` - - AMBER top, names, charges simple AMBER format reader (only supports a subset - prmtop, type_indices, of flags); - parm7 types, :mod:`MDAnalysis.topology.TOPParser` - resnames, - - DESRES [#a]_ dms names, numbers, DESRES molecular sturcture reader (only supports - masses, charges, the atom and bond records); - chainids, resids, :mod:`MDAnalysis.topology.DMSParser` - resnames, segids, - radii, - - TPR [#b]_ tpr names, types, Gromacs portable run input reader (limited - resids, resnames, experimental support for some of the more recent - charges, bonds, versions of the file format); - masses, moltypes, :mod:`MDAnalysis.topology.TPRParser` - molnums - - MOL2 [#a]_ mol2 ids, names, Tripos MOL2 molecular structure format; - types, resids, :mod:`MDAnalysis.topology.MOL2Parser` - charges, bonds, - resnames, - - LAMMPS [#a]_ data ids, types, LAMMPS Data file parser - masses, charges, :mod:`MDAnalysis.topology.LAMMPSParser` - resids, bonds, - angles, dihedrals - - XYZ [#a]_ xyz names XYZ File Parser. Reads only the labels from atoms - and constructs minimal topology data. - :mod:`MDAnalysis.topology.XYZParser` - - TXYZ [#a]_ txyz, names, atomids, Tinker XYZ File Parser. Reads atom labels, numbers - arc masses, types, and connectivity; masses are guessed from atoms names. - bonds :mod:`MDAnalysis.topology.TXYZParser` - - GAMESS [#a]_ gms, names, GAMESS output parser. Read only atoms of assembly - log atomic charges, section (atom, elems and coords) and construct - topology. - :mod:`MDAnalysis.topology.GMSParser` - - DL_Poly [#a]_ config, ids, names DL_Poly CONFIG or HISTORY file. Reads only the - history atom names. If atoms are written out of order, will - correct the order. - :mod:`MDAnalysis.topology.DLPolyParser` - - Hoomd XML xml types, charges, `HOOMD XML`_ topology file. Reads atom types, - radii, masses masses, and charges if possible. Also reads bonds, - bonds, angles, angles, and dihedrals. - dihedrals :mod:`MDAnalysis.topology.HoomdXMLParser` - - GSD [#a]_ gsd types, charges, GSD topology file. Reads atom types, - radii, masses masses, and charges if possible. Also reads bonds, - bonds, angles, angles, and dihedrals. - dihedrals :mod:`MDAnalysis.topology.GSDParser` - - Macromolecular mmtf altLocs, `Macromolecular Transmission Format (MMTF)`_. - transmission bfactors, bonds, An efficient compact format for biomolecular - format charges, masses, structures. - names, - occupancies, - types, icodes, - resnames, resids, - segids, models - ================= ========= ================= =================================================== + ================= ========== ================= =================================================== + Name extension attributes remarks + ================= ========== ================= =================================================== + CHARMM/XPLOR PSF psf resnames, :mod:`MDAnalysis.topology.PSFParser` + names, types, + charges, + bonds, angles, + dihedrals, + impropers + + CHARMM CARD [#a]_ crd names, "CARD" coordinate output from CHARMM; deals with + tempfactors, either standard or EXTended format; + resnames, :mod:`MDAnalysis.topology.CRDParser` + + Brookhaven [#a]_ pdb/ent names, bonds, a simplified PDB format (as used in MD simulations) + resids, resnums, is read by default + types, + chainids, + occupancies, + bfactors, + resids, icodes, + resnames, + segids, + + XPDB [#a]_ pdb As PDB except Extended PDB format (can use 5-digit residue + icodes numbers). To use, specify the format "XPBD" + explicitly: + ``Universe(..., topology_format="XPDB")``. + Module :mod:`MDAnalysis.coordinates.PDB` + + PQR [#a]_ pqr names, charges, PDB-like but whitespace-separated files with charge + types, and radius information; + radii, resids, :mod:`MDAnalysis.topology.PQRParser` + resnames, icodes, + segids + + PDBQT [#a]_ pdbqt names, types, file format used by AutoDock with atom types and + altLocs, charges, partial charges. Module: + resnames, :mod:`MDAnalysis.topology.PDBQTParser` + resids, + icodes, + occupancies, + tempfactors, + segids, + + GROMOS96 [#a]_ gro names, resids, GROMOS96 coordinate file; + resnames, :mod:`MDAnalysis.topology.GROParser` + + AMBER top, names, charges simple AMBER format reader (only supports a subset + prmtop, type_indices, of flags); + parm7 types, :mod:`MDAnalysis.topology.TOPParser` + resnames, + + DESRES [#a]_ dms names, numbers, DESRES molecular sturcture reader (only supports + masses, charges, the atom and bond records); + chainids, resids, :mod:`MDAnalysis.topology.DMSParser` + resnames, segids, + radii, + + TPR [#b]_ tpr names, types, Gromacs portable run input reader (limited + resids, resnames, experimental support for some of the more recent + charges, bonds, versions of the file format); + masses, moltypes, :mod:`MDAnalysis.topology.TPRParser` + molnums + + MOL2 [#a]_ mol2 ids, names, Tripos MOL2 molecular structure format; + types, resids, :mod:`MDAnalysis.topology.MOL2Parser` + charges, bonds, + resnames, + + LAMMPS [#a]_ data ids, types, LAMMPS Data file parser + masses, charges, :mod:`MDAnalysis.topology.LAMMPSParser` + resids, bonds, + angles, dihedrals + + LAMMPS [#a]_ lammpsdump id, masses LAMMPS ascii dump file reader + :mod:`MDAnalysis.topology.LAMMPSParser` + + XYZ [#a]_ xyz names XYZ File Parser. Reads only the labels from atoms + and constructs minimal topology data. + :mod:`MDAnalysis.topology.XYZParser` + + TXYZ [#a]_ txyz, names, atomids, Tinker XYZ File Parser. Reads atom labels, numbers + arc masses, types, and connectivity; masses are guessed from atoms names. + bonds :mod:`MDAnalysis.topology.TXYZParser` + + GAMESS [#a]_ gms, names, GAMESS output parser. Read only atoms of assembly + log atomic charges, section (atom, elems and coords) and construct + topology. + :mod:`MDAnalysis.topology.GMSParser` + + DL_Poly [#a]_ config, ids, names DL_Poly CONFIG or HISTORY file. Reads only the + history atom names. If atoms are written out of order, will + correct the order. + :mod:`MDAnalysis.topology.DLPolyParser` + + Hoomd XML xml types, charges, `HOOMD XML`_ topology file. Reads atom types, + radii, masses masses, and charges if possible. Also reads bonds, + bonds, angles, angles, and dihedrals. + dihedrals :mod:`MDAnalysis.topology.HoomdXMLParser` + + GSD [#a]_ gsd types, charges, GSD topology file. Reads atom types, + radii, masses masses, and charges if possible. Also reads bonds, + bonds, angles, angles, and dihedrals. + dihedrals :mod:`MDAnalysis.topology.GSDParser` + + Macromolecular mmtf altLocs, `Macromolecular Transmission Format (MMTF)`_. + transmission bfactors, bonds, An efficient compact format for biomolecular + format charges, masses, structures. + names, + occupancies, + types, icodes, + resnames, resids, + segids, models + ================= ========== ================= =================================================== .. [#a] This format can also be used to provide *coordinates* so that it is possible to create a full diff --git a/package/MDAnalysis/topology/guessers.py b/package/MDAnalysis/topology/guessers.py index 06689168079..bed9cca8b05 100644 --- a/package/MDAnalysis/topology/guessers.py +++ b/package/MDAnalysis/topology/guessers.py @@ -232,25 +232,14 @@ def guess_bonds(atoms, coords, box=None, **kwargs): bonds = [] - for i, atom in enumerate(atoms[:-1]): - vdw_i = vdwradii[atomtypes[i]] - max_d = (vdw_i + max_vdw) * fudge_factor - - # using self_distance_array scales O(n^2) - # 20,000 atoms = 1.6 Gb memory - dist = distances.distance_array(coords[i][None, :], coords[i + 1:], - box=box)[0] - idx = np.where((dist > lower_bound) & (dist <= max_d))[0] - - for a in idx: - j = i + 1 + a - atom_j = atoms[j] - - if dist[a] < (vdw_i + vdwradii[atomtypes[j]]) * fudge_factor: - # because of method used, same bond won't be seen twice, - # so don't need to worry about duplicates - bonds.append((atom.index, atom_j.index)) - + pairs, dist = distances.self_capped_distance(coords, + max_cutoff=2.0*max_vdw, + min_cutoff=lower_bound, + box=box) + for idx, (i, j) in enumerate(pairs): + d = (vdwradii[atomtypes[i]] + vdwradii[atomtypes[j]])*fudge_factor + if (dist[idx] < d): + bonds.append((atoms[i].index, atoms[j].index)) return tuple(bonds) diff --git a/package/MDAnalysis/topology/tpr/utils.py b/package/MDAnalysis/topology/tpr/utils.py index de70643024e..724beeda927 100644 --- a/package/MDAnalysis/topology/tpr/utils.py +++ b/package/MDAnalysis/topology/tpr/utils.py @@ -635,6 +635,27 @@ def do_moltype(data, symtab, fver): dihs += list(ik_obj.process(ias)) elif ik_obj.name in ['IDIHS', 'PIDIHS']: impr += list(ik_obj.process(ias)) + elif ik_obj.name == 'SETTLE': + # SETTLE interactions are optimized triangular constraints for + # water molecules. They should be counted as a pair of bonds + # between the oxigen and the hydrogens. In older versions of + # the TPR format only specifies the index of the oxygen and + # assumes that the next two atoms are the hydrogens. + if len(ias) == 2: + # Old format. Only the first atom is specified. + base_atom = ias[1] + bonds += [ + [base_atom, base_atom + 1], + [base_atom, base_atom + 2], + ] + else: + all_settle = ik_obj.process(ias) + for settle in all_settle: + base_atom = settle[0] + bonds += [ + [settle[0], settle[1]], + [settle[0], settle[2]], + ] else: # other interaction types are not interested at the moment pass diff --git a/package/MDAnalysis/transformations/__init__.py b/package/MDAnalysis/transformations/__init__.py new file mode 100644 index 00000000000..bcefa903e2c --- /dev/null +++ b/package/MDAnalysis/transformations/__init__.py @@ -0,0 +1,96 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# + + +"""\ +Trajectory transformations --- :mod:`MDAnalysis.transformations` +================================================================ + +The transformations submodule contains a collection of functions to modify the +trajectory. Coordinate transformations, such as PBC corrections and molecule fitting +are often required for some analyses and visualization, and the functions in this +module allow transformations to be applied on-the-fly. +These transformation functions can be called by the user for any given +timestep of the trajectory, added as a workflow using :meth:`add_transformations` +of the :mod:`~MDAnalysis.coordinates.base` module, or upon Universe creation using +the keyword argument `transformations`. Note that in the two latter cases, the +workflow cannot be changed after being defined. + +In addition to the specific arguments that each transformation can take, they also +contain a wrapped function that takes a `Timestep` object as argument. +So, a transformation can be roughly defined as follows: + +.. code-block:: python + + def transformations(*args,**kwargs): + # do some things + def wrapped(ts): + # apply changes to the Timestep object + return ts + + return wrapped + + +See `MDAnalysis.transformations.translate` for a simple example. + +Currently implemented transformations are: + + - translate: translate the coordinates of a given trajectory frame by a given vector. + - center_in_box: translate the coordinates of a given trajectory frame so that a given + AtomGroup is centered in the unit cell + - rotateby: rotates the coordinates by a given angle arround an axis formed by a direction + and a point + +Examples +-------- + +e.g. translate the coordinates of a frame: + +.. code-block:: python + + u = MDAnalysis.Universe(topology, trajectory) + new_ts = MDAnalysis.transformations.translate([1,1,1])(u.trajectory.ts) + +e.g. create a workflow and adding it to the trajectory: + +.. code-block:: python + + u = MDAnalysis.Universe(topology, trajectory) + workflow = [MDAnalysis.transformations.translate([1,1,1]), + MDAnalysis.transformations.translate([1,2,3])] + u.trajetory.add_transformations(*workflow) + +e.g. giving a workflow as a keyword argument when defining the universe: + +.. code-block:: python + + workflow = [MDAnalysis.transformations.translate([1,1,1]), + MDAnalysis.transformations.translate([1,2,3])] + u = MDAnalysis.Universe(topology, trajectory, transformations = *workflow) + + +""" + +from __future__ import absolute_import + +from .translate import translate, center_in_box +from .rotate import rotateby diff --git a/package/MDAnalysis/transformations/rotate.py b/package/MDAnalysis/transformations/rotate.py new file mode 100644 index 00000000000..ce6df7b8e26 --- /dev/null +++ b/package/MDAnalysis/transformations/rotate.py @@ -0,0 +1,150 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# + +"""\ +Trajectory rotation --- :mod:`MDAnalysis.transformations.rotate` +================================================================ + +Rotates the coordinates by a given angle arround an axis formed by a direction and a +point + +.. autofunction:: rotateby + +""" +from __future__ import absolute_import + +import math +import numpy as np +from functools import partial + +from ..lib.transformations import rotation_matrix +from ..lib.util import get_weights + +def rotateby(angle, direction, point=None, ag=None, weights=None, wrap=False): + ''' + Rotates the trajectory by a given angle on a given axis. The axis is defined by + the user, combining the direction vector and a point. This point can be the center + of geometry or the center of mass of a user defined AtomGroup, or an array defining + custom coordinates. + + Examples + -------- + + e.g. rotate the coordinates by 90 degrees on a axis formed by the [0,0,1] vector and + the center of geometry of a given AtomGroup: + + .. code-block:: python + + ts = u.trajectory.ts + angle = 90 + ag = u.atoms() + d = [0,0,1] + rotated = MDAnalysis.transformations.rotate(angle, direction=d, ag=ag)(ts) + + e.g. rotate the coordinates by a custom axis: + + .. code-block:: python + + ts = u.trajectory.ts + angle = 90 + p = [1,2,3] + d = [0,0,1] + rotated = MDAnalysis.transformations.rotate(angle, direction=d, point=point)(ts) + + Parameters + ---------- + angle: float + rotation angle in degrees + direction: array-like + vector that will define the direction of a custom axis of rotation from the + provided point. Expected shapes are (3, ) or (1, 3). + ag: AtomGroup, optional + use the weighted center of an AtomGroup as the point from where the rotation axis + will be defined. If no AtomGroup is given, the `point` argument becomes mandatory + point: array-like, optional + list of the coordinates of the point from where a custom axis of rotation will + be defined. Expected shapes are (3, ) or (1, 3). If no point is given, the + `ag` argument becomes mandatory. + weights: {"mass", ``None``} or array_like, optional + define the weights of the atoms when calculating the center of the AtomGroup. + With ``"mass"`` uses masses as weights; with ``None`` weigh each atom equally. + If a float array of the same length as `ag` is provided, use each element of + the `array_like` as a weight for the corresponding atom in `ag`. Default is + None. + wrap: bool, optional + If `True`, all the atoms from the given AtomGroup will be moved to the unit cell + before calculating the center of mass or geometry. Default is `False`, no changes + to the atom coordinates are done before calculating the center of the AtomGroup. + + Returns + ------- + MDAnalysis.coordinates.base.Timestep + + Warning + ------- + Wrapping/unwrapping the trajectory or performing PBC corrections may not be possible + after rotating the trajectory. + + ''' + angle = np.deg2rad(angle) + try: + direction = np.asarray(direction, np.float32) + if direction.shape != (3, ) and direction.shape != (1, 3): + raise ValueError('{} is not a valid direction'.format(direction)) + direction = direction.reshape(3, ) + except ValueError: + raise ValueError('{} is not a valid direction'.format(direction)) + if point is not None: + point = np.asarray(point, np.float32) + if point.shape != (3, ) and point.shape != (1, 3): + raise ValueError('{} is not a valid point'.format(point)) + point = point.reshape(3, ) + elif ag: + try: + atoms = ag.atoms + except AttributeError: + raise ValueError('{} is not an AtomGroup object'.format(ag)) + else: + try: + weights = get_weights(atoms, weights=weights) + except (ValueError, TypeError): + raise TypeError("weights must be {'mass', None} or an iterable of the " + "same size as the atomgroup.") + center_method = partial(atoms.center, weights, pbc=wrap) + else: + raise ValueError('A point or an AtomGroup must be specified') + + def wrapped(ts): + if point is None: + position = center_method() + else: + position = point + matrix = rotation_matrix(angle, direction, position) + rotation = matrix[:3, :3].T + translation = matrix[:3, 3] + ts.positions= np.dot(ts.positions, rotation) + ts.positions += translation + + return ts + + return wrapped + \ No newline at end of file diff --git a/package/MDAnalysis/transformations/translate.py b/package/MDAnalysis/transformations/translate.py new file mode 100644 index 00000000000..f3728294df3 --- /dev/null +++ b/package/MDAnalysis/transformations/translate.py @@ -0,0 +1,141 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# + +"""\ +Trajectory translation --- :mod:`MDAnalysis.transformations.translate` +====================================================================== + +Translate the coordinates of a given trajectory by a given vector. +The vector can either be user defined, using the function :func:`translate` +or defined by centering an AtomGroup in the unit cell using the function +:func:`center_in_box` + +""" +from __future__ import absolute_import, division + +import numpy as np +from functools import partial + +from ..lib.mdamath import triclinic_vectors + +def translate(vector): + """ + Translates the coordinates of a given :class:`~MDAnalysis.coordinates.base.Timestep` + instance by a given vector. + + Example + ------- + ts = MDAnalysis.transformations.translate([1,2,3])(ts) + + Parameters + ---------- + vector: array-like + coordinates of the vector to which the coordinates will be translated + + Returns + ------- + :class:`~MDAnalysis.coordinates.base.Timestep` object + + """ + if len(vector)>2: + vector = np.float32(vector) + else: + raise ValueError("{} vector is too short".format(vector)) + + def wrapped(ts): + ts.positions += vector + + return ts + + return wrapped + + +def center_in_box(ag, center='geometry', point=None, wrap=False): + """ + Translates the coordinates of a given :class:`~MDAnalysis.coordinates.base.Timestep` + instance so that the center of geometry/mass of the given :class:`~MDAnalysis.core.groups.AtomGroup` + is centered on the unit cell. The unit cell dimensions are taken from the input Timestep object. + If a point is given, the center of the atomgroup will be translated to this point instead. + + Example + ------- + + .. code-block:: python + + ag = u.residues[1].atoms + ts = MDAnalysis.transformations.center(ag,center='mass')(ts) + + Parameters + ---------- + ag: AtomGroup + atom group to be centered on the unit cell. + center: str, optional + used to choose the method of centering on the given atom group. Can be 'geometry' + or 'mass' + point: array-like, optional + overrides the unit cell center - the coordinates of the Timestep are translated so + that the center of mass/geometry of the given AtomGroup is aligned to this position + instead. Defined as an array of size 3. + wrap: bool, optional + If `True`, all the atoms from the given AtomGroup will be moved to the unit cell + before calculating the center of mass or geometry. Default is `False`, no changes + to the atom coordinates are done before calculating the center of the AtomGroup. + + Returns + ------- + :class:`~MDAnalysis.coordinates.base.Timestep` object + + """ + + pbc_arg = wrap + if point: + point = np.asarray(point, np.float32) + if point.shape != (3, ) and point.shape != (1, 3): + raise ValueError('{} is not a valid point'.format(point)) + try: + if center == 'geometry': + center_method = partial(ag.center_of_geometry, pbc=pbc_arg) + elif center == 'mass': + center_method = partial(ag.center_of_mass, pbc=pbc_arg) + else: + raise ValueError('{} is not a valid argument for center'.format(center)) + except AttributeError: + if center == 'mass': + raise AttributeError('{} is not an AtomGroup object with masses'.format(ag)) + else: + raise ValueError('{} is not an AtomGroup object'.format(ag)) + + def wrapped(ts): + if point is None: + boxcenter = np.sum(ts.triclinic_dimensions, axis=0) / 2 + else: + boxcenter = point + + ag_center = center_method() + + vector = boxcenter - ag_center + ts.positions += vector + + return ts + + return wrapped + \ No newline at end of file diff --git a/package/MDAnalysis/version.py b/package/MDAnalysis/version.py index 49b4bef5522..9efaa6bff50 100644 --- a/package/MDAnalysis/version.py +++ b/package/MDAnalysis/version.py @@ -66,5 +66,4 @@ # e.g. with lib.log #: Release of MDAnalysis as a string, using `semantic versioning`_. -__version__ = "0.18.0" # NOTE: keep in sync with RELEASE in setup.py - +__version__ = "0.19.0" # NOTE: keep in sync with RELEASE in setup.py diff --git a/package/MDAnalysis/visualization/streamlines.py b/package/MDAnalysis/visualization/streamlines.py index e63d9b18098..a2d9ea8812d 100644 --- a/package/MDAnalysis/visualization/streamlines.py +++ b/package/MDAnalysis/visualization/streamlines.py @@ -363,4 +363,3 @@ def log_result_to_parent(delta_array): standard_deviation_of_displacement = np.std(displacement_array) return (dx_array, dy_array, average_displacement, standard_deviation_of_displacement) - diff --git a/package/SUMMARY.txt b/package/SUMMARY.txt index 084f4a8c752..9e9a7c81b80 100644 --- a/package/SUMMARY.txt +++ b/package/SUMMARY.txt @@ -1,6 +1,9 @@ .. Summary for PyPI -.. http://pypi.python.org/pypi/MDAnalysis/ +.. https://pypi.python.org/project/MDAnalysis/ +|build| |cov| |docs| |usergroup| |developergroup| |anaconda| |mybinder| + + MDAnalysis_ is an object-oriented python toolkit to analyze molecular dynamics trajectories generated by CHARMM_, Gromacs_, Amber_, NAMD_, or LAMMPS_; it also reads other formats (e.g. PDB_ files and `XYZ @@ -22,13 +25,10 @@ out in a range of formats. Availability ============ -**Source code** is available from https://www.mdanalysis.org under the -`GNU Public Licence, version 2`_, together with the `online +**Source code** is available from https://www.mdanalysis.org under the `GNU +Public Licence, version 2`_, together with the `online documentation`_. **Packages** can be downloaded from - - http://pypi.python.org/pypi/MDAnalysis/ - -or installed/upgraded via PyPI using `pip`_:: +https://pypi.org/project/MDAnalysis/ or installed/upgraded via PyPI using `pip`_:: pip install --upgrade MDAnalysis @@ -36,7 +36,7 @@ By default MDAnalysis does not install every dependency needed to run every analysis available in the analysis module or read netcdf Amber_ trajectories. To install and update these dependencies as well run :: - pip install --upgrade 'MDAnalysis[analysis, AMBER] + pip install --upgrade 'MDAnalysis[analysis,AMBER] Please report **bugs** or **enhancement requests** through the `Issue Tracker`_. Questions can also be asked on the `mdnalysis-discussion mailing @@ -44,7 +44,7 @@ list`_. In order to run the `Unit Tests`_ it is also necessary to install a separate package MDAnalysisTests_ containing the test and test -data. As it contains about 20 MB of molecular dynamics trajectories +data. As it contains about 70 MB of molecular dynamics trajectories and simulation system structures it is not included with the library itself. @@ -74,12 +74,12 @@ For citations of included algorithms and sub-modules please see the references_. .. Links .. _MDAnalysis: https://www.mdanalysis.org -.. _`10.1002/jcc.21787`: http://dx.doi.org/10.1002/jcc.21787 +.. _`10.1002/jcc.21787`: https://dx.doi.org/10.1002/jcc.21787 .. _references: https://docs.mdanalysis.org/documentation_pages/references.html -.. _GNU Public Licence, version 2: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html -.. _Issue Tracker: http://issues.mdanalysis.org +.. _GNU Public Licence, version 2: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html +.. _Issue Tracker: https://github.com/mdanalysis/mdanalysis/issues .. _`mdnalysis-discussion mailing list`: - http://groups.google.com/group/mdnalysis-discussion + https://groups.google.com/group/mdnalysis-discussion .. _`online documentation`: https://docs.mdanalysis.org .. _`Table of Supported Coordinate Formats`: @@ -90,21 +90,49 @@ For citations of included algorithms and sub-modules please see the references_. https://docs.mdanalysis.org/documentation_pages/selections.html#selection-commands .. _`Selection exporters`: https://docs.mdanalysis.org/documentation_pages/selections_modules.html#selection-exporters -.. _NumPy: http://numpy.scipy.org -.. _CHARMM: http://www.charmm.org/ +.. _NumPy: https://numpy.scipy.org +.. _CHARMM: https://www.charmm.org/ .. _Amber: http://ambermd.org/ .. _LAMMPS: http://lammps.sandia.gov/ .. _NAMD: http://www.ks.uiuc.edu/Research/namd/ .. _Gromacs: http://www.gromacs.org/ .. _VMD: http://www.ks.uiuc.edu/Research/vmd/ -.. _PyMOL: http://www.pymol.org/ -.. _PDB: http://www.rcsb.org/pdb/static.do?p=file_formats/pdb/index.html -.. _XYZ format: http://openbabel.org/wiki/XYZ_%28format%29 +.. _PyMOL: https://www.pymol.org/ +.. _PDB: https://www.rcsb.org/pdb/static.do?p=file_formats/pdb/index.html +.. _XYZ format: https://openbabel.org/wiki/XYZ_%28format%29 + +.. _Unit Tests: https://github.com/MDAnalysis/mdanalysis/wiki/UnitTests +.. _MDAnalysisTests: https://github.com/MDAnalysis/mdanalysis/wiki/MDAnalysisTests + +.. _`pip`: https://www.pip-installer.org/en/latest/index.html + + +.. badges +.. |usergroup| image:: https://img.shields.io/badge/Google%20Group-Users-lightgrey.svg + :alt: User Google Group + :target: http://users.mdanalysis.org + +.. |developergroup| image:: https://img.shields.io/badge/Google%20Group-Developers-lightgrey.svg + :alt: Developer Google Group + :target: http://developers.mdanalysis.org + +.. |docs| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg + :alt: Documentation (latest release) + :target: https://docs.mdanalysis.org + +.. |build| image:: https://travis-ci.org/MDAnalysis/mdanalysis.svg?branch=develop + :alt: Build Status + :target: https://travis-ci.org/MDAnalysis/mdanalysis -.. _Unit Tests: http://wiki.mdanalysis.org/UnitTests -.. _MDAnalysisTests: http://wiki.mdanalysis.org/MDAnalysisTests +.. |cov| image:: https://codecov.io/gh/MDAnalysis/mdanalysis/branch/develop/graph/badge.svg + :alt: Coverage Status + :target: https://codecov.io/gh/MDAnalysis/mdanalysis -.. _`pip`: http://www.pip-installer.org/en/latest/index.html +.. |anaconda| image:: https://anaconda.org/conda-forge/mdanalysis/badges/version.svg + :alt: Anaconda + :target: https://anaconda.org/conda-forge/mdanalysis -PyPI Metadata -============= +.. |mybinder| image:: https://mybinder.org/badge.svg + :alt: My Binder + :target: https://mybinder.org/v2/gh/MDAnalysis/binder-notebook/master + diff --git a/package/doc/sphinx/source/conf.py b/package/doc/sphinx/source/conf.py index d1654716028..f1cfeceee83 100644 --- a/package/doc/sphinx/source/conf.py +++ b/package/doc/sphinx/source/conf.py @@ -36,10 +36,18 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx.ext.todo', + 'sphinx_sitemap', 'alabaster'] mathjax_path = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML' +# for sitemap with https://github.com/jdillard/sphinx-sitemap +# NOTE: This sitemap is only correct for the DEVELOPMENT doccs. The RELEASE docs +# are served from https://www.mdanalysis.org/docs/ and the sitemap.xml +# is manually fixed when deploying the release docs with the +# maintainer/deploy_master_docs.sh script +site_url = "https://www.mdanalysis.org/mdanalysis/" + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/package/doc/sphinx/source/documentation_pages/analysis/data.rst b/package/doc/sphinx/source/documentation_pages/analysis/data.rst new file mode 100644 index 00000000000..63008abaf34 --- /dev/null +++ b/package/doc/sphinx/source/documentation_pages/analysis/data.rst @@ -0,0 +1,2 @@ +.. automodule:: MDAnalysis.analysis.data.filenames + :members: diff --git a/package/doc/sphinx/source/documentation_pages/analysis/dihedrals.rst b/package/doc/sphinx/source/documentation_pages/analysis/dihedrals.rst new file mode 100644 index 00000000000..eeb1a2ec4b8 --- /dev/null +++ b/package/doc/sphinx/source/documentation_pages/analysis/dihedrals.rst @@ -0,0 +1 @@ +.. automodule:: MDAnalysis.analysis.dihedrals diff --git a/package/doc/sphinx/source/documentation_pages/analysis/rdf.rst b/package/doc/sphinx/source/documentation_pages/analysis/rdf.rst index da861b4e9da..e460824b2dc 100644 --- a/package/doc/sphinx/source/documentation_pages/analysis/rdf.rst +++ b/package/doc/sphinx/source/documentation_pages/analysis/rdf.rst @@ -1,3 +1,3 @@ .. automodule:: MDAnalysis.analysis.rdf - :members: + diff --git a/package/doc/sphinx/source/documentation_pages/analysis_modules.rst b/package/doc/sphinx/source/documentation_pages/analysis_modules.rst index ea9e78ef134..cd001450042 100644 --- a/package/doc/sphinx/source/documentation_pages/analysis_modules.rst +++ b/package/doc/sphinx/source/documentation_pages/analysis_modules.rst @@ -59,7 +59,7 @@ Distances and contacts analysis/rms analysis/psa analysis/encore - + Hydrogen bonding ================ @@ -67,7 +67,7 @@ Hydrogen bonding :maxdepth: 1 analysis/hbond_analysis - analysis/hbond_autocorrel + analysis/hbond_autocorrel analysis/wbridge_analysis Membranes and membrane proteins @@ -105,6 +105,7 @@ Structure analysis/gnm analysis/helanal analysis/rdf + analysis/dihedrals Volumetric analysis @@ -136,3 +137,11 @@ analysis modules. *Use with care.* :maxdepth: 1 analysis/legacy_modules + +Data +==== + +.. toctree:: + :maxdepth: 1 + + analysis/data diff --git a/package/doc/sphinx/source/documentation_pages/coordinates/dummy.rst b/package/doc/sphinx/source/documentation_pages/coordinates/dummy.rst deleted file mode 100644 index 7f0e874a9cf..00000000000 --- a/package/doc/sphinx/source/documentation_pages/coordinates/dummy.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. automodule:: MDAnalysis.coordinates.dummy - :members: diff --git a/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst b/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst index 359719e3330..e81313985e3 100644 --- a/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst +++ b/package/doc/sphinx/source/documentation_pages/coordinates_modules.rst @@ -41,7 +41,6 @@ provide the format in the keyword argument *format* to coordinates/TRZ coordinates/memory coordinates/null - coordinates/dummy .. rubric:: Coordinate core modules diff --git a/package/doc/sphinx/source/documentation_pages/lib/distances.rst b/package/doc/sphinx/source/documentation_pages/lib/distances.rst index 803d8c7fd0a..c50b85bd1c6 100644 --- a/package/doc/sphinx/source/documentation_pages/lib/distances.rst +++ b/package/doc/sphinx/source/documentation_pages/lib/distances.rst @@ -1,5 +1,5 @@ .. automodule:: MDAnalysis.lib.distances - :members: + Low-level modules for :mod:`MDAnalysis.lib.distances` diff --git a/package/doc/sphinx/source/documentation_pages/lib/nsgrid.rst b/package/doc/sphinx/source/documentation_pages/lib/nsgrid.rst new file mode 100644 index 00000000000..f36f2480b0b --- /dev/null +++ b/package/doc/sphinx/source/documentation_pages/lib/nsgrid.rst @@ -0,0 +1,2 @@ +.. automodule:: MDAnalysis.lib.nsgrid + :members: \ No newline at end of file diff --git a/package/doc/sphinx/source/documentation_pages/lib_modules.rst b/package/doc/sphinx/source/documentation_pages/lib_modules.rst index 5bbe3d041ed..f918f37137e 100644 --- a/package/doc/sphinx/source/documentation_pages/lib_modules.rst +++ b/package/doc/sphinx/source/documentation_pages/lib_modules.rst @@ -36,6 +36,7 @@ functions whereas mathematical functions are to be found in :mod:`MDAnalysis.lib.NeighborSearch` contains classes to do neighbor searches with MDAnalysis objects. +:mod:`MDAnalysis.lib.nsgrid` contains a fast implementation of grid neighbor search. List of modules --------------- @@ -50,6 +51,7 @@ List of modules ./lib/transformations ./lib/qcprot ./lib/util + ./lib/nsgrid Low level file formats ---------------------- diff --git a/package/doc/sphinx/source/documentation_pages/references.rst b/package/doc/sphinx/source/documentation_pages/references.rst index c80c8a794b3..aa6f0cc484c 100644 --- a/package/doc/sphinx/source/documentation_pages/references.rst +++ b/package/doc/sphinx/source/documentation_pages/references.rst @@ -12,6 +12,16 @@ References ************ +MDAnalysis and the included algorithms are scientific software that +are described in academic publications. **Please cite these papers when you use +MDAnalysis in published work.** + +It is possible to :ref:`automatically generate a list of references +` for any program that uses +MDAnalysis. This list (in common reference manager formats) contains +the citations associated with the specific algorithms and libraries +that were used in the program. + Citations for the whole MDAnalysis library ========================================== @@ -19,6 +29,14 @@ Citations for the whole MDAnalysis library When using MDAnalysis in published work, please cite [Michaud-Agrawal2011]_ and [Gowers2016]_. +(We are currently asking you to cite *both* papers if at all possible +because the 2016 paper describes many updates to the original 2011 +paper and neither paper on its own provides a comprehensive +description of the library. We will publish a complete self-contained +paper with the upcoming 1.0 release of MDAnalysis, which will then +supersede these two citations.) + + .. [Michaud-Agrawal2011] N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. *J. Comput. Chem.* **32** (2011), @@ -28,7 +46,7 @@ When using MDAnalysis in published work, please cite Melo, S. L. Seyler, D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. `MDAnalysis: A Python package for the rapid analysis of molecular dynamics simulations`_. In S. Benthall and S. Rostrup, editors, - *Proceedings of the 15th Python in Science Conference*, pages 102 – 109, + *Proceedings of the 15th Python in Science Conference*, pages 98-105, Austin, TX, 2016. SciPy. .. _`10.1002/jcc.21787`: http://dx.doi.org/10.1002/jcc.21787 @@ -36,7 +54,7 @@ When using MDAnalysis in published work, please cite .. _`MDAnalysis: A Python package for the rapid analysis of molecular dynamics simulations`: http://conference.scipy.org/proceedings/scipy2016/oliver_beckstein.html - + .. _references-components: @@ -112,6 +130,8 @@ If you use the streamline visualization in .. _`10.1039/c3fd00145h`: https://doi.org/10.1039/c3fd00145h +.. _citations-using-duecredit: + Citations using Duecredit ========================= diff --git a/package/doc/sphinx/source/documentation_pages/selections.rst b/package/doc/sphinx/source/documentation_pages/selections.rst index a3ed79c98d8..6868acee19c 100644 --- a/package/doc/sphinx/source/documentation_pages/selections.rst +++ b/package/doc/sphinx/source/documentation_pages/selections.rst @@ -92,6 +92,16 @@ atom *seg-name* *residue-number* *atom-name* e.g. ``DMPC 1 C2`` selects the C2 carbon of the first residue of the DMPC segment +altloc *alternative-location* + a selection for atoms where alternative locations are available, which is + often the case with high-resolution crystal structures + e.g. `resid 4 and resname ALA and altloc B` selects only the atoms of ALA-4 + that have an altloc B record. + +moltype *molecule-type* + select by molecule type, e.g. ``moltype Protein_A``. At the moment, only + the TPR format defines the molecule type. + Boolean ------- @@ -189,6 +199,11 @@ byres *selection* e.g. specify the subselection after the byres keyword. ``byres`` is a shortcut to ``same residue as`` +bonded *selection* + selects all atoms that are bonded to selection + eg: ``select name H and bonded name O`` selects only hydrogens bonded to + oxygens + Index ----- diff --git a/package/doc/sphinx/source/documentation_pages/trajectory_transformations.rst b/package/doc/sphinx/source/documentation_pages/trajectory_transformations.rst new file mode 100644 index 00000000000..6ed38cdcf62 --- /dev/null +++ b/package/doc/sphinx/source/documentation_pages/trajectory_transformations.rst @@ -0,0 +1,99 @@ +.. Contains the formatted docstrings for the transformations located in 'mdanalysis/MDAnalysis/transformations' +.. _transformations: + +************************** +Trajectory transformations +************************** + +.. module:: MDAnalysis.transformations + +The transformations submodule contains a collection of functions to modify the +trajectory. Coordinate transformations, such as PBC corrections and molecule fitting +are often required for some analyses and visualization, and the functions in this +module allow transformations to be applied on-the-fly. +These transformation functions can be called by the user for any given +timestep of the trajectory, added as a workflow using :meth:`add_transformations` +of the :mod:`~MDAnalysis.coordinates.base` module, or upon Universe creation using +the keyword argument `transformations`. Note that in the two latter cases, the +workflow cannot be changed after being defined. + +A simple transformation that takes no other arguments but the `Timestep` can be defined +as the following example: + +.. code-block:: python + + def up_by_2(ts): + """ + Translate all coordinates by 2 angstroms up along the Z dimension. + """ + ts.positions = ts.positions + np.array([0, 0, 2], dtype=np.float32) + return ts + + +If the transformation requires other arguments besides the `Timestep`, the transformation +takes these arguments, while a wrapped function takes the `Timestep` object as +argument. +So, a transformation can be roughly defined as follows: + +.. code-block:: python + + def up_by_x(distance): + """ + Creates a transformation that will translate all coordinates by a given amount along the Z dimension. + """ + def wrapped(ts): + ts.positions = ts.positions + np.array([0, 0, distance], dtype=np.float32) + return ts + return wrapped + + +An alternative to using a wrapped function is using partials from :mod:`functools`. The +above function can be written as: + +.. code-block:: python + + import functools + + def up_by_x(ts, distance): + ts.positions = ts.positions + np.array([0, 0, distance], dtype=np.float32) + return ts + + up_by_2 = functools.partial(up_by_x, distance=2) + + +See :func:`MDAnalysis.transformations.translate` for a simple example. + + +.. rubric:: Examples + +Translating the coordinates of a frame: + +.. code-block:: python + + u = MDAnalysis.Universe(topology, trajectory) + new_ts = MDAnalysis.transformations.translate([1,1,1])(u.trajectory.ts) + +e.g. create a workflow and adding it to the trajectory: + +.. code-block:: python + + u = MDAnalysis.Universe(topology, trajectory) + workflow = [MDAnalysis.transformations.translate([1,1,1]), + MDAnalysis.transformations.translate([1,2,3])] + u.trajcetory.add_transformations(*workflow) + +e.g. giving a workflow as a keyword argument when defining the universe: + +.. code-block:: python + + workflow = [MDAnalysis.transformations.translate([1,1,1]), + MDAnalysis.transformations.translate([1,2,3])] + u = MDAnalysis.Universe(topology, trajectory, transformations = *workflow) + + +.. rubric:: Currently implemented transformations + +.. toctree:: + + ./transformations/translate + ./transformations/rotate \ No newline at end of file diff --git a/package/doc/sphinx/source/documentation_pages/transformations/rotate.rst b/package/doc/sphinx/source/documentation_pages/transformations/rotate.rst new file mode 100644 index 00000000000..38bae418c86 --- /dev/null +++ b/package/doc/sphinx/source/documentation_pages/transformations/rotate.rst @@ -0,0 +1 @@ +.. automodule:: MDAnalysis.transformations.rotate \ No newline at end of file diff --git a/package/doc/sphinx/source/documentation_pages/transformations/translate.rst b/package/doc/sphinx/source/documentation_pages/transformations/translate.rst new file mode 100644 index 00000000000..78eb247cee9 --- /dev/null +++ b/package/doc/sphinx/source/documentation_pages/transformations/translate.rst @@ -0,0 +1 @@ +.. automodule:: MDAnalysis.transformations.translate \ No newline at end of file diff --git a/package/doc/sphinx/source/images/janin_demo_plot.png b/package/doc/sphinx/source/images/janin_demo_plot.png new file mode 100644 index 00000000000..f64cf64265d Binary files /dev/null and b/package/doc/sphinx/source/images/janin_demo_plot.png differ diff --git a/package/doc/sphinx/source/images/rama_demo_plot.png b/package/doc/sphinx/source/images/rama_demo_plot.png new file mode 100644 index 00000000000..c81ef10e328 Binary files /dev/null and b/package/doc/sphinx/source/images/rama_demo_plot.png differ diff --git a/package/doc/sphinx/source/index.rst b/package/doc/sphinx/source/index.rst index bb3441bb698..df6cfe74f45 100644 --- a/package/doc/sphinx/source/index.rst +++ b/package/doc/sphinx/source/index.rst @@ -170,6 +170,7 @@ Thank you! ./documentation_pages/analysis_modules ./documentation_pages/topology_modules ./documentation_pages/coordinates_modules + ./documentation_pages/trajectory_transformations ./documentation_pages/selections_modules ./documentation_pages/auxiliary_modules ./documentation_pages/core_modules diff --git a/package/setup.py b/package/setup.py index 982d87c7185..108445f9d0e 100755 --- a/package/setup.py +++ b/package/setup.py @@ -51,6 +51,7 @@ import shutil import tempfile import warnings +import platform # Make sure I have the right Python version. if sys.version_info[:2] < (2, 7): @@ -66,7 +67,7 @@ # NOTE: keep in sync with MDAnalysis.__version__ in version.py -RELEASE = "0.18.0" +RELEASE = "0.19.0" is_release = 'dev' not in RELEASE @@ -255,6 +256,12 @@ def extensions(config): if arch: extra_compile_args.append('-march={}'.format(arch)) + cpp_extra_compile_args = [a for a in extra_compile_args if 'std' not in a] + cpp_extra_compile_args.append('-std=c++11') + # needed to specify c++ runtime library on OSX + if platform.system() == 'Darwin': + cpp_extra_compile_args.append('-stdlib=libc++') + # Needed for large-file seeking under 32bit systems (for xtc/trr indexing # and access). largefile_macros = [ @@ -282,10 +289,17 @@ def extensions(config): print('Will not attempt to use Cython.') source_suffix = '.pyx' if use_cython else '.c' + cpp_source_suffix = '.pyx' if use_cython else '.cpp' # The callable is passed so that it is only evaluated at install time. include_dirs = [get_numpy_include] + # Windows automatically handles math library linking + # and will not build MDAnalysis if we try to specify one + if os.name == 'nt': + mathlib = [] + else: + mathlib = ['m'] libdcd = MDAExtension('MDAnalysis.lib.formats.libdcd', ['MDAnalysis/lib/formats/libdcd' + source_suffix], @@ -295,13 +309,13 @@ def extensions(config): distances = MDAExtension('MDAnalysis.lib.c_distances', ['MDAnalysis/lib/c_distances' + source_suffix], include_dirs=include_dirs + ['MDAnalysis/lib/include'], - libraries=['m'], + libraries=mathlib, define_macros=define_macros, extra_compile_args=extra_compile_args) distances_omp = MDAExtension('MDAnalysis.lib.c_distances_openmp', ['MDAnalysis/lib/c_distances_openmp' + source_suffix], include_dirs=include_dirs + ['MDAnalysis/lib/include'], - libraries=['m'] + parallel_libraries, + libraries=mathlib + parallel_libraries, define_macros=define_macros + parallel_macros, extra_compile_args=parallel_args + extra_compile_args, extra_link_args=parallel_args) @@ -312,7 +326,7 @@ def extensions(config): extra_compile_args=extra_compile_args) transformation = MDAExtension('MDAnalysis.lib._transformations', ['MDAnalysis/lib/src/transformations/transformations.c'], - libraries=['m'], + libraries=mathlib, define_macros=define_macros, include_dirs=include_dirs, extra_compile_args=extra_compile_args) @@ -333,6 +347,20 @@ def extensions(config): include_dirs=include_dirs, define_macros=define_macros, extra_compile_args=extra_compile_args) + cutil = MDAExtension('MDAnalysis.lib._cutil', + sources=['MDAnalysis/lib/_cutil' + cpp_source_suffix], + language='c++', + libraries=mathlib, + include_dirs=include_dirs + ['MDAnalysis/lib/include'], + define_macros=define_macros, + extra_compile_args=cpp_extra_compile_args) + augment = MDAExtension('MDAnalysis.lib._augment', + sources=['MDAnalysis/lib/_augment' + cpp_source_suffix], + language='c++', + include_dirs=include_dirs, + define_macros=define_macros, + extra_compile_args=cpp_extra_compile_args) + encore_utils = MDAExtension('MDAnalysis.analysis.encore.cutils', sources=['MDAnalysis/analysis/encore/cutils' + source_suffix], @@ -343,19 +371,26 @@ def extensions(config): sources=['MDAnalysis/analysis/encore/clustering/affinityprop' + source_suffix, 'MDAnalysis/analysis/encore/clustering/src/ap.c'], include_dirs=include_dirs+['MDAnalysis/analysis/encore/clustering/include'], - libraries=["m"], + libraries=mathlib, define_macros=define_macros, extra_compile_args=extra_compile_args) spe_dimred = MDAExtension('MDAnalysis.analysis.encore.dimensionality_reduction.stochasticproxembed', sources=['MDAnalysis/analysis/encore/dimensionality_reduction/stochasticproxembed' + source_suffix, 'MDAnalysis/analysis/encore/dimensionality_reduction/src/spe.c'], include_dirs=include_dirs+['MDAnalysis/analysis/encore/dimensionality_reduction/include'], - libraries=["m"], + libraries=mathlib, define_macros=define_macros, extra_compile_args=extra_compile_args) + nsgrid = MDAExtension('MDAnalysis.lib.nsgrid', + ['MDAnalysis/lib/nsgrid' + cpp_source_suffix], + include_dirs=include_dirs, + language='c++', + define_macros=define_macros, + extra_compile_args=cpp_extra_compile_args) pre_exts = [libdcd, distances, distances_omp, qcprot, transformation, libmdaxdr, util, encore_utils, - ap_clustering, spe_dimred] + ap_clustering, spe_dimred, cutil, augment, nsgrid] + cython_generated = [] if use_cython: @@ -394,7 +429,7 @@ def dynamic_author_list(): # authors". We first want move the cursor down to the title of # interest. for line_no, line in enumerate(infile, start=1): - if line[:-1] == "Chronological list of authors": + if line.rstrip() == "Chronological list of authors": break else: # If we did not break, it means we did not find the authors. @@ -458,35 +493,66 @@ def dynamic_author_list(): 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: GNU General Public License (GPL)', + 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', 'Operating System :: POSIX', 'Operating System :: MacOS :: MacOS X', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: C', + 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Bio-Informatics', 'Topic :: Scientific/Engineering :: Chemistry', 'Topic :: Software Development :: Libraries :: Python Modules', ] - config = Config() exts, cythonfiles = extensions(config) + install_requires = [ + 'numpy>=1.10.4', + 'biopython>=1.71', + 'networkx>=1.0', + 'GridDataFormats>=0.4.0', + 'six>=1.4.0', + 'mmtf-python>=1.0.0', + 'joblib', + 'scipy>=1.0.0', + 'matplotlib>=1.5.1', + 'mock', + ] + if not os.name == 'nt': + install_requires.append('gsd>=1.4.0') + setup(name='MDAnalysis', version=RELEASE, - description='An object-oriented toolkit to analyze molecular dynamics ' - 'trajectories generated by CHARMM, Gromacs, NAMD, LAMMPS, or Amber.', + description=('An object-oriented toolkit to analyze molecular dynamics ' + 'trajectories generated by CHARMM, Gromacs, NAMD, LAMMPS, or Amber.'), long_description=LONG_DESCRIPTION, + long_description_content_type='text/x-rst', author='Naveen Michaud-Agrawal', author_email='naveen.michaudagrawal@gmail.com', maintainer='Richard Gowers', maintainer_email='mdnalysis-discussion@googlegroups.com', url='https://www.mdanalysis.org', download_url='https://github.com/MDAnalysis/mdanalysis/releases', - provides=['MDAnalysis'], + project_urls={'Documentation': 'https://www.mdanalysis.org/docs/', + 'Issue Tracker': 'https://github.com/mdanalysis/mdanalysis/issues', + 'User Group': 'https://groups.google.com/forum/#!forum/mdnalysis-discussion', + 'Source': 'https://github.com/mdanalysis/mdanalysis', + }, license='GPL 2', + classifiers=CLASSIFIERS, + provides=['MDAnalysis'], packages=find_packages(), + package_data={'MDAnalysis': + ['analysis/data/*.npy', + ], + }, ext_modules=exts, - classifiers=CLASSIFIERS, requires=['numpy (>=1.10.4)', 'biopython (>= 1.71)', 'mmtf (>=1.0.0)', 'networkx (>=1.0)', 'GridDataFormats (>=0.3.2)', 'joblib', 'scipy (>=1.0.0)', 'matplotlib (>=1.5.1)'], @@ -495,19 +561,7 @@ def dynamic_author_list(): setup_requires=[ 'numpy>=1.10.4', ], - install_requires=[ - 'gsd>=1.4.0', - 'numpy>=1.10.4', - 'biopython>=1.71', - 'networkx>=1.0', - 'GridDataFormats>=0.4.0', - 'six>=1.4.0', - 'mmtf-python>=1.0.0', - 'joblib', - 'scipy>=1.0.0', - 'matplotlib>=1.5.1', - 'mock', - ], + install_requires=install_requires, # extras can be difficult to install through setuptools and/or # you might prefer to use the version available through your # packaging system diff --git a/testsuite/AUTHORS b/testsuite/AUTHORS index 32fb9b8fbed..2ce97744f5b 100644 --- a/testsuite/AUTHORS +++ b/testsuite/AUTHORS @@ -6,12 +6,12 @@ MDAnalysis was originally written by Naveen Michaud-Agrawal. -Oliver Beckstein and Elizabeth J. Denning are maintaining the project -and contributing to the development. +The project is maintained by the MDAnalysis Core Developer Team +(@MDAnalysis/coredevs on https://github.com/MDAnalysis). -All contributing authors are listed in this file below. The repository -history at https://github.com/MDAnalysis/mdanalysis and the CHANGELOG -show individual code contributions. +All contributing authors for the testsuite are listed in this file below. The +repository history at https://github.com/MDAnalysis/mdanalysis and the +CHANGELOG show individual code contributions. Chronological list of authors @@ -84,6 +84,8 @@ Chronological list of authors 2018 - Johannes Zeman - Ayush Suhane + - Paul Smith + - Mateusz Bieniek External code diff --git a/testsuite/CHANGELOG b/testsuite/CHANGELOG index bf75e5024f0..fdcd9ef8980 100644 --- a/testsuite/CHANGELOG +++ b/testsuite/CHANGELOG @@ -13,6 +13,12 @@ Also see https://github.com/MDAnalysis/mdanalysis/wiki/MDAnalysisTests and https://github.com/MDAnalysis/mdanalysis/wiki/UnitTests ------------------------------------------------------------------------------ +10/09/18 orbeckst, arm61 + * 0.19.0 + - skip tests for duecredit when duecredit is not installed (#1906) + - updated meta data for PyPi and updated README and INSTALL + - added test for fix to issue #1897 + 04/15/18 tylerjereddy, zemanj * 0.18.0 - Unit tests for unwanted side effects when importing MDAnalysis diff --git a/testsuite/INSTALL b/testsuite/INSTALL index f845e1cfa2f..b0db41ed077 100644 --- a/testsuite/INSTALL +++ b/testsuite/INSTALL @@ -25,22 +25,21 @@ related pages. You can always ask questions on the MDAnalysis mailing list: - http://groups.google.com/group/mdnalysis-discussion + https://groups.google.com/group/mdnalysis-discussion -People there are very happy to help. When posting please remember to -mention the release of MDAnalysis you are trying to install (e.g. "tar -file MDAnalysis-0.7.3 from website" or "subversion r818"), all the -commands that you typed to install the package, and the full output -(typically right from 'python setup.py build'). You should also -mention your operating system (e.g. Ubuntu 10.04) and Python version -(output from 'python --version') so that we can better diagnose the -problem. +People there are very happy to help. When posting please remember to mention +the release of MDAnalysis you are trying to install (e.g. "tar file +MDAnalysis-0.7.3 from website" or "git commit deadbee3"), all the commands that +you typed to install the package, and the full output (typically right from +``python setup.py build``). You should also mention your operating system +(e.g. Ubuntu 16.04) and Python version (output from ``python --version``) so +that we can better diagnose the problem. Getting the source ================== -Download a tar ball from https://pypi.python.org/pypi/MDAnalysisTests; these +Download a tar ball from https://pypi.org/project/MDAnalysisTests; these instructions apply to versions 0.7.4 or higher. Alternatively, check out the MDAnalysis directory from the git @@ -62,10 +61,9 @@ and executing from the top directory :: This installs MDAnalysisTests in the system wide python directory; this may require administrative privileges. -It is also possible to use --prefix, --home, or --user options for -setup.py to install in a different (probably your private) python -directory hierarchy. ``python setup.py install --help`` should show -you your options. +It is also possible to use ``--prefix``, ``--home``, or ``--user`` options for +``setup.py`` to install in a different (probably your private) python directory +hierarchy. ``python setup.py install --help`` should show you your options. If you have problem at this stage then have a look at the operating system specific notes at the end of this file or look in the issue @@ -76,7 +74,7 @@ found in the comments Running tests ============= -See http://wiki.mdanalysis.org/UnitTests for details. +See https://github.com/MDAnalysis/mdanalysis/wiki/UnitTests for details. From sources @@ -84,17 +82,11 @@ From sources From the top directory of the checked out sources: - pytest /testsuite/MDAnalysisTests/ --numprocesses 4 + pytest --numprocesses 4 --disable-pytest-warnings testsuite/MDAnalysisTests/ -(use --numprocesses 4 if you have 4 cores available to run in parallel or -adapt to available cores.) +Use ``--numprocesses 4`` if you have 4 cores available to run in +parallel or adapt to available cores. To run tests in parallel you +will need to have *pytest-xdist>=1.18.1* installed (``pip install +pytest-xdist``). -To run tests in parallel you will need pytest-xdist>=1.18.1 installed. - -From installed package ----------------------- - -The test runner can be launched as - - python -c 'from MDAnalysis.tests import test; test()' diff --git a/testsuite/MDAnalysisTests/__init__.py b/testsuite/MDAnalysisTests/__init__.py index f6901a51912..7972153acdb 100644 --- a/testsuite/MDAnalysisTests/__init__.py +++ b/testsuite/MDAnalysisTests/__init__.py @@ -20,8 +20,7 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -========================= +"""========================= Test cases for MDAnalysis ========================= @@ -35,10 +34,20 @@ We are using the NumPy_ testing frame work; thus, :mod:`numpy` *must* be installed for the tests to run at all. -Run all the tests with +Run all the tests with :: + + pytest --pyargs MDAnalysisTests + +If you have the `pytest-xdist`_ plugin installed then you can run the +tests in parallel + +.. code-block:: bash + + pytest -n 4 --pyargs MDAnalysisTests + - >>> from MDAnalysisTests import run - >>> run() +.. _`pytest-xdist`: + https://github.com/pytest-dev/pytest-xdist Data @@ -88,7 +97,7 @@ logger = logging.getLogger("MDAnalysisTests.__init__") # keep in sync with RELEASE in setup.py -__version__ = "0.18.0" +__version__ = "0.19.0" try: from MDAnalysisTests.authors import __authors__ @@ -112,11 +121,13 @@ # issue #412 https://github.com/MDAnalysis/mdanalysis/issues/412 and PR #1822. os.environ['DUECREDIT_ENABLE'] = 'yes' -# Any tests that plot with matplotlib need to run with the simple agg backend because -# on Travis there is no DISPLAY set +# Any tests that plot with matplotlib need to run with the simple agg backend +# because on Travis there is no DISPLAY set. This doesn't warn if we import +# files from the tests after loading matplotlib. This will remove unnecessary +# user warnings. try: import matplotlib - matplotlib.use('agg') + matplotlib.use('agg', warn=False) except ImportError: pass diff --git a/testsuite/MDAnalysisTests/analysis/test_align.py b/testsuite/MDAnalysisTests/analysis/test_align.py index 8ef3eba270c..16390d7f039 100644 --- a/testsuite/MDAnalysisTests/analysis/test_align.py +++ b/testsuite/MDAnalysisTests/analysis/test_align.py @@ -209,7 +209,7 @@ def test_AlignTraj_step_works(self, universe, reference, tmpdir): reference.trajectory[-1] outfile = str(tmpdir.join('align_test.dcd')) # this shouldn't throw an exception - align.AlignTraj(universe, reference, filename=outfile, step=10).run() + align.AlignTraj(universe, reference, filename=outfile).run(step=10) def test_AlignTraj(self, universe, reference, tmpdir): reference.trajectory[-1] diff --git a/testsuite/MDAnalysisTests/analysis/test_base.py b/testsuite/MDAnalysisTests/analysis/test_base.py index 81c4089d291..fc4e522bf95 100644 --- a/testsuite/MDAnalysisTests/analysis/test_base.py +++ b/testsuite/MDAnalysisTests/analysis/test_base.py @@ -72,19 +72,19 @@ def test_default(u): def test_start(u): - an = FrameAnalysis(u.trajectory, start=20).run() + an = FrameAnalysis(u.trajectory).run(start=20) assert an.n_frames == len(u.trajectory) - 20 assert_equal(an.frames, list(range(20, len(u.trajectory)))) def test_stop(u): - an = FrameAnalysis(u.trajectory, stop=20).run() + an = FrameAnalysis(u.trajectory).run(stop=20) assert an.n_frames == 20 assert_equal(an.frames, list(range(20))) def test_step(u): - an = FrameAnalysis(u.trajectory, step=20).run() + an = FrameAnalysis(u.trajectory).run(step=20) assert an.n_frames == 5 assert_equal(an.frames, list(range(98))[::20]) @@ -92,7 +92,6 @@ def test_step(u): def test_verbose(u): a = FrameAnalysis(u.trajectory, verbose=True) assert a._verbose - assert not a._quiet def test_incomplete_defined_analysis(u): @@ -104,36 +103,29 @@ def test_old_api(u): OldAPIAnalysis(u.trajectory).run() -def test_start_stop_step_conversion(u): - an = FrameAnalysis(u.trajectory) - assert an.start == 0 - assert an.stop == u.trajectory.n_frames - assert an.step == 1 +def test_filter_baseanalysis_kwargs_VE(): + def bad_f(mobile, verbose=2): + pass + kwargs = {'step': 3, 'foo': None} -def test_filter_baseanalysis_kwargs(): - def bad_f(mobile, step=2): - pass + with pytest.raises(ValueError): + base._filter_baseanalysis_kwargs(bad_f, kwargs) + +def test_filter_baseanalysis_kwargs(): def good_f(mobile, ref): pass kwargs = {'step': 3, 'foo': None} - with pytest.raises(ValueError): - base._filter_baseanalysis_kwargs(bad_f, kwargs) - base_kwargs, kwargs = base._filter_baseanalysis_kwargs(good_f, kwargs) - assert 1 == len(kwargs) + assert 2 == len(kwargs) assert kwargs['foo'] == None - assert 5 == len(base_kwargs) - assert base_kwargs['start'] is None - assert base_kwargs['step'] == 3 - assert base_kwargs['stop'] is None - assert base_kwargs['quiet'] is None - assert base_kwargs['verbose'] is None + assert len(base_kwargs) == 1 + assert base_kwargs['verbose'] is False def simple_function(mobile): @@ -144,10 +136,10 @@ def test_AnalysisFromFunction(): u = mda.Universe(PSF, DCD) step = 2 ana1 = base.AnalysisFromFunction( - simple_function, mobile=u.atoms, step=step).run() - ana2 = base.AnalysisFromFunction(simple_function, u.atoms, step=step).run() + simple_function, mobile=u.atoms).run(step=step) + ana2 = base.AnalysisFromFunction(simple_function, u.atoms).run(step=step) ana3 = base.AnalysisFromFunction( - simple_function, u.trajectory, u.atoms, step=step).run() + simple_function, u.trajectory, u.atoms).run(step=step) results = [] for ts in u.trajectory[::step]: @@ -165,7 +157,7 @@ def test_analysis_class(): u = mda.Universe(PSF, DCD) step = 2 - ana = ana_class(u.atoms, step=step).run() + ana = ana_class(u.atoms).run(step=step) results = [] for ts in u.trajectory[::step]: @@ -190,3 +182,16 @@ def distance(a, b): with no_deprecated_call(): d = Distances(u.atoms[:10], u.atoms[10:20]).run() + +@pytest.mark.parametrize('param', ['start', 'stop', 'step']) +def test_runargs_deprecation(param): + u = mda.Universe(PSF, DCD) + + class NothingAnalysis(base.AnalysisBase): + def _single_frame(self): + self.results = [] + + with pytest.warns(DeprecationWarning): + ana = NothingAnalysis(u.trajectory, **{param: 10}) + + ana.run() diff --git a/testsuite/MDAnalysisTests/analysis/test_contacts.py b/testsuite/MDAnalysisTests/analysis/test_contacts.py index ee0b96ea819..ff21825385b 100644 --- a/testsuite/MDAnalysisTests/analysis/test_contacts.py +++ b/testsuite/MDAnalysisTests/analysis/test_contacts.py @@ -170,7 +170,7 @@ class TestContacts(object): def universe(): return mda.Universe(PSF, DCD) - def _run_Contacts(self, universe, **kwargs): + def _run_Contacts(self, universe, start=None, stop=None, step=None, **kwargs): acidic = universe.select_atoms(self.sel_acidic) basic = universe.select_atoms(self.sel_basic) return contacts.Contacts( @@ -178,7 +178,7 @@ def _run_Contacts(self, universe, **kwargs): selection=(self.sel_acidic, self.sel_basic), refgroup=(acidic, basic), radius=6.0, - **kwargs).run() + **kwargs).run(start=start, stop=stop, step=step) def test_startframe(self, universe): """test_startframe: TestContactAnalysis1: start frame set to 0 (resolution of diff --git a/testsuite/MDAnalysisTests/utils/test_duecredits.py b/testsuite/MDAnalysisTests/analysis/test_data.py similarity index 55% rename from testsuite/MDAnalysisTests/utils/test_duecredits.py rename to testsuite/MDAnalysisTests/analysis/test_data.py index 9014c9b0633..14034cd3de1 100644 --- a/testsuite/MDAnalysisTests/utils/test_duecredits.py +++ b/testsuite/MDAnalysisTests/analysis/test_data.py @@ -20,28 +20,13 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # from __future__ import absolute_import -import os -import pytest - -# environment variable DUECREDIT_ENABLE is set to yes in MDAnalysisTests/__init__.py -# (if set to 'no', the tests will be SKIPPED; has to be yes, true, or 1 for duecredit -# to work; duecredit must also be installed) -import MDAnalysis as mda - - -@pytest.mark.skipif((os.environ.get('DUECREDIT_ENABLE', 'yes').lower() - in ('no', '0', 'false')), - reason= - "duecredit is explicitly disabled with DUECREDIT_ENABLE=no") -class TestDuecredits(object): - def test_duecredit_active(self): - assert mda.due.active == True - - - def test_duecredit_collector_citations(self): +from numpy.testing import assert_equal +import pytest - assert mda.due.citations[('MDAnalysis/', - 'gowers2016')].cites_module == True - assert mda.due.citations[('MDAnalysis/', - '10.1002/jcc.21787')].cites_module == True +def test_all_exports(): + from MDAnalysis.analysis.data import filenames + missing = [name for name in dir(filenames) + if + not name.startswith('_') and name not in filenames.__all__ and name != 'absolute_import'] + assert_equal(missing, [], err_msg="Variables need to be added to __all__.") diff --git a/testsuite/MDAnalysisTests/analysis/test_density.py b/testsuite/MDAnalysisTests/analysis/test_density.py index c94e86e3c3d..e80fd45db4a 100644 --- a/testsuite/MDAnalysisTests/analysis/test_density.py +++ b/testsuite/MDAnalysisTests/analysis/test_density.py @@ -26,6 +26,7 @@ import numpy as np import pytest import sys +import warnings from numpy.testing import assert_equal, assert_almost_equal @@ -128,12 +129,20 @@ class Test_density_from_Universe(object): {'meandensity': 0.016764271713091212, }, 'static_sliced': {'meandensity': 0.016764270747693617, }, + 'static_defined': + {'meandensity': 0.0025000000000000005, }, + 'static_defined_unequal': + {'meandensity': 0.006125, }, 'dynamic': {'meandensity': 0.0012063418843728784, }, 'notwithin': {'meandensity': 0.015535385132107926, }, } cutoffs = {'notwithin': 4.0, } + gridcenters = {'static_defined': np.array([56.0, 45.0, 35.0]), + 'error1': np.array([56.0, 45.0]), + 'error2': [56.0, 45.0, "MDAnalysis"], + } precision = 5 outfile = 'density.dx' @@ -158,7 +167,6 @@ def check_density_from_Universe(self, atomselection, ref_meandensity, assert_almost_equal(D.grid, D2.grid, decimal=self.precision, err_msg="DX export failed: different grid sizes") - def test_density_from_Universe(self, universe, tmpdir): self.check_density_from_Universe( self.selections['static'], @@ -195,6 +203,72 @@ def test_density_from_Universe_notwithin(self, universe, tmpdir): tmpdir=tmpdir ) + def test_density_from_Universe_userdefn_eqbox(self, universe, tmpdir): + self.check_density_from_Universe( + self.selections['static'], + self.references['static_defined']['meandensity'], + gridcenter=self.gridcenters['static_defined'], + xdim=10.0, + ydim=10.0, + zdim=10.0, + universe=universe, + tmpdir=tmpdir + ) + + def test_density_from_Universe_userdefn_neqbox(self, universe, tmpdir): + self.check_density_from_Universe( + self.selections['static'], + self.references['static_defined_unequal']['meandensity'], + gridcenter=self.gridcenters['static_defined'], + xdim=10.0, + ydim=15.0, + zdim=20.0, + universe=universe, + tmpdir=tmpdir + ) + + def test_density_from_Universe_userdefn_boxshape(self, universe): + import MDAnalysis.analysis.density + D = MDAnalysis.analysis.density.density_from_Universe( + universe, atomselection=self.selections['static'], + delta=1.0, xdim=8.0, ydim=12.0, zdim=17.0, + gridcenter=self.gridcenters['static_defined']) + assert D.grid.shape == (8, 12, 17) + + def test_density_from_Universe_userdefn_selwarning(self, universe): + import MDAnalysis.analysis.density + wmsg = ("Atom selection does not fit grid --- " + "you may want to define a larger box") + with pytest.warns(UserWarning) as record: + D = MDAnalysis.analysis.density.density_from_Universe( + universe, atomselection=self.selections['static'], + delta=1.0, xdim=1.0, ydim=2.0, zdim=2.0, + gridcenter=self.gridcenters['static_defined']) + + assert len(record) == 2 + assert str(record[1].message.args[0]) == wmsg + + def test_density_from_Universe_userdefn_ValueErrors(self, universe): + import MDAnalysis.analysis.density + # Test len(gridcenter) != 3 + with pytest.raises(ValueError): + D = MDAnalysis.analysis.density.density_from_Universe( + universe, atomselection=self.selections['static'], + delta=self.delta, xdim=10.0, ydim=10.0, zdim=10.0, + gridcenter=self.gridcenters['error1']) + # Test gridcenter includes non-numeric strings + with pytest.raises(ValueError): + D = MDAnalysis.analysis.density.density_from_Universe( + universe, atomselection=self.selections['static'], + delta=self.delta, xdim=10.0, ydim=10.0, zdim=10.0, + gridcenter=self.gridcenters['error2']) + # Test xdim != int or float + with pytest.raises(ValueError): + D = MDAnalysis.analysis.density.density_from_Universe( + universe, atomselection=self.selections['static'], + delta=self.delta, xdim="MDAnalysis", ydim=10.0, zdim=10.0, + gridcenter=self.gridcenters['static_defined']) + class TestGridImport(object): diff --git a/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py b/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py index 842d3a4d778..accf1a3d3ba 100644 --- a/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py +++ b/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py @@ -56,8 +56,8 @@ def test_eg(dist, dmap): def test_dist_weights(u): backbone = u.select_atoms('backbone') weights_atoms = np.ones(len(backbone.atoms)) - dist = diffusionmap.DistanceMatrix(u, select='backbone', weights=weights_atoms, step=3) - dist.run() + dist = diffusionmap.DistanceMatrix(u, select='backbone', weights=weights_atoms) + dist.run(step=3) dmap = diffusionmap.DiffusionMap(dist) dmap.run() assert_array_almost_equal(dmap.eigenvalues, [1, 1, 1, 1], 4) @@ -69,8 +69,8 @@ def test_dist_weights(u): def test_different_steps(u): - dmap = diffusionmap.DiffusionMap(u, select='backbone', step=3) - dmap.run() + dmap = diffusionmap.DiffusionMap(u, select='backbone') + dmap.run(step=3) assert dmap._eigenvectors.shape == (4, 4) diff --git a/testsuite/MDAnalysisTests/analysis/test_dihedrals.py b/testsuite/MDAnalysisTests/analysis/test_dihedrals.py new file mode 100644 index 00000000000..c6e4eba69f1 --- /dev/null +++ b/testsuite/MDAnalysisTests/analysis/test_dihedrals.py @@ -0,0 +1,174 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +from __future__ import absolute_import + +import numpy as np +from numpy.testing import assert_almost_equal +import matplotlib +import pytest + +import MDAnalysis as mda +from MDAnalysisTests.datafiles import (GRO, XTC, DihedralArray, DihedralsArray, + RamaArray, GLYRamaArray, JaninArray, + LYSJaninArray, PDB_rama, PDB_janin) +from MDAnalysis.analysis.dihedrals import Dihedral, Ramachandran, Janin + + +class TestDihedral(object): + + @pytest.fixture() + def atomgroup(self): + u = mda.Universe(GRO, XTC) + ag = u.select_atoms("(resid 4 and name N CA C) or (resid 5 and name N)") + return ag + + + def test_dihedral(self, atomgroup): + dihedral = Dihedral([atomgroup]).run() + test_dihedral = np.load(DihedralArray) + + assert_almost_equal(dihedral.angles, test_dihedral, 5, + err_msg="error: dihedral angles should " + "match test values") + + def test_dihedral_single_frame(self, atomgroup): + dihedral = Dihedral([atomgroup]).run(start=5, stop=6) + test_dihedral = [np.load(DihedralArray)[5]] + + assert_almost_equal(dihedral.angles, test_dihedral, 5, + err_msg="error: dihedral angles should " + "match test vales") + + def test_atomgroup_list(self, atomgroup): + dihedral = Dihedral([atomgroup, atomgroup]).run() + test_dihedral = np.load(DihedralsArray) + + assert_almost_equal(dihedral.angles, test_dihedral, 5, + err_msg="error: dihedral angles should " + "match test values") + + def test_enough_atoms(self, atomgroup): + with pytest.raises(ValueError): + dihedral = Dihedral([atomgroup[:2]]).run() + +class TestRamachandran(object): + + @pytest.fixture() + def universe(self): + return mda.Universe(GRO, XTC) + + @pytest.fixture() + def rama_ref_array(self): + return np.load(RamaArray) + + def test_ramachandran(self, universe, rama_ref_array): + rama = Ramachandran(universe.select_atoms("protein")).run() + + assert_almost_equal(rama.angles, rama_ref_array, 5, + err_msg="error: dihedral angles should " + "match test values") + + def test_ramachandran_single_frame(self, universe, rama_ref_array): + rama = Ramachandran(universe.select_atoms("protein")).run( + start=5, stop=6) + + assert_almost_equal(rama.angles[0], rama_ref_array[5], 5, + err_msg="error: dihedral angles should " + "match test values") + + def test_ramachandran_residue_selections(self, universe): + rama = Ramachandran(universe.select_atoms("resname GLY")).run() + test_rama = np.load(GLYRamaArray) + + assert_almost_equal(rama.angles, test_rama, 5, + err_msg="error: dihedral angles should " + "match test values") + + def test_outside_protein_length(self, universe): + with pytest.raises(ValueError): + rama = Ramachandran(universe.select_atoms("resid 220")).run() + + def test_protein_ends(self, universe): + with pytest.warns(UserWarning): + rama = Ramachandran(universe.select_atoms("protein")).run() + + def test_None_removal(self): + with pytest.warns(UserWarning): + u = mda.Universe(PDB_rama) + rama = Ramachandran(u.select_atoms("protein").residues[1:-1]) + + def test_plot(self, universe): + ax = Ramachandran(universe.select_atoms("resid 5-10")).run().plot(ref=True) + assert isinstance(ax, matplotlib.axes.Axes), \ + "Ramachandran.plot() did not return and Axes instance" + +class TestJanin(object): + + @pytest.fixture() + def universe(self): + return mda.Universe(GRO, XTC) + + @pytest.fixture() + def janin_ref_array(self): + return np.load(JaninArray) + + def test_janin(self, universe, janin_ref_array): + janin = Janin(universe.select_atoms("protein")).run() + + # Test precision lowered to account for platform differences with osx + assert_almost_equal(janin.angles, janin_ref_array, 3, + err_msg="error: dihedral angles should " + "match test values") + + def test_janin_single_frame(self, universe, janin_ref_array): + janin = Janin(universe.select_atoms("protein")).run(start=5, stop=6) + + assert_almost_equal(janin.angles[0], janin_ref_array[5], 3, + err_msg="error: dihedral angles should " + "match test values") + + def test_janin_residue_selections(self, universe): + janin = Janin(universe.select_atoms("resname LYS")).run() + test_janin = np.load(LYSJaninArray) + + assert_almost_equal(janin.angles, test_janin, 3, + err_msg="error: dihedral angles should " + "match test values") + + def test_outside_protein_length(self, universe): + with pytest.raises(ValueError): + janin = Janin(universe.select_atoms("resid 220")).run() + + def test_remove_residues(self, universe): + with pytest.warns(UserWarning): + janin = Janin(universe.select_atoms("protein")).run() + + def test_atom_selection(self): + with pytest.raises(ValueError): + u = mda.Universe(PDB_janin) + janin = Janin(u.select_atoms("protein and not resname ALA CYS GLY " + "PRO SER THR VAL")) + + def test_plot(self, universe): + ax = Janin(universe.select_atoms("resid 5-10")).run().plot(ref=True) + assert isinstance(ax, matplotlib.axes.Axes), \ + "Ramachandran.plot() did not return and Axes instance" diff --git a/testsuite/MDAnalysisTests/analysis/test_distances.py b/testsuite/MDAnalysisTests/analysis/test_distances.py index 00afa80fccf..9db91587bbf 100644 --- a/testsuite/MDAnalysisTests/analysis/test_distances.py +++ b/testsuite/MDAnalysisTests/analysis/test_distances.py @@ -21,7 +21,7 @@ # -from __future__ import print_function, absolute_import +from __future__ import print_function, absolute_import, division import pytest import scipy @@ -51,7 +51,7 @@ def coord(): @staticmethod @pytest.fixture() def box(): - return np.array([10, 10, 10], dtype=np.float32) + return np.array([10, 10, 10, 90, 90, 90], dtype=np.float32) @staticmethod @pytest.fixture() diff --git a/testsuite/MDAnalysisTests/analysis/test_encore.py b/testsuite/MDAnalysisTests/analysis/test_encore.py index f838d11b1dc..2dfa26361b0 100644 --- a/testsuite/MDAnalysisTests/analysis/test_encore.py +++ b/testsuite/MDAnalysisTests/analysis/test_encore.py @@ -28,6 +28,7 @@ import tempfile import numpy as np import sys +import os import warnings import pytest @@ -114,6 +115,9 @@ def test_triangular_matrix(self): err_msg="Error in TriangularMatrix: multiplication by scalar gave\ inconsistent results") + @pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Not yet supported on Windows.") def test_parallel_calculation(self): def function(x): @@ -305,10 +309,27 @@ def test_ces_convergence(self, ens1): err_msg="Unexpected value for Clustering Ensemble similarity in convergence estimation") def test_dres_convergence(self, ens1): - expected_values = [ 0.3, 0.] + # Due to encore.dres_convergence() involving random numbers, the + # following assertion is allowed to fail once. This significantly + # reduces the probability of a random test failure. + expected_values = [0.3, 0.] results = encore.dres_convergence(ens1, 10) - assert_almost_equal(results[:,0], expected_values, decimal=1, - err_msg="Unexpected value for Dim. reduction Ensemble similarity in convergence estimation") + try: + assert_almost_equal(results[:,0], expected_values, decimal=1) + except AssertionError: + # Random test failure is very rare, but repeating the failed test + # just once would only assert that the test passes with 50% + # probability. To be a little safer, we raise a warning and repeat + # the test 10 times: + warnings.warn(message="Test 'test_dres_convergence' failed, " + "repeating test 10 times.", + category=RuntimeWarning) + for i in range(10): + results = encore.dres_convergence(ens1, 10) + assert_almost_equal(results[:,0], expected_values, decimal=1, + err_msg="Unexpected value for Dim. " + "reduction Ensemble similarity in " + "convergence estimation") def test_hes_error_estimation(self, ens1): expected_average = 10 diff --git a/testsuite/MDAnalysisTests/analysis/test_hbonds.py b/testsuite/MDAnalysisTests/analysis/test_hbonds.py index 5314794f75d..0156b441ae4 100644 --- a/testsuite/MDAnalysisTests/analysis/test_hbonds.py +++ b/testsuite/MDAnalysisTests/analysis/test_hbonds.py @@ -28,7 +28,10 @@ import pytest from MDAnalysis import SelectionError -from numpy.testing import assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal,assert_allclose +from numpy.testing import ( + assert_equal, assert_array_equal, assert_almost_equal, + assert_array_almost_equal, assert_allclose, +) import numpy as np @@ -141,6 +144,40 @@ def test_count_by_type2(self, values, h): t = h.timesteps_by_type() assert_equal(t.time, values['num_bb_hbonds'] * [0.0]) +class TestHydrogenBondAnalysisPBC(TestHydrogenBondAnalysis): + # This system is identical to above class + # But has a box introduced, and atoms moved into neighbouring images + # The results however should remain identical if PBC is used + # If pbc:True in kwargs is changed, these tests should fail + @staticmethod + @pytest.fixture(scope='class') + def universe(): + u = MDAnalysis.Universe(PDB_helix) + # transfer to memory to changes to coordinates are reset + u.transfer_to_memory() + # place in huge oversized box + # real system is about 30A wide at most + boxsize = 150. + box = np.array([boxsize, boxsize, boxsize, 90., 90., 90.]) + u.dimensions = box + + # then scatter the atoms throughout various images of this box + u.atoms[::4].translate([boxsize * 2, 0, 0]) + u.atoms[1::4].translate([0, boxsize *4, 0]) + u.atoms[2::4].translate([-boxsize * 5, 0, -boxsize * 2]) + + return u + + kwargs = { + 'selection1': 'protein', + 'selection2': 'protein', + 'detect_hydrogens': "distance", + 'distance': 3.0, + 'angle': 150.0, + 'pbc': True, + } + + class TestHydrogenBondAnalysisHeuristic(TestHydrogenBondAnalysis): kwargs = { @@ -359,4 +396,3 @@ def test_table_atoms(self, h, normalized_timeseries, reference_table): # https://github.com/MDAnalysis/mdanalysis/issues/801) for name, ref in reference_table.items(): assert_array_equal(h.table.field(name), ref, err_msg="resname for {0} do not match (Issue #801)") - diff --git a/testsuite/MDAnalysisTests/analysis/test_helanal.py b/testsuite/MDAnalysisTests/analysis/test_helanal.py index aa5ebe5d412..23b8b6b587f 100644 --- a/testsuite/MDAnalysisTests/analysis/test_helanal.py +++ b/testsuite/MDAnalysisTests/analysis/test_helanal.py @@ -149,9 +149,3 @@ def test_xtc_striding(tmpdir): MDAnalysis.analysis.helanal.helanal_trajectory( u, selection="name CA", finish=5 ) - - #with assert_raises(FinishTimeException): - # try: - # MDAnalysis.analysis.helanal.helanal_trajectory(u, selection=sel, finish=5) - # except IndexError: - # self.fail("IndexError consistent with Issue 188.") diff --git a/testsuite/MDAnalysisTests/analysis/test_hydrogenbondautocorrel.py b/testsuite/MDAnalysisTests/analysis/test_hydrogenbondautocorrel.py index 3fa8e74e589..09fc4e6bbe0 100644 --- a/testsuite/MDAnalysisTests/analysis/test_hydrogenbondautocorrel.py +++ b/testsuite/MDAnalysisTests/analysis/test_hydrogenbondautocorrel.py @@ -26,10 +26,10 @@ from six.moves import range from MDAnalysisTests.datafiles import TRZ, TRZ_psf -from MDAnalysisTests import tempdir from numpy.testing import assert_almost_equal import numpy as np import mock +import os import MDAnalysis as mda from MDAnalysis.analysis.hbonds import HydrogenBondAutoCorrel as HBAC @@ -199,7 +199,7 @@ def actual_function_int(t): np.array([0.33, 0.33, 5, 1, 0.1]), ) - def test_save(self, u, hydrogens, oxygens, nitrogens): + def test_save(self, u, hydrogens, oxygens, nitrogens, tmpdir): hbond = HBAC(u, hydrogens=hydrogens, acceptors=oxygens, @@ -209,12 +209,13 @@ def test_save(self, u, hydrogens, oxygens, nitrogens): ) hbond.run() - with tempdir.in_tempdir(): - hbond.save_results('hbondout.npz') + tmpfile = os.path.join(str(tmpdir), 'hbondout.npz') - loaded = np.load('hbondout.npz') - assert 'time' in loaded - assert 'results' in loaded + hbond.save_results(tmpfile) + + loaded = np.load(tmpfile) + assert 'time' in loaded + assert 'results' in loaded # setup errors def test_wronglength_DA(self, u, hydrogens, oxygens, nitrogens): diff --git a/testsuite/MDAnalysisTests/analysis/test_leaflet.py b/testsuite/MDAnalysisTests/analysis/test_leaflet.py index 9eb4b4439d7..28593d66b5b 100644 --- a/testsuite/MDAnalysisTests/analysis/test_leaflet.py +++ b/testsuite/MDAnalysisTests/analysis/test_leaflet.py @@ -68,4 +68,3 @@ def test_optimize_cutoff(universe, lipid_heads): cutoff, N = optimize_cutoff(universe, lipid_heads, pbc=True) assert N == 2 assert_almost_equal(cutoff, 10.5, decimal=4) - diff --git a/testsuite/MDAnalysisTests/analysis/test_pca.py b/testsuite/MDAnalysisTests/analysis/test_pca.py index 5609b653324..0716efc2bb3 100644 --- a/testsuite/MDAnalysisTests/analysis/test_pca.py +++ b/testsuite/MDAnalysisTests/analysis/test_pca.py @@ -81,16 +81,24 @@ def test_transform_different_atoms(pca, u): def test_transform_rerun(u): atoms = u.select_atoms('bynum 1-10') u.transfer_to_memory() - pca = PCA(u, select='bynum 1-10', stop=5) + pca = PCA(u, select='bynum 1-10').run(stop=5) dot = pca.transform(atoms) assert_equal(dot.shape, (98, atoms.n_atoms * 3)) +def test_pca_not_run(u): + atoms = u.select_atoms('bynum 1-10') + u.transfer_to_memory() + pca = PCA(u, select='bynum 1-10') + with pytest.raises(ValueError): + dot = pca.transform(atoms, stop=5) + + def test_no_frames(u): atoms = u.select_atoms(SELECTION) u.transfer_to_memory() with pytest.raises(ValueError): - PCA(u, select=SELECTION, stop=1).run() + PCA(u, select=SELECTION).run(stop=1) def test_transform(pca, u): diff --git a/testsuite/MDAnalysisTests/analysis/test_psa.py b/testsuite/MDAnalysisTests/analysis/test_psa.py index 8dab6d498c6..79b03dd0226 100644 --- a/testsuite/MDAnalysisTests/analysis/test_psa.py +++ b/testsuite/MDAnalysisTests/analysis/test_psa.py @@ -28,11 +28,11 @@ import MDAnalysis.analysis.psa as PSA from numpy.testing import (assert_array_less, - assert_array_almost_equal, assert_almost_equal, assert_equal) import numpy as np import scipy import scipy.spatial +import matplotlib from MDAnalysisTests.datafiles import PSF, DCD, DCD2 @@ -73,10 +73,29 @@ def frech_dists(self, frech_matrix): return frech_matrix[self.iu1] @pytest.fixture() - def plot_data(self, psa): + def plot_data(self, psa, tmpdir): psa.run(metric='hausdorff') psa.run(metric='discrete_frechet') - return psa.plot() + with tmpdir.as_cwd(): + results = psa.plot(filename="distmat.png") + return results + + @pytest.fixture() + def plot_annotated_heatmap(self, psa, tmpdir): + pytest.importorskip('seaborn') + psa.run(metric='hausdorff') + with tmpdir.as_cwd(): + results = psa.plot_annotated_heatmap(filename="annotated.png") + return results + + @pytest.fixture() + def plot_nearest_neighbors(self, psa, tmpdir): + pytest.importorskip('seaborn') + psa.run(metric='hausdorff') + psa.run_pairs_analysis(neighbors=True) + with tmpdir.as_cwd(): + results = psa.plot_nearest_neighbors(filename="nn.png") + return results @pytest.fixture() def hausd_pairs_dists(self, psa): @@ -106,9 +125,9 @@ def test_explicit_metric(self, psa, hausd_dists): def test_reversal_hausdorff(self, hausd_matrix): """Test whether Hausdorff distances are invariant to path reversal""" err_msg = "Hausdorff distances changed after path reversal" - assert_array_almost_equal(hausd_matrix[1,2], - hausd_matrix[0,1], - decimal=3, err_msg=err_msg) + assert_almost_equal(hausd_matrix[1,2], + hausd_matrix[0,1], + decimal=3, err_msg=err_msg) def test_reversal_frechet(self, frech_matrix): """Test whether Frechet distances are same/larger after path reversal""" @@ -120,6 +139,14 @@ def test_dendrogram_produced(self, plot_data): err_msg = "Dendrogram dictionary object was not produced" assert isinstance(plot_data[1], dict), err_msg + def test_dendrogram_produced_annotated(self, plot_annotated_heatmap): + """Test whether Dendrogram dictionary object was produced""" + err_msg = "Dendrogram dictionary object was not produced" + assert isinstance(plot_annotated_heatmap[1], dict), err_msg + + def test_plot_nearest_neighbors(self, plot_nearest_neighbors): + assert isinstance(plot_nearest_neighbors, matplotlib.axes.Axes) + def test_dist_mat_to_vec_i_less_j(self): """Test the index of corresponding distance vector is correct if i < j""" err_msg = "dist_mat_to_vec function returning wrong values" @@ -149,8 +176,8 @@ def test_hausdorff_pairs_distances(self, hausd_dists, hausd_pairs_dists): identical to those from standard Hausdorff metric""" err_msg = ("Some Hausdorff distances from pairs analysis vary " "significantly from usual Hausdorff calculation") - assert_array_almost_equal(hausd_dists, hausd_pairs_dists, - decimal=6, err_msg=err_msg) + assert_almost_equal(hausd_dists, hausd_pairs_dists, + decimal=6, err_msg=err_msg) def test_distances_from_hausdorff_pairs_frames(self, psa): """Test whether actual distances between frames of Hausdorff @@ -161,7 +188,7 @@ def test_distances_from_hausdorff_pairs_frames(self, psa): hausd_pairs_dists2 = np.array([hausd_pairs[i]['distance'] for i in range(npairs)]) - + err_msg = ("A Hausdorff pair analysis distance when accessed " "by frame varies from expected Hausdorff distance") dists = np.zeros((psa.npaths, psa.npaths)) @@ -172,9 +199,9 @@ def test_distances_from_hausdorff_pairs_frames(self, psa): dists[i,j] = (PSA.sqnorm(psa.paths[i][p,:,:] - psa.paths[j][q,:,:]) / psa.natoms)**0.5 - assert_array_almost_equal(hausd_pairs_dists2, - dists[self.iu1], - decimal=6, err_msg=err_msg) + assert_almost_equal(hausd_pairs_dists2, + dists[self.iu1], + decimal=6, err_msg=err_msg) class TestPSAExceptions(object): '''Tests for exceptions that should be raised diff --git a/testsuite/MDAnalysisTests/analysis/test_rdf_s.py b/testsuite/MDAnalysisTests/analysis/test_rdf_s.py new file mode 100644 index 00000000000..743acf0c513 --- /dev/null +++ b/testsuite/MDAnalysisTests/analysis/test_rdf_s.py @@ -0,0 +1,107 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2018 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +from __future__ import absolute_import, division + +import pytest + +from numpy.testing import assert_almost_equal + +import MDAnalysis as mda +from MDAnalysis.analysis.rdf import InterRDF_s + +from MDAnalysisTests.datafiles import GRO_MEMPROT, XTC_MEMPROT + + +@pytest.fixture(scope='module') +def u(): + return mda.Universe(GRO_MEMPROT, XTC_MEMPROT) + + +@pytest.fixture(scope='module') +def sels(u): + s1 = u.select_atoms('name ZND and resid 289') + s2 = u.select_atoms('(name OD1 or name OD2) and resid 51 and sphzone 5.0 (resid 289)') + s3 = u.select_atoms('name ZND and (resid 291 or resid 292)') + s4 = u.select_atoms('(name OD1 or name OD2) and sphzone 5.0 (resid 291)') + ags = [[s1, s2], [s3, s4]] + return ags + +@pytest.fixture(scope='module') +def rdf(u, sels): + return InterRDF_s(u, sels).run() + +def test_nbins(u): + ags = sels(u) + rdf = InterRDF_s(u, ags, nbins=412).run() + + assert len(rdf.bins) == 412 + + +def test_range(u): + ags = sels(u) + rmin, rmax = 1.0, 13.0 + rdf = InterRDF_s(u, ags, range=(rmin, rmax)).run() + + assert rdf.edges[0] == rmin + assert rdf.edges[-1] == rmax + + +def test_count_size(rdf): + # ZND vs OD1 & OD2 + # should see 2 elements in rdf.count + # 1 element in rdf.count[0] + # 2 elements in rdf.count[0][0] + # 2 elements in rdf.count[1] + # 2 elements in rdf.count[1][0] + # 2 elements in rdf.count[1][1] + assert len(rdf.count) == 2 + assert len(rdf.count[0]) == 1 + assert len(rdf.count[0][0]) == 2 + assert len(rdf.count[1]) == 2 + assert len(rdf.count[1][0]) == 2 + assert len(rdf.count[1][1]) == 2 + + +def test_count(rdf): + # should see one distance with 5 counts in count[0][0][1] + # should see one distance with 3 counts in count[1][1][0] + assert len(rdf.count[0][0][1][rdf.count[0][0][1] == 5]) == 1 + assert len(rdf.count[1][1][0][rdf.count[1][1][0] == 3]) == 1 + + +def test_double_run(rdf): + # running rdf twice should give the same result + assert len(rdf.count[0][0][1][rdf.count[0][0][1] == 5]) == 1 + assert len(rdf.count[1][1][0][rdf.count[1][1][0] == 3]) == 1 + +def test_cdf(rdf): + rdf.get_cdf() + assert rdf.cdf[0][0][0][-1] == rdf.count[0][0][0].sum()/rdf.n_frames + + +@pytest.mark.parametrize("density, value", [ + (True, 13275.775528444701), + (False, 0.021915460340071267)]) + +def test_density(u, sels, density, value): + rdf = InterRDF_s(u, sels, density=density).run() + assert_almost_equal(max(rdf.rdf[0][0][0]), value) diff --git a/testsuite/MDAnalysisTests/analysis/test_rms.py b/testsuite/MDAnalysisTests/analysis/test_rms.py index f92f1e38fd4..fa560cd8120 100644 --- a/testsuite/MDAnalysisTests/analysis/test_rms.py +++ b/testsuite/MDAnalysisTests/analysis/test_rms.py @@ -191,17 +191,15 @@ def test_progress_meter(self, capsys, universe): assert_equal(actual, expected) def test_rmsd(self, universe, correct_values): - RMSD = MDAnalysis.analysis.rms.RMSD(universe, select='name CA', - step=49) - RMSD.run() + RMSD = MDAnalysis.analysis.rms.RMSD(universe, select='name CA') + RMSD.run(step=49) assert_almost_equal(RMSD.rmsd, correct_values, 4, err_msg="error: rmsd profile should match" + "test values") def test_rmsd_unicode_selection(self, universe, correct_values): - RMSD = MDAnalysis.analysis.rms.RMSD(universe, select=u'name CA', - step=49) - RMSD.run() + RMSD = MDAnalysis.analysis.rms.RMSD(universe, select=u'name CA') + RMSD.run(step=49) assert_almost_equal(RMSD.rmsd, correct_values, 4, err_msg="error: rmsd profile should match" + "test values") @@ -216,7 +214,7 @@ def test_rmsd_atomgroup_selections(self, universe): def test_rmsd_single_frame(self, universe): RMSD = MDAnalysis.analysis.rms.RMSD(universe, select='name CA', - start=5, stop=6).run() + ).run(start=5, stop=6) single_frame = [[5, 6, 0.91544906]] assert_almost_equal(RMSD.rmsd, single_frame, 4, err_msg="error: rmsd profile should match" + @@ -226,7 +224,7 @@ def test_mass_weighted_and_save(self, universe, outfile, correct_values): # mass weighting the CA should give the same answer as weighing # equally because all CA have the same mass RMSD = MDAnalysis.analysis.rms.RMSD(universe, select='name CA', - step=49, weights='mass').run() + weights='mass').run(step=49) RMSD.save(outfile) assert_almost_equal(RMSD.rmsd, correct_values, 4, @@ -238,8 +236,7 @@ def test_mass_weighted_and_save(self, universe, outfile, correct_values): "saved test values") def test_custom_weighted(self, universe, correct_values_mass): - RMSD = MDAnalysis.analysis.rms.RMSD(universe, - step=49, weights="mass").run() + RMSD = MDAnalysis.analysis.rms.RMSD(universe, weights="mass").run(step=49) assert_almost_equal(RMSD.rmsd, correct_values_mass, 4, err_msg="error: rmsd profile should match" @@ -247,10 +244,9 @@ def test_custom_weighted(self, universe, correct_values_mass): def test_weights_mass_is_mass_weighted(self, universe): RMSD_mass = MDAnalysis.analysis.rms.RMSD(universe, - step=49, weights="mass").run() + weights="mass").run(step=49) RMSD_cust = MDAnalysis.analysis.rms.RMSD(universe, - step=49, - weights=universe.atoms.masses).run() + weights=universe.atoms.masses).run(step=49) assert_almost_equal(RMSD_mass.rmsd, RMSD_cust.rmsd, 4, err_msg="error: rmsd profiles should match for 'mass' " "and universe.atoms.masses") @@ -258,8 +254,7 @@ def test_weights_mass_is_mass_weighted(self, universe): def test_custom_weighted_list(self, universe, correct_values_mass): weights = universe.atoms.masses RMSD = MDAnalysis.analysis.rms.RMSD(universe, - step=49, - weights=list(weights)).run() + weights=list(weights)).run(step=49) assert_almost_equal(RMSD.rmsd, correct_values_mass, 4, err_msg="error: rmsd profile should match" + "test values") @@ -287,9 +282,8 @@ def test_rmsd_group_selections_wrong_weights(self, universe): def test_rmsd_group_selections(self, universe, correct_values_group): RMSD = MDAnalysis.analysis.rms.RMSD(universe, - groupselections= - ['backbone', 'name CA'], - step=49).run() + groupselections=['backbone', 'name CA'] + ).run(step=49) assert_almost_equal(RMSD.rmsd, correct_values_group, 4, err_msg="error: rmsd profile should match" "test values") @@ -301,13 +295,11 @@ def test_rmsd_backbone_and_group_selection(self, universe, reference=universe, select="backbone", groupselections=['backbone and resid 1:10', - 'backbone and resid 10:20'], - step=49).run() + 'backbone and resid 10:20']).run(step=49) assert_almost_equal( RMSD.rmsd, correct_values_backbone_group, 4, err_msg="error: rmsd profile should match test values") - def test_ref_length_unequal_len(self, universe): reference = MDAnalysis.Universe(PSF, DCD) reference.atoms = reference.atoms[:-1] @@ -352,16 +344,7 @@ def test_rmsf(self, universe): "values") def test_rmsf_single_frame(self, universe): - rmsfs = rms.RMSF(universe.select_atoms('name CA'), start=5, stop=6).run() - - assert_almost_equal(rmsfs.rmsf, 0, 5, - err_msg="error: rmsfs should all be zero") - - def test_rmsf_old_run(self, universe): - # start/stop arguments should be given at class initialization - with pytest.deprecated_call(): - rmsfs = rms.RMSF(universe.select_atoms('name CA')).run(start=5, - stop=6) + rmsfs = rms.RMSF(universe.select_atoms('name CA')).run(start=5, stop=6) assert_almost_equal(rmsfs.rmsf, 0, 5, err_msg="error: rmsfs should all be zero") diff --git a/testsuite/MDAnalysisTests/analysis/test_waterdynamics.py b/testsuite/MDAnalysisTests/analysis/test_waterdynamics.py index a4cd5f0e247..f735e336cf5 100644 --- a/testsuite/MDAnalysisTests/analysis/test_waterdynamics.py +++ b/testsuite/MDAnalysisTests/analysis/test_waterdynamics.py @@ -22,17 +22,18 @@ from __future__ import print_function, absolute_import import MDAnalysis from MDAnalysis.analysis import waterdynamics -import pytest from MDAnalysisTests.datafiles import waterPSF, waterDCD from MDAnalysisTests.datafiles import PDB, XTC +import pytest import numpy as np +from mock import patch +from mock import Mock from numpy.testing import assert_almost_equal SELECTION1 = "byres name OH2" SELECTION2 = "byres name P1" -SELECTION3 = "around 4 (resid 151 and name OE1)" @pytest.fixture(scope='module') @@ -40,11 +41,6 @@ def universe(): return MDAnalysis.Universe(waterPSF, waterDCD) -@pytest.fixture(scope='module') -def universe_prot(): - return MDAnalysis.Universe(PDB, XTC) - - def test_HydrogenBondLifetimes(universe): hbl = waterdynamics.HydrogenBondLifetimes( universe, SELECTION1, SELECTION1, 0, 5, 3) @@ -89,20 +85,37 @@ def test_MeanSquareDisplacement_zeroMolecules(universe): assert_almost_equal(msd_zero.timeseries[1], 0.0) -def test_SurvivalProbability(universe_prot): - sp = waterdynamics.SurvivalProbability(universe_prot, SELECTION3, 0, 10, 4) - sp.run() - assert_almost_equal(sp.timeseries, [1.0, 0.354, 0.267, 0.242], decimal=3) - +def test_SurvivalProbability_t0tf(universe): + with patch.object(universe, 'select_atoms') as select_atoms_mock: + ids = [(0, ), (0, ), (7, 6, 5), (6, 5, 4), (5, 4, 3), (4, 3, 2), (3, 2, 1), (0, )] + select_atoms_mock.side_effect = lambda selection: Mock(ids=ids.pop(2)) # atom IDs fed set by set + sp = waterdynamics.SurvivalProbability(universe, "") + sp.run(tau_max=3, start=2, stop=6) + assert_almost_equal(sp.sp_timeseries, [2 / 3.0, 1 / 3.0, 0]) -def test_SurvivalProbability_t0Ignored(universe_prot): - sp = waterdynamics.SurvivalProbability(universe_prot, SELECTION3, 3, 10, 4) - sp.run() - assert_almost_equal(sp.timeseries, [1.0, 0.391, 0.292, 0.261], decimal=3) +def test_SurvivalProbability_definedTaus(universe): + with patch.object(universe, 'select_atoms') as select_atoms_mock: + ids = [(9, 8, 7), (8, 7, 6), (7, 6, 5), (6, 5, 4), (5, 4, 3), (4, 3, 2), (3, 2, 1)] + select_atoms_mock.side_effect = lambda selection: Mock(ids=ids.pop()) # atom IDs fed set by set + sp = waterdynamics.SurvivalProbability(universe, "") + sp.run(tau_max=3, start=0, stop=6) + assert_almost_equal(sp.sp_timeseries, [2 / 3.0, 1 / 3.0, 0]) def test_SurvivalProbability_zeroMolecules(universe): - sp_zero = waterdynamics.SurvivalProbability(universe, SELECTION2, 0, 6, 3) - sp_zero.run() - assert_almost_equal(sp_zero.timeseries[1], 0.0) + with patch.object(universe, 'select_atoms') as select_atoms_mock: + # no atom IDs found + select_atoms_mock.return_value = Mock(ids=[]) + sp = waterdynamics.SurvivalProbability(universe, "") + sp.run(tau_max=3, start=3, stop=6) + assert all(np.isnan(sp.sp_timeseries)) + + +def test_SurvivalProbability_alwaysPresent(universe): + with patch.object(universe, 'select_atoms') as select_atoms_mock: + # always the same atom IDs found + select_atoms_mock.return_value = Mock(ids=[7, 8]) + sp = waterdynamics.SurvivalProbability(universe, "") + sp.run(tau_max=3, start=0, stop=6) + assert all(np.equal(sp.sp_timeseries, 1)) \ No newline at end of file diff --git a/testsuite/MDAnalysisTests/analysis/test_wbridge.py b/testsuite/MDAnalysisTests/analysis/test_wbridge.py index 0b9db198a7c..eae136fc3d7 100644 --- a/testsuite/MDAnalysisTests/analysis/test_wbridge.py +++ b/testsuite/MDAnalysisTests/analysis/test_wbridge.py @@ -6,6 +6,14 @@ import MDAnalysis from MDAnalysis.analysis.hbonds.wbridge_analysis import WaterBridgeAnalysis +def test_import_from_hbonds(): + try: + from MDAnalysis.analysis.hbonds import WaterBridgeAnalysis + except ImportError: + raise AssertionError("Issue #2064 not fixed: " + "importing WaterBridgeAnalysis from " + "MDAnalysis.analysis.hbonds failed.'") + class TestWaterBridgeAnalysis(object): def test_acceptor_water_accepter(self): '''Test case where the hydrogen bond acceptor from selection 1 form @@ -169,7 +177,7 @@ def test_count_by_type_multiple_link(self): wb = WaterBridgeAnalysis(u, 'protein and (resid 1)', 'protein and (resid 4)') # Build an dummy WaterBridgeAnalysis object for testing wb._timeseries = True - wb.timesteps = range(1) + wb.timesteps = [0] wb._water_network = [{('SOL', 2): [{(2, 0, ('SOL', 2, 'HW1'), ('ALA', 1, 'O'), 2.0, 179.99998), (1, 2, ('ALA', 1, 'H'), ('SOL', 2, 'OW'), 2.0, 179.99998)}, {(3, 4, ('SOL', 2, 'HW2'), ('ALA', 4, 'O'), 2.0, 179.99998), @@ -197,7 +205,7 @@ def test_count_by_type_multiple_frame(self): wb = WaterBridgeAnalysis(u, 'protein and (resid 1)', 'protein and (resid 4)') # Build an dummy WaterBridgeAnalysis object for testing wb._timeseries = True - wb.timesteps = range(6) + wb.timesteps = [0, 1, 2, 3, 4, 5] wb._water_network = [# a 2 * 2 water netwrok consists of all four links {('SOL', 2): [{(2, 0, ('SOL', 2, 'HW1'), ('ALA', 1, 'O'), 2.0, 179.99998), (1, 2, ('ALA', 1, 'H'), ('SOL', 2, 'OW'), 2.0, 179.99998)}, @@ -224,4 +232,4 @@ def test_count_by_type_multiple_frame(self): (0, 4, 'ALA', 1, 'O', 'ALA', 4, 'O', 0.5), (1, 3, 'ALA', 1, 'H', 'ALA', 4, 'H', 0.5), (1, 4, 'ALA', 1, 'H', 'ALA', 4, 'O', 0.5)] - assert_equal(sorted(wb.count_by_type().tolist()), result) \ No newline at end of file + assert_equal(sorted(wb.count_by_type().tolist()), result) diff --git a/testsuite/MDAnalysisTests/coordinates/base.py b/testsuite/MDAnalysisTests/coordinates/base.py index 3ceb2070c82..3856b37ff68 100644 --- a/testsuite/MDAnalysisTests/coordinates/base.py +++ b/testsuite/MDAnalysisTests/coordinates/base.py @@ -30,6 +30,7 @@ import MDAnalysis as mda from MDAnalysis.coordinates.base import Timestep +from MDAnalysis.transformations import translate from MDAnalysis import NoDataError from MDAnalysis.lib.mdamath import triclinic_vectors @@ -209,6 +210,13 @@ def reader(ref): reader.add_auxiliary('highf', ref.aux_highf, dt=ref.aux_highf_dt, initial_time=0, time_selector=None) return reader + @staticmethod + @pytest.fixture() + def transformed(ref): + transformed = ref.reader(ref.trajectory) + transformed.add_transformations(translate([1,1,1]), translate([0,0,0.33])) + return transformed + def test_n_atoms(self, ref, reader): assert_equal(reader.n_atoms, ref.n_atoms) @@ -339,6 +347,82 @@ def test_stop_iter(self, reader): pass assert_equal(reader.frame, 0) + def test_transformations_iter(self, ref, transformed): + # test one iteration and see if the transformations are applied + v1 = np.float32((1,1,1)) + v2 = np.float32((0,0,0.33)) + for i, ts in enumerate(transformed): + idealcoords = ref.iter_ts(i).positions + v1 + v2 + assert_array_almost_equal(ts.positions, idealcoords, decimal=ref.prec) + + def test_transformations_2iter(self, ref, transformed): + # Are the transformations applied and + # are the coordinates "overtransformed"? + v1 = np.float32((1,1,1)) + v2 = np.float32((0,0,0.33)) + idealcoords=[] + for i, ts in enumerate(transformed): + idealcoords.append(ref.iter_ts(i).positions + v1 + v2) + assert_array_almost_equal(ts.positions, idealcoords[i], decimal=ref.prec) + + for i, ts in enumerate(transformed): + assert_almost_equal(ts.positions, idealcoords[i], decimal=ref.prec) + + def test_transformations_slice(self, ref, transformed): + # Are the transformations applied when iterating over a slice of the trajectory? + v1 = np.float32((1,1,1)) + v2 = np.float32((0,0,0.33)) + for i,ts in enumerate(transformed[2:3:1]): + idealcoords = ref.iter_ts(ts.frame).positions + v1 + v2 + assert_array_almost_equal(ts.positions, idealcoords, decimal = ref.prec) + + + def test_transformations_switch_frame(self, ref, transformed): + # This test checks if the transformations are applied and if the coordinates + # "overtransformed" on different situations + # Are the transformations applied when we switch to a different frame? + v1 = np.float32((1,1,1)) + v2 = np.float32((0,0,0.33)) + first_ideal = ref.iter_ts(0).positions + v1 + v2 + if len(transformed)>1: + assert_array_almost_equal(transformed[0].positions, first_ideal, decimal = ref.prec) + second_ideal = ref.iter_ts(1).positions + v1 + v2 + assert_array_almost_equal(transformed[1].positions, second_ideal, decimal = ref.prec) + + # What if we comeback to the previous frame? + assert_array_almost_equal(transformed[0].positions, first_ideal, decimal = ref.prec) + + # How about we switch the frame to itself? + assert_array_almost_equal(transformed[0].positions, first_ideal, decimal = ref.prec) + else: + assert_array_almost_equal(transformed[0].positions, first_ideal, decimal = ref.prec) + + def test_transformation_rewind(self,ref, transformed): + # this test checks if the transformations are applied after rewinding the + # trajectory + v1 = np.float32((1,1,1)) + v2 = np.float32((0,0,0.33)) + ideal_coords = ref.iter_ts(0).positions + v1 + v2 + transformed.rewind() + assert_array_almost_equal(transformed[0].positions, ideal_coords, decimal = ref.prec) + + def test_transformations_copy(self,ref,transformed): + # this test checks if transformations are carried over a copy and if the + # coordinates of the copy are equal to the original's + v1 = np.float32((1,1,1)) + v2 = np.float32((0,0,0.33)) + new = transformed.copy() + assert_equal(transformed.transformations, new.transformations, + "transformations are not equal") + for i, ts in enumerate(new): + ideal_coords = ref.iter_ts(i).positions + v1 + v2 + assert_array_almost_equal(ts.positions, ideal_coords, decimal = ref.prec) + + + def test_add_another_transformations_raises_ValueError(self, transformed): + # After defining the transformations, the workflow cannot be changed + with pytest.raises(ValueError): + transformed.add_transformations(translate([2,2,2])) class MultiframeReaderTest(BaseReaderTest): def test_last_frame(self, ref, reader): @@ -355,6 +439,15 @@ def test_frame_jump(self, ref, reader): assert_timestep_almost_equal(ts, ref.jump_to_frame, decimal=ref.prec) + def test_frame_jump_issue1942(self, ref, reader): + """Test for issue 1942 (especially XDR on macOS)""" + reader.rewind() + try: + for ii in range(ref.n_frames + 2): + reader[0] + except StopIteration: + pytest.fail("Frame-seeking wrongly iterated (#1942)") + def test_next_gives_second_frame(self, ref, reader): reader = ref.reader(ref.trajectory) ts = reader.next() @@ -539,14 +632,14 @@ class BaseTimestepTest(object): unitcell = np.array([10., 11., 12., 90., 90., 90.]) ref_volume = 1320. # what the volume is after setting newbox uni_args = None - + @pytest.fixture() def ts(self): ts = self.Timestep(self.size) ts.frame += 1 ts.positions = self.refpos return ts - + def test_getitem(self, ts): assert_equal(ts[1], self.refpos[1]) @@ -894,13 +987,13 @@ def _check_copy_slice_slice(self, name, ts): def _check_npint_slice(self, name, ts): for integers in [np.byte, np.short, np.intc, np.int_, np.longlong, - np.intp, np.int8, np.int16, np.int32, np.int64, + np.intp, np.int8, np.int16, np.int32, np.int64, np.ubyte, np.ushort, np.uintc, np.ulonglong, np.uintp, np.uint8, np.uint16, np.uint32, np.uint64]: sl = slice(1, 2, 1) ts2 = ts.copy_slice(slice(integers(1), integers(2), integers(1))) self._check_slice(ts, ts2, sl) - + def _check_slice(self, ts1, ts2, sl): if ts1.has_positions: assert_array_almost_equal(ts1.positions[sl], ts2.positions) diff --git a/testsuite/MDAnalysisTests/coordinates/test_amber_inpcrd.py b/testsuite/MDAnalysisTests/coordinates/test_amber_inpcrd.py index 9edc5c6d771..517ccaef421 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_amber_inpcrd.py +++ b/testsuite/MDAnalysisTests/coordinates/test_amber_inpcrd.py @@ -57,4 +57,3 @@ def test_universe_inpcrd(self): def test_universe_restrt(self): u = mda.Universe(XYZ_five, INPCRD, format='RESTRT') self._check_ts(u.trajectory.ts) - diff --git a/testsuite/MDAnalysisTests/coordinates/test_chainreader.py b/testsuite/MDAnalysisTests/coordinates/test_chainreader.py index 7cccf375053..d7661e1928e 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_chainreader.py +++ b/testsuite/MDAnalysisTests/coordinates/test_chainreader.py @@ -20,18 +20,20 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # from __future__ import division, absolute_import - from six.moves import zip import numpy as np +import os import pytest -from numpy.testing import (assert_equal, assert_almost_equal, assert_array_almost_equal) +from numpy.testing import (assert_equal, assert_almost_equal) import MDAnalysis as mda +from MDAnalysis.transformations import translate from MDAnalysisTests.datafiles import (PDB, PSF, CRD, DCD, GRO, XTC, TRR, PDB_small, PDB_closed) +from MDAnalysisTests.util import no_warning class TestChainReader(object): @@ -42,6 +44,12 @@ def universe(self): return mda.Universe(PSF, [DCD, CRD, DCD, CRD, DCD, CRD, CRD]) + @pytest.fixture() + def transformed(ref): + return mda.Universe(PSF, + [DCD, CRD, DCD, CRD, DCD, CRD, CRD], + transformations=[translate([10,10,10])]) + def test_next_trajectory(self, universe): universe.trajectory.rewind() universe.trajectory.next() @@ -58,14 +66,15 @@ def test_n_frames(self, universe): def test_iteration(self, universe): for ts in universe.trajectory: pass # just forward to last frame - assert_equal( - universe.trajectory.n_frames - 1, ts.frame, - "iteration yielded wrong number of frames ({0:d}), " - "should be {1:d}".format(ts.frame, universe.trajectory.n_frames)) + assert_equal(universe.trajectory.n_frames - 1, ts.frame, + "iteration yielded wrong number of frames ({0:d}), " + "should be {1:d}".format(ts.frame, + universe.trajectory.n_frames)) def test_jump_lastframe_trajectory(self, universe): universe.trajectory[-1] - assert_equal(universe.trajectory.ts.frame + 1, universe.trajectory.n_frames, + assert_equal(universe.trajectory.ts.frame + 1, + universe.trajectory.n_frames, "indexing last frame with trajectory[-1]") def test_slice_trajectory(self, universe): @@ -87,16 +96,13 @@ def test_frame(self, universe): # forward to frame where we repeat original dcd again: # dcd:0..97 crd:98 dcd:99..196 universe.trajectory[99] - assert_equal( - universe.atoms.positions, coord0, - "coordinates at frame 1 and 100 should be the same!") + assert_equal(universe.atoms.positions, coord0, + "coordinates at frame 1 and 100 should be the same!") def test_time(self, universe): universe.trajectory[30] # index and frames 0-based - assert_almost_equal(universe.trajectory.time, - 30.0, - 5, - err_msg="Wrong time of frame") + assert_almost_equal( + universe.trajectory.time, 30.0, 5, err_msg="Wrong time of frame") def test_write_dcd(self, universe, tmpdir): """test that ChainReader written dcd (containing crds) is correct @@ -107,14 +113,53 @@ def test_write_dcd(self, universe, tmpdir): W.write(universe) universe.trajectory.rewind() u = mda.Universe(PSF, outfile) - for (ts_orig, ts_new) in zip(universe.trajectory, - u.trajectory): + for (ts_orig, ts_new) in zip(universe.trajectory, u.trajectory): assert_almost_equal( ts_orig._pos, ts_new._pos, self.prec, err_msg="Coordinates disagree at frame {0:d}".format( ts_orig.frame)) + + def test_transform_iteration(self, universe, transformed): + vector = np.float32([10,10,10]) + # # Are the transformations applied and + # are the coordinates "overtransformed"? + # iterate once: + for ts in transformed.trajectory: + frame = ts.frame + ref = universe.trajectory[frame].positions + vector + assert_almost_equal(ts.positions, ref, decimal = 6) + # iterate again: + for ts in transformed.trajectory: + frame = ts.frame + ref = universe.trajectory[frame].positions + vector + assert_almost_equal(ts.positions, ref, decimal = 6) + + def test_transform_slice(self, universe, transformed): + vector = np.float32([10,10,10]) + # what happens when we slice the trajectory? + for ts in transformed.trajectory[5:17:3]: + frame = ts.frame + ref = universe.trajectory[frame].positions + vector + assert_almost_equal(ts.positions, ref, decimal = 6) + + def test_transform_switch(self, universe, transformed): + vector = np.float32([10,10,10]) + # grab a frame: + ref = universe.trajectory[2].positions + vector + assert_almost_equal(transformed.trajectory[2].positions, ref, decimal = 6) + # now switch to another frame + newref = universe.trajectory[10].positions + vector + assert_almost_equal(transformed.trajectory[10].positions, newref, decimal = 6) + # what happens when we comeback to the previous frame? + assert_almost_equal(transformed.trajectory[2].positions, ref, decimal = 6) + + def test_transfrom_rewind(self, universe, transformed): + vector = np.float32([10,10,10]) + ref = universe.trajectory[0].positions + vector + transformed.trajectory.rewind() + assert_almost_equal(transformed.trajectory.ts.positions, ref, decimal = 6) class TestChainReaderCommonDt(object): common_dt = 100.0 @@ -122,34 +167,202 @@ class TestChainReaderCommonDt(object): @pytest.fixture() def trajectory(self): - universe = mda.Universe(PSF, - [DCD, CRD, DCD, CRD, DCD, CRD, CRD], - dt=self.common_dt) + universe = mda.Universe( + PSF, [DCD, CRD, DCD, CRD, DCD, CRD, CRD], dt=self.common_dt) return universe.trajectory def test_time(self, trajectory): # We test this for the beginning, middle and end of the trajectory. for frame_n in (0, trajectory.n_frames // 2, -1): trajectory[frame_n] - assert_almost_equal(trajectory.time, - trajectory.frame * self.common_dt, - 5, - err_msg="Wrong time for frame {0:d}".format( - frame_n)) + assert_almost_equal( + trajectory.time, + trajectory.frame * self.common_dt, + 5, + err_msg="Wrong time for frame {0:d}".format(frame_n)) class TestChainReaderFormats(object): """Test of ChainReader with explicit formats (Issue 76).""" def test_set_all_format_tuples(self): - universe = mda.Universe(GRO, [(PDB, 'pdb'), (XTC, 'xtc'), - (TRR, 'trr')]) - assert_equal(universe.trajectory.n_frames, 21) + universe = mda.Universe(GRO, [(PDB, 'pdb'), (XTC, 'xtc'), (TRR, + 'trr')]) + assert universe.trajectory.n_frames == 21 + assert_equal(universe.trajectory.filenames, [PDB, XTC, TRR]) def test_set_one_format_tuple(self): universe = mda.Universe(PSF, [(PDB_small, 'pdb'), DCD]) - assert_equal(universe.trajectory.n_frames, 99) + assert universe.trajectory.n_frames == 99 def test_set_all_formats(self): universe = mda.Universe(PSF, [PDB_small, PDB_closed], format='pdb') - assert_equal(universe.trajectory.n_frames, 2) + assert universe.trajectory.n_frames == 2 + + +def build_trajectories(folder, sequences, fmt='xtc'): + """ + A scenario is given as a series of time sequences. The result is + returned as a list of time and origin of the frame. Each element of that + result list correspond to a frame of the conatenated trajectory, The + first element of each tuple is the time it corresponds to, the second + element is the index of the input the frame comes from. + + See original gist and PR 1728 for comparison with gromacs trjcat. + + https://gist.github.com/jbarnoud/cacd0957d3df01d1577f640b20e86039 + """ + template = 'trjcat_test_{{}}.{}'.format(fmt) + template = os.path.join(folder, template) + + # Use an empty universe to have a topology + utop = mda.Universe.empty(1, trajectory=True) + + # Create synthetic trajectories. The times come from the user input, + # the coordinates indicate the index of the input. + fnames = [] + for index, subseq in enumerate(sequences): + coords = np.zeros((len(subseq), 1, 3), dtype=np.float32) + index + u = mda.Universe(utop._topology, coords) + out_traj = mda.Writer(template.format(index), n_atoms=len(u.atoms)) + fnames.append(out_traj.filename) + with out_traj: + for ts, time in zip(u.trajectory, subseq): + # The time step needs a box to avoid a warning + ts.dimensions = [10, 10, 10, 90, 90, 90] + # The time is set from the user input + ts.time = time + out_traj.write(ts) + return utop, fnames + + +class TestChainReaderContinuous(object): + class SequenceInfo(object): + def __init__(self, seq, n_frames, order): + self.seq = seq + self.n_frames = n_frames + self.order = order + + @pytest.mark.parametrize('fmt', ('xtc', 'trr')) + @pytest.mark.parametrize('seq_info',[ + SequenceInfo(seq=([0, 1, 2, 3], [2, 3, 4, 5], [4, 5, 6, 7]), + n_frames=8, + order=[0, 0, 1, 1, 2, 2, 2, 2]), + SequenceInfo(seq=([0, 1, 2, 4], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), + n_frames=10, + order=np.ones(10)), + SequenceInfo(seq=([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3]), + n_frames=4, + order=np.ones(4)), + SequenceInfo(seq=([5, 6, 7, 8, 9], [2, 3, 4, 5, 6], [0, 1, 2, 3]), + n_frames=10, + order=[2, 2, 1, 1, 1, 0, 0, 0, 0, 0]), + SequenceInfo(seq=([0, 1, 2],) * 3, + n_frames=3, + order=[2, 2, 2]), + SequenceInfo(seq=([0, 1, 2, 3,], [3, 4], [4, 5, 6, 7]), + n_frames=8, + order=[0, 0, 0, 1, 2, 2, 2, 2]), + SequenceInfo(seq=([5, 6, 7, 8, 9], [2, 3, 4, 5, 6], [0, 1, 2, 3]), + n_frames=10, + order=[2, 2, 1, 1, 1, 0, 0, 0, 0, 0]), + SequenceInfo(seq=[list(range(0, 6)), list(range(2, 5)), + list(range(2, 5)), list(range(2, 5)), + list(range(3, 8))], + n_frames=8, + order=[0, 0, 3, 4, 4, 4, 4, 4]), + ]) + def test_order(self, seq_info, tmpdir, fmt): + folder = str(tmpdir) + utop, fnames = build_trajectories(folder, sequences=seq_info.seq, fmt=fmt) + u = mda.Universe(utop._topology, fnames, continuous=True) + assert u.trajectory.n_frames == seq_info.n_frames + for i, ts in enumerate(u.trajectory): + assert_almost_equal(i, ts.time, decimal=4) + # check we have used the right trajectory + assert seq_info.order[i] == int(ts.positions[0, 0]) + + def test_start_frames(self, tmpdir): + folder = str(tmpdir) + sequences = ([0, 1, 2, 3], [2, 3, 4, 5], [4, 5, 6, 7]) + utop, fnames = build_trajectories(folder, sequences=sequences,) + u = mda.Universe(utop._topology, fnames, continuous=True) + assert_equal(u.trajectory._start_frames, [0, 2, 4]) + + def test_missing(self, tmpdir): + folder = str(tmpdir) + sequences = ([0, 1, 2, 3], [5, 6, 7, 8, 9]) + utop, fnames = build_trajectories(folder, sequences=sequences,) + u = mda.Universe(utop._topology, fnames, continuous=True) + assert u.trajectory.n_frames == 9 + + def test_warning(self, tmpdir): + folder = str(tmpdir) + # this sequence *should* trigger a warning + sequences = ([0, 1, 2, 3], [5, 6, 7]) + utop, fnames = build_trajectories(folder, sequences=sequences,) + with pytest.warns(UserWarning): + mda.Universe(utop._topology, fnames, continuous=True) + + def test_interleaving_error(self, tmpdir): + folder = str(tmpdir) + # interleaving is not supported by chainreader + sequences = ([0, 2, 4, 6], [1, 3, 5, 7]) + utop, fnames = build_trajectories(folder, sequences=sequences,) + with pytest.raises(RuntimeError): + mda.Universe(utop._topology, fnames, continuous=True) + + def test_easy_trigger_warning(self, tmpdir): + folder = str(tmpdir) + # this sequence shouldn't trigger a warning + sequences = ([0, 1, 2, 3], [2, 3, 4, 5], [4, 5, 6, 7]) + utop, fnames = build_trajectories(folder, sequences=sequences,) + with no_warning(UserWarning): + mda.Universe(utop._topology, fnames, continuous=True) + + def test_single_frames(self, tmpdir): + folder = str(tmpdir) + sequences = ([0, 1, 2, 3], [5, ]) + utop, fnames = build_trajectories(folder, sequences=sequences,) + with pytest.raises(RuntimeError): + mda.Universe(utop._topology, fnames, continuous=True) + + def test_mixed_filetypes(self): + with pytest.raises(ValueError): + mda.Universe(PDB, [XTC, TRR], continuous=True) + + def test_unsupported_filetypes(self): + with pytest.raises(NotImplementedError): + mda.Universe(PSF, [DCD, DCD], continuous=True) + + +@pytest.mark.parametrize('l, ref', ([((0, 3), (3, 3), (4, 7)), (0, 1, 2)], + [((0, 9), (0, 4)), (0, 1)], + [((0, 3), (2, 2), (3, 3), (2, 6), (5, 9)), (0, 1, 3, 2, 4)], + [((0, 2), (4, 9), (0, 4), (7, 9)), (0, 2, 1, 3)], + [((0, 5), (2, 4), (2, 4), (2, 4), (3, 7)), (0, 1, 2, 3, 4)] + )) +def test_multilevel_arg_sort(l, ref): + indices = mda.coordinates.chain.multi_level_argsort(l) + assert_equal(indices, ref) + + +@pytest.mark.parametrize('l, ref', ([((0, 4), (3, 6), (6, 9)), (0, 1, 2)], + [((0, 3), (3, 4), (4, 7)), (0, 1, 2)], + [((0, 3), (3, 5), (4, 7)), (0, 1, 2)], + [((0, 3), (0, 4), (3, 5), (4, 7)), (1, 2, 3)], + [((0, 3), (0, 4)), (1,)], + [((0, 3), (0, 3)), (1,)], + [((1, 3), (0, 4)), (0,)], + [((0, 3), ), (0, )], + [((0, 3), (5, 9)), (0, 1)], + [((0, 3), (0, 3), (5, 9)), (1, 2)], + [((0, 3), (0, 3), (0, 3), (5, 9)), (2, 3)], + [((0, 5), (2, 4), (2, 4), (2, 4), (3, 7)), (0, 3, 4)], + [((0, 3), (2, 4), (2, 4), (2, 4), (3, 7)), (0, 3, 4)], + [((0, 3), (2, 4), (4, 7), (4, 7), (4, 7), (6, 9)), (0, 1, 4, 5)], + [((0, 6), (2, 5), (2, 5), (2, 5), (3, 8)), (0, 3, 4)], + )) +def test_filter_times(l, ref): + indices = mda.coordinates.chain.filter_times(l, dt=1) + assert_equal(indices, ref) diff --git a/testsuite/MDAnalysisTests/coordinates/test_gro.py b/testsuite/MDAnalysisTests/coordinates/test_gro.py index 14e7199fab6..f0a7e5ef2fa 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_gro.py +++ b/testsuite/MDAnalysisTests/coordinates/test_gro.py @@ -23,6 +23,7 @@ import MDAnalysis as mda import numpy as np from MDAnalysis.coordinates.GRO import GROReader, GROWriter +from MDAnalysis.transformations import translate from MDAnalysisTests import make_Universe, tempdir from MDAnalysisTests.coordinates.base import ( BaseReference, BaseReaderTest, BaseWriterTest, BaseTimestepTest, @@ -290,6 +291,13 @@ def reader(ref): dt=ref.aux_highf_dt, initial_time=0, time_selector=None) return reader + + @staticmethod + @pytest.fixture(scope='class') + def transformed(ref): + transformed = ref.reader(ref.trajectory, convert_units=False) + transformed.add_transformations(translate([1,1,1]), translate([0,0,0.33])) + return transformed class TestGROWriterNoConversion(BaseWriterTest): diff --git a/testsuite/MDAnalysisTests/coordinates/test_gsd.py b/testsuite/MDAnalysisTests/coordinates/test_gsd.py index 320769e9abc..568b0d3e629 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_gsd.py +++ b/testsuite/MDAnalysisTests/coordinates/test_gsd.py @@ -27,12 +27,15 @@ from MDAnalysisTests.datafiles import GSD import MDAnalysis as mda +import os @pytest.fixture def GSD_U(): return mda.Universe(GSD) +@pytest.mark.skipif(os.name == 'nt', + reason="gsd not windows compatible") def test_gsd_positions(GSD_U): # first frame first particle ts = GSD_U.trajectory[0] @@ -43,14 +46,20 @@ def test_gsd_positions(GSD_U): assert_almost_equal(GSD_U.atoms.positions[0], [ -5.58348083, -9.98546982, -10.17657185]) +@pytest.mark.skipif(os.name == 'nt', + reason="gsd not windows compatible") def test_gsd_n_frames(GSD_U): assert len(GSD_U.trajectory) == 2 +@pytest.mark.skipif(os.name == 'nt', + reason="gsd not windows compatible") def test_gsd_dimensions(GSD_U): ts = GSD_U.trajectory[0] assert_almost_equal(ts.dimensions, [ 21.60000038,21.60000038,21.60000038,90.,90.,90.]) +@pytest.mark.skipif(os.name == 'nt', + reason="gsd not windows compatible") def test_gsd_data_step(GSD_U): assert GSD_U.trajectory[0].data['step'] == 0 assert GSD_U.trajectory[1].data['step'] == 500 diff --git a/testsuite/MDAnalysisTests/coordinates/test_lammps.py b/testsuite/MDAnalysisTests/coordinates/test_lammps.py index 93a47966705..6e2c89941db 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_lammps.py +++ b/testsuite/MDAnalysisTests/coordinates/test_lammps.py @@ -20,6 +20,10 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # from __future__ import absolute_import +from six.moves import zip + +import bz2 +import gzip import os import numpy as np import pytest @@ -34,7 +38,7 @@ RefLAMMPSData, RefLAMMPSDataMini, RefLAMMPSDataDCD, ) from MDAnalysisTests.datafiles import ( - LAMMPScnt, LAMMPShyd, LAMMPSdata, LAMMPSdata_mini + LAMMPScnt, LAMMPShyd, LAMMPSdata, LAMMPSdata_mini, LAMMPSDUMP ) @@ -275,11 +279,13 @@ def test_Writer_is_LAMMPS(self, u, tmpdir): def test_Writer(self, u, tmpdir, n_frames=3): ext = os.path.splitext(self.trajectory)[1] outfile = str(tmpdir.join('lammps-writer-test' + ext)) - W = mda.Writer(outfile, n_atoms=u.atoms.n_atoms, - format=self.format) - with u.trajectory.OtherWriter(outfile) as w: + + with mda.Writer(outfile, + n_atoms=u.atoms.n_atoms, + format=self.format) as w: for ts in u.trajectory[:n_frames]: w.write(ts) + short = mda.Universe(self.topology, outfile) assert_equal(short.trajectory.n_frames, n_frames, err_msg="number of frames mismatch") @@ -393,3 +399,98 @@ def test_write_non_numerical_types(self, tmpout): assert 'must be convertible to integers' in e.args[0] else: raise pytest.fail() + + +class TestLammpsDumpReader(object): + @pytest.fixture( + params=['ascii', 'bz2', 'gzip'] + ) + def u(self, tmpdir, request): + trjtype = request.param + if trjtype == 'bz2': + # no conversion needed + f = LAMMPSDUMP + else: + f = str(tmpdir.join('lammps.' + trjtype)) + with bz2.BZ2File(LAMMPSDUMP, 'rb') as datain: + data = datain.read() + if trjtype == 'ascii': + with open(f, 'wb') as fout: + fout.write(data) + elif trjtype == 'gzip': + with gzip.GzipFile(f, 'wb') as fout: + fout.write(data) + + yield mda.Universe(f, format='LAMMPSDUMP') + + @pytest.fixture() + def reference_positions(self): + # manually copied from traj file + data = {} + + # at timestep 500 + lo, hi = float(2.1427867124774069e-01), float(5.9857213287522608e+00) + length1 = hi - lo + # at timestep 1000 + lo, hi = float(-5.4458069063278991e-03), float(6.2054458069063330e+00) + length2 = hi - lo + boxes = [ + np.array([6.2, 6.2, 6.2, 90., 90., 90.]), + np.array([length1, length1, length1, 90., 90., 90.]), + np.array([length2, length2, length2, 90., 90., 90.]), + ] + data['box'] = boxes + + # data for atom id 1 in traj (ie first in frame) + # isn't sensitive to required sorting + atom1_pos1 = np.array([0.25, 0.25, 0.241936]) * boxes[0][:3] + atom1_pos2 = np.array([0.278215, 0.12611, 0.322087]) * boxes[1][:3] + atom1_pos3 = np.array([0.507123, 1.00424, 0.280972]) * boxes[2][:3] + data['atom1_pos'] = [atom1_pos1, atom1_pos2, atom1_pos3] + # data for atom id 13 + # *is* sensitive to reordering of positions + # normally appears 4th in traj data + atom13_pos1 = np.array([0.25, 0.25, 0.741936]) * boxes[0][:3] + atom13_pos2 = np.array([0.394618, 0.263115, 0.798295]) * boxes[1][:3] + atom13_pos3 = np.array([0.332363, 0.30544, 0.641589]) * boxes[2][:3] + data['atom13_pos'] = [atom13_pos1, atom13_pos2, atom13_pos3] + + return data + + def test_n_atoms(self, u): + assert len(u.atoms) == 24 + + def test_length(self, u): + assert len(u.trajectory) == 3 + for i, ts in enumerate(u.trajectory): + assert ts.frame == i + assert ts.data['step'] == i * 500 + for i, ts in enumerate(u.trajectory): + assert ts.frame == i + assert ts.data['step'] == i * 500 + + def test_seeking(self, u, reference_positions): + u.trajectory[1] + + assert_almost_equal(u.dimensions, reference_positions['box'][1], + decimal=5) + assert_almost_equal(u.atoms[0].position, + reference_positions['atom1_pos'][1], + decimal=5) + assert_almost_equal(u.atoms[12].position, + reference_positions['atom13_pos'][1], + decimal=5) + + def test_boxsize(self, u, reference_positions): + for ts, box in zip(u.trajectory, + reference_positions['box']): + assert_almost_equal(ts.dimensions, box, decimal=5) + + def test_atom_reordering(self, u, reference_positions): + atom1 = u.atoms[0] + atom13 = u.atoms[12] + for ts, atom1_pos, atom13_pos in zip(u.trajectory, + reference_positions['atom1_pos'], + reference_positions['atom13_pos']): + assert_almost_equal(atom1.position, atom1_pos, decimal=5) + assert_almost_equal(atom13.position, atom13_pos, decimal=5) diff --git a/testsuite/MDAnalysisTests/coordinates/test_memory.py b/testsuite/MDAnalysisTests/coordinates/test_memory.py index 49da54ae12c..0dfc0e643ef 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_memory.py +++ b/testsuite/MDAnalysisTests/coordinates/test_memory.py @@ -29,7 +29,7 @@ from MDAnalysisTests.coordinates.base import (BaseReference, MultiframeReaderTest) from MDAnalysis.coordinates.memory import Timestep -from numpy.testing import assert_equal +from numpy.testing import assert_equal, assert_almost_equal class MemoryReference(BaseReference): @@ -193,3 +193,184 @@ def test_float32(self, ref): coordinates = np.random.uniform(size=(100, ref.universe.atoms.n_atoms, 3)).cumsum(0) universe = mda.Universe(ref.universe.filename, coordinates, format=MemoryReader) assert_equal(universe.trajectory.get_array().dtype, np.dtype('float32')) + + def test_position_assignation(self, reader): + # When coordinates are assigned to a timestep, is the change persistent? + new_positions = np.ones_like(reader.ts.positions, dtype=np.float32) + reader.ts.positions = new_positions + reader[0] + assert_almost_equal(reader.ts.positions, new_positions) + + +class TestMemoryReaderVelsForces(object): + @staticmethod + @pytest.fixture(params=['2d', '3d']) + def ref_pos(request): + if request.param == '2d': + return np.arange(30).reshape(10, 3) + elif request.param == '3d': + return np.arange(30).reshape(1, 10, 3) + + @staticmethod + @pytest.fixture(params=['2d', '3d']) + def ref_vels(request): + if request.param == '2d': + return np.arange(30).reshape(10, 3) + 100 + elif request.param == '3d': + return np.arange(30).reshape(1, 10, 3) + 100 + + @staticmethod + @pytest.fixture(params=['2d', '3d']) + def ref_forces(request): + if request.param == '2d': + return np.arange(30).reshape(10, 3) + 1000 + elif request.param == '3d': + return np.arange(30).reshape(1, 10, 3) + 1000 + + @staticmethod + def assert_equal_dims(arr1, arr2): + if arr2.ndim == 3: + assert_equal(arr1, arr2[0]) + elif arr2.ndim == 2: + assert_equal(arr1, arr2) + + def test_velocities(self, ref_pos, ref_vels): + mr = MemoryReader(ref_pos, + velocities=ref_vels) + + assert mr.ts.has_velocities + self.assert_equal_dims(mr.ts.velocities, ref_vels) + assert not mr.ts.has_forces + + def test_forces(self, ref_pos, ref_forces): + mr = MemoryReader(ref_pos, + forces=ref_forces) + + assert not mr.ts.has_velocities + assert mr.ts.has_forces + self.assert_equal_dims(mr.ts.forces, ref_forces) + + def test_both(self, ref_pos, ref_vels, ref_forces): + mr = MemoryReader(ref_pos, + velocities=ref_vels, + forces=ref_forces) + assert mr.ts.has_velocities + self.assert_equal_dims(mr.ts.velocities, ref_vels) + assert mr.ts.has_forces + self.assert_equal_dims(mr.ts.forces, ref_forces) + + @pytest.mark.parametrize('param', ['velocities', 'forces']) + def test_wrongshape(self, ref_pos, param): + with pytest.raises(ValueError): + mr = MemoryReader(ref_pos, **{param: np.zeros((3, 2, 1))}) + + +class TestDimensions(object): + @staticmethod + @pytest.fixture + def ref_pos(): + return np.arange(270).reshape(3, 30, 3) + + @staticmethod + @pytest.fixture + def ref_box(): + return np.arange(18).reshape(3, 6) + + def test_single_box(self, ref_pos): + box = np.array([3, 4, 5, 90, 90, 90]) + + mr = MemoryReader(ref_pos, dimensions=box) + + for ts in mr: + assert_equal(ts.dimensions, box) + + def test_varying_box(self, ref_pos, ref_box): + mr = MemoryReader(ref_pos, dimensions=ref_box) + + for i, ts in enumerate(mr): + assert_equal(ts.dimensions, ref_box[i]) + + def test_wrong_length(self, ref_pos): + bad_box = np.arange(12).reshape(2, 6) + + with pytest.raises(ValueError): + mr = MemoryReader(ref_pos, dimensions=bad_box) + + def test_wrong_shape(self, ref_pos): + bad_box = np.arange(15).reshape(3, 5) + + with pytest.raises(ValueError): + mr = MemoryReader(ref_pos, dimensions=bad_box) + + +class TestMemoryReaderModifications(object): + # check that modifying MR things behaves as expected + # in general, modifying the Timestep should be *permanent* + # this is unlike other Readers! + n_atoms = 10 + n_frames = 4 + + @pytest.fixture() + def mr_reader(self): + pos = np.arange(self.n_frames * self.n_atoms * 3).reshape( + self.n_frames, self.n_atoms, 3) + vel = np.arange(self.n_frames * self.n_atoms * 3).reshape( + self.n_frames, self.n_atoms, 3) + 200 + frc = np.arange(self.n_frames * self.n_atoms * 3).reshape( + self.n_frames, self.n_atoms, 3) + 400 + box = np.arange(self.n_frames * 6).reshape(self.n_frames, 6) + 600 + + return MemoryReader(pos, + velocities=vel, + forces=frc, + dimensions=box) + + @pytest.fixture() + def mr_universe(self, mr_reader): + u = mda.Universe.empty(self.n_atoms) + u.trajectory = mr_reader + + return u + + @pytest.mark.parametrize('attr', ['positions', 'velocities', 'forces', 'dimensions']) + def test_copying(self, mr_reader, attr): + mr2 = mr_reader.copy() + # update the attribute + ts = mr2.ts + setattr(ts, attr, 7) + # check the change worked + assert_almost_equal(getattr(ts, attr), 7) + assert ts.positions.shape == (self.n_atoms, 3) + assert ts.velocities.shape == (self.n_atoms, 3) + assert ts.forces.shape == (self.n_atoms, 3) + assert ts.dimensions.shape == (6,) + # move the Reader around, forcing updates of ts + ts = mr2[2] + ts = mr2[0] + # check our old change is still there + assert_almost_equal(getattr(ts, attr), 7) + + @pytest.mark.parametrize('attr', ['positions', 'velocities', 'forces', 'dimensions']) + def test_attr_set(self, mr_universe, attr): + # same as above, but via a Universe/AtomGroup + u = mr_universe + ts = u.trajectory[0] + + setattr(ts, attr, 7) + + assert_almost_equal(getattr(ts, attr), 7) + + ts = u.trajectory[2] + ts = u.trajectory[0] + + assert_almost_equal(getattr(ts, attr), 7) + assert u.atoms.positions.shape == (self.n_atoms, 3) + assert u.atoms.velocities.shape == (self.n_atoms, 3) + assert u.atoms.forces.shape == (self.n_atoms, 3) + assert u.atoms.dimensions.shape == (6,) + + @pytest.mark.parametrize('attr', ['velocities', 'forces', 'dimensions']) + def test_non_numpy_arr(self, attr): + with pytest.raises(TypeError): + mr = MemoryReader(np.zeros((10, 30, 3)), + **{attr: 'not an array'}) diff --git a/testsuite/MDAnalysisTests/coordinates/test_pdb.py b/testsuite/MDAnalysisTests/coordinates/test_pdb.py index c06ba1e11bb..0cd1ca4d953 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_pdb.py +++ b/testsuite/MDAnalysisTests/coordinates/test_pdb.py @@ -149,117 +149,113 @@ def test_long_resSeq(self): assert_equal(u[4].resid, 10000, "can't read a five digit resid") -class TestPDBWriter(TestCase): - def setUp(self): - self.universe = mda.Universe(PSF, PDB_small) - self.universe2 = mda.Universe(PSF, DCD) - # 3 decimals in PDB spec - # http://www.wwpdb.org/documentation/format32/sect9.html#ATOM - self.prec = 3 - ext = ".pdb" - self.tmpdir = tempdir.TempDir() - self.outfile = self.tmpdir.name + '/primitive-pdb-writer' + ext - self.u_no_resnames = make_Universe(['names', 'resids'], - trajectory=True) - self.u_no_resids = make_Universe(['names', 'resnames'], - trajectory=True) - self.u_no_names = make_Universe(['resids', 'resnames'], - trajectory=True) +class TestPDBWriter(object): + # 3 decimals in PDB spec + # http://www.wwpdb.org/documentation/format32/sect9.html#ATOM + prec = 3 + ext = ".pdb" - def tearDown(self): - try: - os.unlink(self.outfile) - except OSError: - pass - del self.universe, self.universe2 - del self.u_no_resnames, self.u_no_resids, self.u_no_names - del self.tmpdir + @pytest.fixture + def universe(self): + return mda.Universe(PSF, PDB_small) + + @pytest.fixture + def universe2(self): + return mda.Universe(PSF, DCD) + + @pytest.fixture + def outfile(self, tmpdir): + return str(tmpdir.mkdir("PDBWriter").join('primitive-pdb-writer' + self.ext)) - def test_writer(self): + @pytest.fixture + def u_no_resnames(self): + return make_Universe(['names', 'resids'], trajectory=True) + + @pytest.fixture + def u_no_resids(self): + return make_Universe(['names', 'resnames'], trajectory=True) + + @pytest.fixture + def u_no_names(self): + return make_Universe(['resids', 'resnames'], trajectory=True) + + + def test_writer(self, universe, outfile): "Test writing from a single frame PDB file to a PDB file." "" - self.universe.atoms.write(self.outfile) - u = mda.Universe(PSF, self.outfile) + universe.atoms.write(outfile) + u = mda.Universe(PSF, outfile) assert_almost_equal(u.atoms.positions, - self.universe.atoms.positions, self.prec, + universe.atoms.positions, self.prec, err_msg="Writing PDB file with PDBWriter " "does not reproduce original coordinates") - - def test_writer_no_resnames(self): - self.u_no_resnames.atoms.write(self.outfile) - u = mda.Universe(self.outfile) - expected = np.array(['UNK'] * self.u_no_resnames.atoms.n_atoms) + def test_writer_no_resnames(self, u_no_resnames, outfile): + u_no_resnames.atoms.write(outfile) + u = mda.Universe(outfile) + expected = np.array(['UNK'] * u_no_resnames.atoms.n_atoms) assert_equal(u.atoms.resnames, expected) - - def test_writer_no_resids(self): - self.u_no_resids.atoms.write(self.outfile) - u = mda.Universe(self.outfile) + def test_writer_no_resids(self, u_no_resids, outfile): + u_no_resids.atoms.write(outfile) + u = mda.Universe(outfile) expected = np.ones((25,)) assert_equal(u.residues.resids, expected) - - def test_writer_no_atom_names(self): - self.u_no_names.atoms.write(self.outfile) - u = mda.Universe(self.outfile) - expected = np.array(['X'] * self.u_no_names.atoms.n_atoms) + def test_writer_no_atom_names(self, u_no_names, outfile): + u_no_names.atoms.write(outfile) + u = mda.Universe(outfile) + expected = np.array(['X'] * u_no_names.atoms.n_atoms) assert_equal(u.atoms.names, expected) - - def test_writer_no_altlocs(self): - self.u_no_names.atoms.write(self.outfile) - u = mda.Universe(self.outfile) - expected = np.array([''] * self.u_no_names.atoms.n_atoms) + def test_writer_no_altlocs(self, u_no_names, outfile): + u_no_names.atoms.write(outfile) + u = mda.Universe(outfile) + expected = np.array([''] * u_no_names.atoms.n_atoms) assert_equal(u.atoms.altLocs, expected) - - def test_writer_no_icodes(self): - self.u_no_names.atoms.write(self.outfile) - u = mda.Universe(self.outfile) - expected = np.array([''] * self.u_no_names.atoms.n_atoms) + def test_writer_no_icodes(self, u_no_names, outfile): + u_no_names.atoms.write(outfile) + u = mda.Universe(outfile) + expected = np.array([''] * u_no_names.atoms.n_atoms) assert_equal(u.atoms.icodes, expected) - - def test_writer_no_segids(self): - self.u_no_names.atoms.write(self.outfile) - u = mda.Universe(self.outfile) - expected = np.array(['SYSTEM'] * self.u_no_names.atoms.n_atoms) + def test_writer_no_segids(self, u_no_names, outfile): + u_no_names.atoms.write(outfile) + u = mda.Universe(outfile) + expected = np.array(['SYSTEM'] * u_no_names.atoms.n_atoms) assert_equal([atom.segid for atom in u.atoms], expected) - - def test_writer_no_occupancies(self): - self.u_no_names.atoms.write(self.outfile) - u = mda.Universe(self.outfile) - expected = np.ones(self.u_no_names.atoms.n_atoms) + def test_writer_no_occupancies(self, u_no_names, outfile): + u_no_names.atoms.write(outfile) + u = mda.Universe(outfile) + expected = np.ones(u_no_names.atoms.n_atoms) assert_equal(u.atoms.occupancies, expected) - - def test_writer_no_tempfactors(self): - self.u_no_names.atoms.write(self.outfile) - u = mda.Universe(self.outfile) - expected = np.zeros(self.u_no_names.atoms.n_atoms) + def test_writer_no_tempfactors(self, u_no_names, outfile): + u_no_names.atoms.write(outfile) + u = mda.Universe(outfile) + expected = np.zeros(u_no_names.atoms.n_atoms) assert_equal(u.atoms.tempfactors, expected) - def test_write_single_frame_Writer(self): + def test_write_single_frame_Writer(self, universe2, outfile): """Test writing a single frame from a DCD trajectory to a PDB using MDAnalysis.Writer (Issue 105)""" - u = self.universe2 - W = mda.Writer(self.outfile) + u = universe2 u.trajectory[50] - W.write(u.select_atoms('all')) - W.close() - u2 = mda.Universe(self.outfile) + with mda.Writer(outfile) as W: + W.write(u.select_atoms('all')) + u2 = mda.Universe(outfile) assert_equal(u2.trajectory.n_frames, 1, err_msg="The number of frames should be 1.") - def test_write_single_frame_AtomGroup(self): + def test_write_single_frame_AtomGroup(self, universe2, outfile): """Test writing a single frame from a DCD trajectory to a PDB using AtomGroup.write() (Issue 105)""" - u = self.universe2 + u = universe2 u.trajectory[50] - u.atoms.write(self.outfile) - u2 = mda.Universe(PSF, self.outfile) + u.atoms.write(outfile) + u2 = mda.Universe(PSF, outfile) assert_equal(u2.trajectory.n_frames, 1, err_msg="Output PDB should only contain a single frame") @@ -268,39 +264,35 @@ def test_write_single_frame_AtomGroup(self): "agree with original coordinates from frame %d" % u.trajectory.frame) - def test_check_coordinate_limits_min(self): + def test_check_coordinate_limits_min(self, universe, outfile): """Test that illegal PDB coordinates (x <= -999.9995 A) are caught with ValueError (Issue 57)""" - # modify coordinates so we need our own copy or we could mess up - # parallel tests - u = mda.Universe(PSF, PDB_small) + # modify coordinates (universe needs to be a per-function fixture) + u = universe u.atoms[2000].position = [0, -999.9995, 22.8] with pytest.raises(ValueError): - u.atoms.write(self.outfile) + u.atoms.write(outfile) - def test_check_coordinate_limits_max(self): + def test_check_coordinate_limits_max(self, universe, outfile): """Test that illegal PDB coordinates (x > 9999.9995 A) are caught with ValueError (Issue 57)""" - # modify coordinates so we need our own copy or we could mess up - # parallel tests - u = mda.Universe(PSF, PDB_small) + # modify coordinates (universe needs to be a per-function fixture) + u = universe # OB: 9999.99951 is not caught by '<=' ?!? u.atoms[1000].position = [90.889, 9999.9996, 12.2] with pytest.raises(ValueError): - u.atoms.write(self.outfile) - del u + u.atoms.write(outfile) - def test_check_header_title_multiframe(self): + def test_check_HEADER_TITLE_multiframe(self, universe2, outfile): """Check whether HEADER and TITLE are written just once in a multi- frame PDB file (Issue 741)""" - u = mda.Universe(PSF, DCD) - pdb = mda.Writer(self.outfile, multiframe=True) + u = universe2 protein = u.select_atoms("protein and name CA") - for ts in u.trajectory[:5]: - pdb.write(protein) - pdb.close() + with mda.Writer(outfile, multiframe=True) as pdb: + for ts in u.trajectory[:5]: + pdb.write(protein) - with open(self.outfile) as f: + with open(outfile) as f: got_header = 0 got_title = 0 for line in f: @@ -311,7 +303,40 @@ def test_check_header_title_multiframe(self): got_title += 1 assert got_title <= 1, "There should be only one TITLE." + @pytest.mark.parametrize("startframe,maxframes", + [(0, 12), (9997, 12)]) + def test_check_MODEL_multiframe(self, universe2, outfile, startframe, maxframes): + """Check whether MODEL number is in the right column (Issue #1950)""" + u = universe2 + protein = u.select_atoms("protein and name CA") + with mda.Writer(outfile, multiframe=True, start=startframe) as pdb: + for ts in u.trajectory[:maxframes]: + pdb.write(protein) + + def get_MODEL_lines(filename): + with open(filename) as pdb: + for line in pdb: + if line.startswith("MODEL"): + yield line + + MODEL_lines = list(get_MODEL_lines(outfile)) + + assert len(MODEL_lines) == maxframes + for model, line in enumerate(MODEL_lines, start=startframe+1): + # test that only the right-most 4 digits are stored (rest must be space) + # line[10:14] == '9999' or ' 1' + + # test appearance with white space + assert line[5:14] == "{0:>9d}".format(int(str(model)[-4:])) + + # test number (only last 4 digits) + assert int(line[10:14]) == model % 10000 + +@pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="PDB multiframe reading not yet supported " + "on Windows.") class TestMultiPDBReader(TestCase): def setUp(self): self.multiverse = mda.Universe(PDB_multiframe, @@ -383,22 +408,6 @@ def test_conect_bonds_conect(self): assert_equal(len(u1.atoms), 1890) assert_equal(len(u1.bonds), 1922) - def test_conect_bonds_all(self): - conect = self.conect - assert_equal(len(conect.atoms), 1890) - assert_equal(len(conect.bonds), 1922) - - with tempdir.in_tempdir(): - try: - outfile = 'pdb-connect-bonds.pdb' - self.conect.atoms.write(outfile, bonds="all") - u2 = mda.Universe(outfile, guess_bonds=True) - finally: - os.unlink(outfile) - assert_equal(len(u2.atoms), 1890) - assert_equal(len([b for b in u2.bonds if not b.is_guessed]), 1922) - - # assert_equal(len([b for b in conect.bonds if not b.is_guessed]), 1922) def test_numconnections(self): u = self.multiverse @@ -459,7 +468,25 @@ def helper(atoms, bonds): "the test reference; len(actual) is %d, len(desired) " "is %d" % (len(u._topology.bonds.values), len(desired))) +def test_conect_bonds_all(tmpdir): + conect = mda.Universe(CONECT, guess_bonds=True) + + assert_equal(len(conect.atoms), 1890) + assert_equal(len(conect.bonds), 1922) + + outfile = os.path.join(str(tmpdir), 'pdb-connect-bonds.pdb') + conect.atoms.write(outfile, bonds="all") + u2 = mda.Universe(outfile, guess_bonds=True) + assert_equal(len(u2.atoms), 1890) + assert_equal(len([b for b in u2.bonds if not b.is_guessed]), 1922) + + # assert_equal(len([b for b in conect.bonds if not b.is_guessed]), 1922) + +@pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="PDB multiframe reading not yet supported " + "on Windows.") class TestMultiPDBWriter(TestCase): def setUp(self): self.universe = mda.Universe(PSF, PDB_small) @@ -732,32 +759,18 @@ def test_uses_PDBReader(self): assert isinstance(self.universe.trajectory, PDBReader), "failed to choose PDBReader" -class TestPDBWriterOccupancies(TestCase): - """Tests for Issue #620""" - - def setUp(self): - self.tempdir = tempdir.TempDir() - self.outfile = self.tempdir.name + '/occ.pdb' - - def tearDown(self): - try: - os.unlink(self.outfile) - except OSError: - pass - del self.tempdir - del self.outfile - - def test_write_occupancies(self): - """Modify occupancies, write out the file and check""" - u = mda.Universe(PDB_small) +def test_write_occupancies(tmpdir): + """Tests for Issue #620 Modify occupancies, write out the file and check""" + u = mda.Universe(PDB_small) + u.atoms.occupancies = 0.12 - u.atoms.occupancies = 0.12 + outfile = str(tmpdir.join('occ.pdb')) - u.atoms.write(self.outfile) + u.atoms.write(outfile) - u2 = mda.Universe(self.outfile) + u2 = mda.Universe(outfile) - assert all(u2.atoms.occupancies == 0.12) + assert_array_almost_equal(u2.atoms.occupancies, 0.12) class TestWriterAlignments(object): diff --git a/testsuite/MDAnalysisTests/coordinates/test_reader_api.py b/testsuite/MDAnalysisTests/coordinates/test_reader_api.py index 840665d72d9..8552a7283fa 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_reader_api.py +++ b/testsuite/MDAnalysisTests/coordinates/test_reader_api.py @@ -22,6 +22,7 @@ from __future__ import absolute_import import numpy as np +from collections import OrderedDict from MDAnalysis.coordinates.base import ( Timestep, SingleFrameReaderBase, @@ -43,6 +44,7 @@ def __init__(self, filename, **kwargs): self.n_frames = 10 self.n_atoms = 10 self._auxs = {} + self._transformations = [] # ts isn't a real timestep, but just an integer # whose value represents the frame number (0 based) self.ts = Timestep(self.n_atoms) @@ -57,6 +59,10 @@ def _read_next_timestep(self): return self.ts def _read_frame(self, frame): + if frame < 0: + frame = self.n_frames + frame + if not (0 <= frame < self.n_frames): + raise IOError self.ts.frame = frame return self.ts @@ -147,6 +153,8 @@ class TestMultiFrameReader(_Multi): (2, 5, None), # start & end (None, None, 2), # set skip (None, None, -1), # backwards skip + (None, -1, -1), + (10, 0, -1), (0, 10, 1), (0, 10, 2), (None, 20, None), # end beyond real end @@ -162,7 +170,9 @@ class TestMultiFrameReader(_Multi): (1, 5, -1), # Stop less than start (-100, None, None), (100, None, None), # Outside of range of trajectory - (-2, 10, -2) + (-2, 10, -2), + (0, 0, 1), # empty + (10, 1, 2), # empty ]) def test_slice(self, start, stop, step, reader): """Compare the slice applied to trajectory, to slice of list""" @@ -185,7 +195,6 @@ def sl(): with pytest.raises(TypeError): sl() - @pytest.mark.parametrize('slice_cls', [list, np.array]) @pytest.mark.parametrize('sl', [ [0, 1, 4, 5], @@ -205,6 +214,85 @@ def test_getitem(self, slice_cls, sl, reader): assert_equal(res, ref) + @pytest.mark.parametrize('sl', [ + [0, 1, 2, 3], # ordered list of indices without duplicates + [1, 3, 4, 2, 9], # disordered list of indices without duplicates + [0, 1, 1, 2, 2, 2], # ordered list with duplicates + [-1, -2, 3, -1, 0], # disordered list with duplicates + [True, ] * 10, + [False, ] * 10, + [True, False, ] * 5, + slice(None, None, None), + slice(0, 10, 1), + slice(None, None, -1), + slice(10, 0, -1), + slice(2, 7, 2), + slice(7, 2, -2), + slice(7, 2, 1), # empty + slice(0, 0, 1), # empty + ]) + def test_getitem_len(self, sl, reader): + traj_iterable = reader[sl] + if not isinstance(sl, slice): + sl = np.array(sl) + ref = self.reference[sl] + assert len(traj_iterable) == len(ref) + + @pytest.mark.parametrize('iter_type', (list, np.array)) + def test_getitem_len_empty(self, reader, iter_type): + # Indexing a numpy array with an empty array tends to break. + traj_iterable = reader[iter_type([])] + assert len(traj_iterable) == 0 + + # All the sl1 slice must be 5 frames long so that the sl2 can be a mask + @pytest.mark.parametrize('sl1', [ + [0, 1, 2, 3, 4], + [1, 1, 1, 1, 1], + [True, False, ] * 5, + slice(None, None, 2), + slice(None, None, -2), + ]) + @pytest.mark.parametrize('sl2', [ + [0, -1, 2], + [-1,-1, -1], + [True, False, True, True, False], + np.array([True, False, True, True, False]), + slice(None, None, None), + slice(None, 3, None), + slice(4, 0, -1), + ]) + def test_double_getitem(self, sl1, sl2, reader): + traj_iterable = reader[sl1][sl2] + # Old versions of numpy do not behave the same when indexing with a + # list or with an array. + if not isinstance(sl1, slice): + sl1 = np.asarray(sl1) + if not isinstance(sl2, slice): + sl2 = np.asarray(sl2) + print(sl1, sl2, type(sl1), type(sl2)) + ref = self.reference[sl1][sl2] + res = [ts.frame for ts in traj_iterable] + assert_equal(res, ref) + assert len(traj_iterable) == len(ref) + + @pytest.mark.parametrize('sl1', [ + [0, 1, 2, 3, 4], + [1, 1, 1, 1, 1], + [True, False, ] * 5, + slice(None, None, 2), + slice(None, None, -2), + slice(None, None, None), + ]) + @pytest.mark.parametrize('idx2', [0, 2, 4, -1, -2, -4]) + def test_double_getitem_int(self, sl1, idx2, reader): + ts = reader[sl1][idx2] + # Old versions of numpy do not behave the same when indexing with a + # list or with an array. + if not isinstance(sl1, slice): + sl1 = np.asarray(sl1) + ref = self.reference[sl1][idx2] + assert ts.frame == ref + def test_list_TE(self, reader): def sl(): return list(reader[[0, 'a', 5, 6]]) @@ -212,7 +300,6 @@ def sl(): with pytest.raises(TypeError): sl() - def test_array_TE(self, reader): def sl(): return list(reader[np.array([1.2, 3.4, 5.6])]) @@ -220,6 +307,19 @@ def sl(): with pytest.raises(TypeError): sl() + @pytest.mark.parametrize('sl1', [ + [0, 1, 2, 3, 4], + [1, 1, 1, 1, 1], + [True, False, ] * 5, + slice(None, None, 2), + slice(None, None, -2), + ]) + @pytest.mark.parametrize('idx2', [5, -6]) + def test_getitem_IE(self, sl1, idx2, reader): + partial_reader = reader[sl1] + with pytest.raises(IndexError): + partial_reader[idx2] + class _Single(_TestReader): n_frames = 1 diff --git a/testsuite/MDAnalysisTests/coordinates/test_trz.py b/testsuite/MDAnalysisTests/coordinates/test_trz.py index c664a2f5671..47ada65b04e 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_trz.py +++ b/testsuite/MDAnalysisTests/coordinates/test_trz.py @@ -35,7 +35,6 @@ from MDAnalysisTests.coordinates.reference import RefTRZ from MDAnalysisTests.coordinates.base import BaseTimestepTest from MDAnalysisTests.datafiles import (TRZ_psf, TRZ, two_water_gro) -from MDAnalysisTests import tempdir class TestTRZReader(RefTRZ): @@ -120,27 +119,17 @@ def test_title(self, universe): assert_equal(self.ref_title, universe.trajectory.title, "wrong title in trz") - def test_get_writer(self, universe): - with tempdir.in_tempdir(): - self.outfile = 'test-trz-writer.trz' - W = universe.trajectory.Writer(self.outfile) + def test_get_writer(self, universe, tmpdir): + self.outfile = os.path.join(str(tmpdir), 'test-trz-writer.trz') + with universe.trajectory.Writer(self.outfile) as W: assert_equal(isinstance(W, mda.coordinates.TRZ.TRZWriter), True) assert_equal(W.n_atoms, universe.trajectory.n_atoms) - try: - os.unlink(self.outfile) - except OSError: - pass - - def test_get_writer_2(self, universe): - with tempdir.in_tempdir(): - self.outfile = 'test-trz-writer-1.trz' - W = universe.trajectory.Writer(self.outfile, n_atoms=100) + + def test_get_writer_2(self, universe, tmpdir): + self.outfile = os.path.join(str(tmpdir), 'test-trz-writer-1.trz') + with universe.trajectory.Writer(self.outfile, n_atoms=100) as W: assert_equal(isinstance(W, mda.coordinates.TRZ.TRZWriter), True) assert_equal(W.n_atoms, 100) - try: - os.unlink(self.outfile) - except OSError: - pass class TestTRZWriter(RefTRZ): @@ -203,12 +192,9 @@ class TestTRZWriter2(object): def u(self): return mda.Universe(two_water_gro) - def test_writer_trz_from_other(self, u): - with tempdir.in_tempdir(): - outfile = 'trz-writer-2.trz' - W = mda.coordinates.TRZ.TRZWriter(outfile, - n_atoms=len(u.atoms)) - + def test_writer_trz_from_other(self, u, tmpdir): + outfile = os.path.join(str(tmpdir), 'trz-writer-2.trz') + with mda.coordinates.TRZ.TRZWriter(outfile, len(u.atoms)) as W: W.write(u.trajectory.ts) W.close() diff --git a/testsuite/MDAnalysisTests/coordinates/test_txyz.py b/testsuite/MDAnalysisTests/coordinates/test_txyz.py index 6334352645d..8dd49ac8d7a 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_txyz.py +++ b/testsuite/MDAnalysisTests/coordinates/test_txyz.py @@ -23,8 +23,9 @@ import pytest from numpy.testing import assert_almost_equal +from six.moves import zip -from MDAnalysisTests.datafiles import TXYZ, ARC +from MDAnalysisTests.datafiles import TXYZ, ARC, ARC_PBC import MDAnalysis as mda @@ -39,6 +40,11 @@ def ARC_U(): return mda.Universe(ARC) +@pytest.fixture +def ARC_PBC_U(): + return mda.Universe(ARC_PBC) + + def test_txyz_positions(TXYZ_U): assert_almost_equal(TXYZ_U.atoms.positions[0], [-6.553398, -1.854369, 0.000000]) @@ -56,5 +62,19 @@ def test_arc_positions_frame_2(ARC_U): [-0.231579, -0.350841, -0.037475]) -def test_arc_traj_legnth(ARC_U): +def test_arc_traj_length(ARC_U): assert len(ARC_U.trajectory) == 2 + + +def test_arcpbc_traj_length(ARC_PBC_U): + assert len(ARC_PBC_U.trajectory) == 3 + + +def test_pbc_boxsize(ARC_PBC_U): + ref_dimensions=[[ 38.860761, 38.860761, 38.860761, 90.000000, 90.000000, 90.000000], + [ 39.860761, 39.860761, 39.860761, 90.000000, 90.000000, 90.000000], + [ 40.860761, 40.860761, 40.860761, 90.000000, 90.000000, 90.000000]] + + for ref_box, ts in zip(ref_dimensions, ARC_PBC_U.trajectory): + assert_almost_equal(ref_box, ts.dimensions, decimal=5) + diff --git a/testsuite/MDAnalysisTests/coordinates/test_xdr.py b/testsuite/MDAnalysisTests/coordinates/test_xdr.py index bd09cbb21fe..a82b3375bb8 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_xdr.py +++ b/testsuite/MDAnalysisTests/coordinates/test_xdr.py @@ -28,6 +28,7 @@ import numpy as np import os import shutil +import subprocess from numpy.testing import (assert_equal, assert_almost_equal) @@ -768,7 +769,14 @@ def test_unsupported_format(self, traj): def test_persistent_offsets_readonly(self, tmpdir): shutil.copy(self.filename, str(tmpdir)) - os.chmod(str(tmpdir), 0o555) + + if os.name == 'nt': + # Windows platform has a unique way to deny write access + subprocess.call("icacls {fname} /deny Users:W".format(fname=tmpdir), + shell=True) + else: + os.chmod(str(tmpdir), 0o555) + filename = str(tmpdir.join(os.path.basename(self.filename))) # try to write a offsets file self._reader(filename) diff --git a/testsuite/MDAnalysisTests/core/test_atomgroup.py b/testsuite/MDAnalysisTests/core/test_atomgroup.py index 063a097d689..f7195f8504e 100644 --- a/testsuite/MDAnalysisTests/core/test_atomgroup.py +++ b/testsuite/MDAnalysisTests/core/test_atomgroup.py @@ -30,10 +30,12 @@ from numpy.testing import ( assert_almost_equal, assert_equal, + assert_array_almost_equal, ) import MDAnalysis as mda -from MDAnalysis.lib import transformations +from MDAnalysis.exceptions import DuplicateWarning +from MDAnalysis.lib import distances, transformations from MDAnalysis.core.topologyobjects import ( Bond, Angle, @@ -56,6 +58,7 @@ def test_AtomGroupUniverse_usage_warning(self): with pytest.deprecated_call(): mda.core.AtomGroup.Universe(PSF, DCD) + class TestAtomGroupToTopology(object): """Test the conversion of AtomGroup to TopologyObjects""" @pytest.fixture() @@ -95,7 +98,7 @@ def test_VE(self, btype, u): class TestAtomGroupWriting(object): - + @pytest.fixture() def u(self): return mda.Universe(PSF, DCD) @@ -109,8 +112,7 @@ def test_write_no_args(self, u, tmpdir): name = path.splitext(path.basename(DCD))[0] assert_equal(files[0], "{}_0.pdb".format(name)) - - def test_raises(self, u, tmpdir): + def test_raises_unknown_format(self, u, tmpdir): with tmpdir.as_cwd(): with pytest.raises(ValueError): u.atoms.write('useless.format123') @@ -119,6 +121,83 @@ def test_write_coordinates(self, u, tmpdir): with tmpdir.as_cwd(): u.atoms.write("test.xtc") + @pytest.mark.parametrize('frames', ( + [4], + [2, 3, 3, 1], + slice(2, 6, 1), + )) + def test_write_frames(self, u, tmpdir, frames): + destination = str(tmpdir / 'test.dcd') + selection = u.trajectory[frames] + ref_positions = np.stack([ts.positions for ts in selection]) + u.atoms.write(destination, frames=frames) + + u_new = mda.Universe(destination) + new_positions = np.stack([ts.positions for ts in u_new.trajectory]) + + assert_array_almost_equal(new_positions, ref_positions) + + @pytest.mark.parametrize('frames', ( + [4], + [2, 3, 3, 1], + slice(2, 6, 1), + )) + def test_write_frame_iterator(self, u, tmpdir, frames): + destination = str(tmpdir / 'test.dcd') + selection = u.trajectory[frames] + ref_positions = np.stack([ts.positions for ts in selection]) + u.atoms.write(destination, frames=selection) + + u_new = mda.Universe(destination) + new_positions = np.stack([ts.positions for ts in u_new.trajectory]) + + assert_array_almost_equal(new_positions, ref_positions) + + @pytest.mark.parametrize('extension', ('xtc', 'dcd', 'pdb', 'xyz')) + def test_write_frame_none(self, u, tmpdir, extension): + destination = str(tmpdir / 'test.' + extension) + u.atoms.write(destination, frames=None) + u_new = mda.Universe(destination) + new_positions = np.stack([ts.positions for ts in u_new.trajectory]) + # Most format only save 3 decimals; XTC even has only 2. + assert_array_almost_equal( + u.atoms.positions[None, ...], new_positions, decimal=2 + ) + + def test_write_frames_all(self, u, tmpdir): + destination = str(tmpdir / 'test.dcd') + u.atoms.write(destination, frames='all') + u_new = mda.Universe(destination) + ref_positions = np.stack([ts.positions for ts in u.trajectory]) + new_positions = np.stack([ts.positions for ts in u_new.trajectory]) + assert_array_almost_equal(new_positions, ref_positions) + + @pytest.mark.parametrize('frames', ('invalid', 8, True, False, 3.2)) + def test_write_frames_invalid(self, u, tmpdir, frames): + destination = str(tmpdir / 'test.dcd') + with pytest.raises(TypeError): + u.atoms.write(destination, frames=frames) + + def test_incompatible_arguments(self, u, tmpdir): + destination = str(tmpdir / 'test.dcd') + with pytest.raises(ValueError): + u.atoms.write(destination, frames=[0, 1, 2], multiframe=False) + + def test_incompatible_trajectories(self, tmpdir): + destination = str(tmpdir / 'test.dcd') + u1 = make_Universe(trajectory=True) + u2 = make_Universe(trajectory=True) + destination = str(tmpdir / 'test.dcd') + with pytest.raises(ValueError): + u1.atoms.write(destination, frames=u2.trajectory) + + def test_write_no_traj_move(self, u, tmpdir): + destination = str(tmpdir / 'test.dcd') + u.trajectory[10] + u.atoms.write(destination, frames=[1, 2, 3]) + assert u.trajectory.ts.frame == 10 + + def test_write_selection(self, u, tmpdir): with tmpdir.as_cwd(): u.atoms.write("test.vmd") @@ -136,11 +215,10 @@ class _WriteAtoms(object): ext = None # override to test various output writers precision = 3 - @pytest.fixture() def universe(self): return mda.Universe(PSF, DCD) - + @pytest.fixture() def outfile(self, tmpdir): return str(tmpdir) + "writeatoms." + self.ext @@ -238,15 +316,15 @@ def test_flag_convert_length(self): class TestAtomGroupTransformations(object): - + @pytest.fixture() def u(self): return mda.Universe(PSF, DCD) - + @pytest.fixture() def coords(self, u): return u.atoms.positions.copy() - + @pytest.fixture() def center_of_geometry(self, u): return u.atoms.center_of_geometry() @@ -369,7 +447,7 @@ def test_transform_translation_and_rotation(self, u): class TestCenter(object): - + @pytest.fixture() def ag(self): u = make_Universe(trajectory=True) @@ -387,6 +465,15 @@ def test_center_2(self, ag): assert_almost_equal(ag.center(weights), ag.positions[:4].mean(axis=0)) + def test_center_duplicates(self, ag): + weights = np.ones(ag.n_atoms) + weights[0] = 2. + ref = ag.center(weights) + ag2 = ag + ag[0] + with pytest.warns(DuplicateWarning): + ctr = ag2.center(None) + assert_almost_equal(ctr, ref, decimal=6) + def test_center_wrong_length(self, ag): weights = np.ones(ag.n_atoms + 4) with pytest.raises(ValueError): @@ -400,10 +487,11 @@ def test_center_wrong_shape(self, ag): class TestSplit(object): + @pytest.fixture() def universe(self): return mda.Universe(PSF, DCD) - + def test_split_atoms(self, universe): ag = universe.select_atoms("resid 1:50 and not resname LYS and " "(name CA or name CB)") @@ -435,7 +523,7 @@ def test_split_segments(self, universe): assert len(sg) == len(ag.segments.segids) for g, ref_segname in zip(sg, ag.segments.segids): for atom in g: - assert_equal(atom.segid, ref_segname) + assert_equal(atom.segid, ref_segname) def test_split_VE(self, universe): ag = universe.atoms[:40] @@ -445,11 +533,11 @@ def test_split_VE(self, universe): class TestWrap(object): - + @pytest.fixture() def u(self): return mda.Universe(TRZ_psf, TRZ) - + @pytest.fixture() def ag(self, u): return u.atoms[:100] @@ -518,6 +606,7 @@ class TestAtomGroupProperties(object): - getting properties from AG matches the Atom values - setting properties from AG changes the Atom - setting the property on Atom changes AG + - _unique_restore_mask works correctly """ @staticmethod def get_new(att_type): @@ -570,6 +659,38 @@ def test_atom_check_ag(self, att, atts, ag, att_type): assert_equal(vals, other, err_msg="Change to Atoms not reflected in AtomGroup for property: {0}".format(att)) + def test_ag_unique_restore_mask(self, ag): + # assert that ag is unique: + assert ag.isunique + # assert restore mask cache is empty: + with pytest.raises(KeyError): + _ = ag._cache['unique_restore_mask'] + # access unique property: + uag = ag.unique + # assert restore mask cache is still empty since ag is unique: + with pytest.raises(KeyError): + _ = ag._cache['unique_restore_mask'] + # make sure that accessing the restore mask of the unique AtomGroup + # raises a RuntimeError: + with pytest.raises(RuntimeError): + _ = ag._unique_restore_mask + + # add duplicate atoms: + ag += ag + # assert that ag is not unique: + assert not ag.isunique + # assert cache is empty: + with pytest.raises(KeyError): + _ = ag._cache['unique_restore_mask'] + # access unique property: + uag = ag.unique + # check if caching works as expected: + assert ag._cache['unique_restore_mask'] is ag._unique_restore_mask + # assert that restore mask cache of ag.unique hasn't been set: + with pytest.raises(RuntimeError): + _ = ag.unique._unique_restore_mask + # assert restore mask can reproduce original ag: + assert ag.unique[ag._unique_restore_mask] == ag class TestOrphans(object): """Test moving Universes out of scope and having A/AG persist @@ -716,8 +837,9 @@ def test_chi1_nodep(self, PSFDCD): class TestPBCFlag(object): + prec = 3 - + @pytest.fixture() def ref_noPBC(self): return { @@ -737,7 +859,7 @@ def ref_noPBC(self): [0.40611024, 0.45112859, 0.7947059], [0.46294889, -0.85135849, 0.24671249]]) } - + @pytest.fixture() def ref_PBC(self): return { @@ -758,16 +880,11 @@ def ref_PBC(self): [-0.07520116, -0.96394227, 0.25526473], [-0.50622389, -0.18364489, -0.84262206]]) } - + @pytest.fixture() def ag(self): universe = mda.Universe(TRZ_psf, TRZ) return universe.residues[0:3] - - - def test_flag(self): - # Test default setting of flag - assert mda.core.flags['use_pbc'] is False def test_default(self, ag, ref_noPBC): # Test regular behaviour @@ -783,7 +900,7 @@ def test_default(self, ag, ref_noPBC): assert_almost_equal(ag.principal_axes(), ref_noPBC['PAxes'], self.prec) def test_pbcflag(self, ag, ref_PBC): - # Test using ag method flag + # Test using pbc keyword assert_almost_equal(ag.center_of_geometry(pbc=True), ref_PBC['COG'], self.prec) assert_almost_equal(ag.center_of_mass(pbc=True), ref_PBC['COM'], self.prec) assert_almost_equal(ag.radius_of_gyration(pbc=True), ref_PBC['ROG'], self.prec) @@ -795,36 +912,6 @@ def test_pbcflag(self, ag, ref_PBC): assert_almost_equal(ag.bsphere(pbc=True)[1], ref_PBC['BSph'][1], self.prec) assert_almost_equal(ag.principal_axes(pbc=True), ref_PBC['PAxes'], self.prec) - def test_usepbc_flag(self, ag, ref_PBC): - # Test using the core.flags flag - mda.core.flags['use_pbc'] = True - assert_almost_equal(ag.center_of_geometry(), ref_PBC['COG'], self.prec) - assert_almost_equal(ag.center_of_mass(), ref_PBC['COM'], self.prec) - assert_almost_equal(ag.radius_of_gyration(), ref_PBC['ROG'], self.prec) - assert_almost_equal(ag.shape_parameter(), ref_PBC['Shape'], self.prec) - assert_almost_equal(ag.asphericity(), ref_PBC['Asph'], self.prec) - assert_almost_equal(ag.moment_of_inertia(), ref_PBC['MOI'], self.prec) - assert_almost_equal(ag.bbox(), ref_PBC['BBox'], self.prec) - assert_almost_equal(ag.bsphere()[0], ref_PBC['BSph'][0], self.prec) - assert_almost_equal(ag.bsphere()[1], ref_PBC['BSph'][1], self.prec) - assert_almost_equal(ag.principal_axes(), ref_PBC['PAxes'], self.prec) - mda.core.flags['use_pbc'] = False - - def test_override_flag(self, ag, ref_noPBC): - # Test using the core.flags flag, then overriding - mda.core.flags['use_pbc'] = True - assert_almost_equal(ag.center_of_geometry(pbc=False), ref_noPBC['COG'], self.prec) - assert_almost_equal(ag.center_of_mass(pbc=False), ref_noPBC['COM'], self.prec) - assert_almost_equal(ag.radius_of_gyration(pbc=False), ref_noPBC['ROG'], self.prec) - assert_almost_equal(ag.shape_parameter(pbc=False), ref_noPBC['Shape'], self.prec) - assert_almost_equal(ag.asphericity(pbc=False), ref_noPBC['Asph'], self.prec) - assert_almost_equal(ag.moment_of_inertia(pbc=False), ref_noPBC['MOI'], self.prec) - assert_almost_equal(ag.bbox(pbc=False), ref_noPBC['BBox'], self.prec) - assert_almost_equal(ag.bsphere(pbc=False)[0], ref_noPBC['BSph'][0], self.prec) - assert_almost_equal(ag.bsphere(pbc=False)[1], ref_noPBC['BSph'][1], self.prec) - assert_almost_equal(ag.principal_axes(pbc=False), ref_noPBC['PAxes'], self.prec) - mda.core.flags['use_pbc'] = False - def test_instantselection_termini(): """Test that instant selections work, even for residues that are also termini (Issue 70)""" @@ -840,15 +927,15 @@ class TestAtomGroup(object): There is likely lots of duplication between here and other tests. """ dih_prec = 2 - + @pytest.fixture() def universe(self): return mda.Universe(PSF, DCD) - + @pytest.fixture() def ag(self, universe): return universe.atoms - + def test_getitem_int(self, universe): assert_equal(universe.atoms[0].ix, universe.atoms.ix[0]) @@ -899,11 +986,63 @@ def test_len(self, ag): def test_center_of_geometry(self, ag): assert_almost_equal(ag.center_of_geometry(), - np.array([-0.04223963, 0.0141824, -0.03505163], dtype=np.float32)) + [-0.04223963, 0.0141824, -0.03505163], decimal=5) + + def test_center_of_geometry_duplicates(self, ag): + ag2 = ag + ag[0] + ref = ag.center_of_geometry() + with pytest.warns(DuplicateWarning) as w: + assert not np.allclose(ag2.center_of_geometry(), ref) + assert len(w) == 1 def test_center_of_mass(self, ag): assert_almost_equal(ag.center_of_mass(), - np.array([-0.01094035, 0.05727601, -0.12885778])) + [-0.01094035, 0.05727601, -0.12885778], decimal=5) + + def test_center_of_mass_duplicates(self, ag): + ag2 = ag + ag[0] + ref = ag.center_of_mass() + with pytest.warns(DuplicateWarning) as w: + assert not np.allclose(ag2.center_of_mass(), ref) + assert len(w) == 1 + + @pytest.mark.parametrize('name, compound', (('resids', 'residues'), + ('segids', 'segments'))) + def test_center_of_geometry_compounds(self, ag, name, compound): + ref = [a.center_of_geometry() for a in ag.groupby(name).values()] + cog = ag.center_of_geometry(compound=compound) + assert_almost_equal(cog, ref, decimal=5) + + @pytest.mark.parametrize('name, compound', (('resids', 'residues'), + ('segids', 'segments'))) + def test_center_of_mass_compounds(self, ag, name, compound): + ref = [a.center_of_mass() for a in ag.groupby(name).values()] + com = ag.center_of_mass(compound=compound) + assert_almost_equal(com, ref, decimal=5) + + @pytest.mark.parametrize('name, compound', (('resids', 'residues'), + ('segids', 'segments'))) + def test_center_of_geometry_compounds_pbc(self, ag, name, compound): + ag.dimensions = [50, 50, 50, 90, 90, 90] + ref = [a.center_of_geometry() for a in ag.groupby(name).values()] + ref = distances.apply_PBC(np.asarray(ref, dtype=np.float32), + ag.dimensions) + cog = ag.center_of_geometry(pbc=True, compound=compound) + assert_almost_equal(cog, ref, decimal=5) + + @pytest.mark.parametrize('name, compound', (('resids', 'residues'), + ('segids', 'segments'))) + def test_center_of_mass_compounds_pbc(self, ag, name, compound): + ag.dimensions = [50, 50, 50, 90, 90, 90] + ref = [a.center_of_mass() for a in ag.groupby(name).values()] + ref = distances.apply_PBC(np.asarray(ref, dtype=np.float32), + ag.dimensions) + com = ag.center_of_mass(pbc=True, compound=compound) + assert_almost_equal(com, ref, decimal=5) + + def test_center_wrong_compound(self, ag): + with pytest.raises(ValueError): + ag.center(weights=None, compound="foo") def test_coordinates(self, ag): assert_almost_equal( @@ -922,12 +1061,49 @@ def test_principal_axes(self, ag): [1.20986911e-02, 9.98951474e-01, -4.41539838e-02], [-9.99925632e-01, 1.21546132e-02, 9.98264877e-04],])) + def test_principal_axes_duplicates(self, ag): + ag2 = ag + ag[0] + ref = ag.principal_axes() + with pytest.warns(DuplicateWarning) as w: + assert not np.allclose(ag2.principal_axes(), ref) + assert len(w) == 1 + + def test_moment_of_inertia_duplicates(self, universe): + ag = universe.select_atoms('segid 4AKE') + ag2 = ag + ag[0] + ref = ag.moment_of_inertia() + with pytest.warns(DuplicateWarning) as w: + assert not np.allclose(ag2.moment_of_inertia(), ref) + assert len(w) == 1 + + def test_radius_of_gyration_duplicates(self, universe): + ag = universe.select_atoms('segid 4AKE') + ag2 = ag + ag[0] + ref = ag.radius_of_gyration() + with pytest.warns(DuplicateWarning) as w: + assert not np.allclose(ag2.radius_of_gyration(), ref) + assert len(w) == 1 + def test_total_charge(self, ag): assert_almost_equal(ag.total_charge(), -4.0, decimal=4) + def test_total_charge_duplicates(self, ag): + ag2 = ag + ag[0] + ref = ag.total_charge() + ag[0].charge + with pytest.warns(DuplicateWarning) as w: + assert_almost_equal(ag2.total_charge(), ref) + assert len(w) == 1 + def test_total_mass(self, ag): assert_almost_equal(ag.total_mass(), 23582.043) + def test_total_mass_duplicates(self, ag): + ag2 = ag + ag[0] + ref = ag.total_mass() + ag[0].mass + with pytest.warns(DuplicateWarning) as w: + assert_almost_equal(ag2.total_mass(), ref) + assert len(w) == 1 + def test_indices_ndarray(self, ag): assert isinstance(ag.indices, np.ndarray) @@ -1025,6 +1201,7 @@ def test_packintobox_badshape(self, universe): def test_packintobox_noshape(self, universe): ag = universe.atoms[:10] + ag.dimensions = np.zeros(6) with pytest.raises(ValueError): ag.pack_into_box() @@ -1034,20 +1211,26 @@ def test_packintobox(self, universe): Reference system doesn't have dimensions, so an arbitrary box is imposed on the system - """ u = universe u.trajectory.rewind() # just to make sure... ag = u.atoms[1000:2000:200] # Provide arbitrary box - ag.pack_into_box(box=np.array([5., 5., 5.], dtype=np.float32)) - assert_almost_equal( - ag.positions, - np.array([[3.94543672, 2.5939188, 2.73179913], - [3.21632767, 0.879035, 0.32085133], - [2.07735443, 0.99395466, 4.09301519], - [1.35541916, 2.0690732, 4.67488003], - [1.73236561, 4.90658951, 0.6880455]], dtype=np.float32)) + box = np.array([5., 5., 5., 90., 90., 90.], dtype=np.float32) + # Expected folded coordinates + packed_coords = np.array([[3.94543672, 2.5939188, 2.73179913], + [3.21632767, 0.879035, 0.32085133], + [2.07735443, 0.99395466, 4.09301519], + [1.35541916, 2.0690732, 4.67488003], + [1.73236561, 4.90658951, 0.6880455]], + dtype=np.float32) + ag.pack_into_box(box=box) + assert_almost_equal(ag.positions, packed_coords) + # Check with duplicates: + ag += ag + ag.pack_into_box(box=box) + assert_almost_equal(ag.positions, + np.vstack((packed_coords, packed_coords))) def test_residues(self, universe): u = universe @@ -1173,10 +1356,26 @@ def test_shape_parameter(self, universe): s = universe.select_atoms('segid 4AKE').shape_parameter() assert_almost_equal(s, 0.00240753939086033, 6) + def test_shape_parameter_duplicates(self, universe): + ag = universe.select_atoms('segid 4AKE') + ag2 = ag + ag[0] + ref = ag.shape_parameter() + with pytest.warns(DuplicateWarning) as w: + assert not np.allclose(ag2.shape_parameter(), ref) + assert len(w) == 1 + def test_asphericity(self, universe): a = universe.select_atoms('segid 4AKE').asphericity() assert_almost_equal(a, 0.020227504542775828, 6) + def test_asphericity_duplicates(self, universe): + ag = universe.select_atoms('segid 4AKE') + ag2 = ag + ag[0] + ref = ag.asphericity() + with pytest.warns(DuplicateWarning) as w: + assert not np.allclose(ag2.asphericity(), ref) + assert len(w) == 1 + def test_positions(self, universe): ag = universe.select_atoms("bynum 12:42") pos = ag.positions + 3.14 diff --git a/testsuite/MDAnalysisTests/core/test_atomselections.py b/testsuite/MDAnalysisTests/core/test_atomselections.py index 3a167a1a52d..952469ce3f4 100644 --- a/testsuite/MDAnalysisTests/core/test_atomselections.py +++ b/testsuite/MDAnalysisTests/core/test_atomselections.py @@ -23,6 +23,7 @@ from six.moves import range +import os import itertools import numpy as np from numpy.testing import( @@ -80,7 +81,10 @@ def test_protein_resnames(self, resname): u = make_Universe(('resnames',)) # set half the residues' names to the resname we're testing myprot = u.residues[::2] - myprot.resnames = resname + # Windows note: the parametrized test input string objects + # are actually of type 'numpy.str_' and coercion to str + # proper is needed for unit test on Windows + myprot.resnames = str(resname) # select protein sel = u.select_atoms('protein') # check that contents (atom indices) are identical afterwards @@ -340,6 +344,9 @@ def test_type(self, universe): assert_equal(sel.names, ['HH31', 'HH32', 'HH33', 'HB1', 'HB2', 'HB3']) +@pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Not supported on Windows yet.") class TestSelectionsNAMD(object): @pytest.fixture() def universe(self): @@ -489,31 +496,14 @@ class BaseDistanceSelection(object): Cylindrical methods don't use KDTree """ - - methods = [('kdtree', False), - ('kdtree', True), - ('distmat', True), - ('distmat', False)] - - @staticmethod - def choosemeth(sel, meth, periodic): - """hack in the desired apply method""" - if meth == 'kdtree': - sel.apply = sel._apply_KDTree - elif meth == 'distmat': - sel.apply = sel._apply_distmat - + @pytest.mark.parametrize('periodic', (True, False)) + def test_around(self, u, periodic): + sel = Parser.parse('around 5.0 resid 1', u.atoms) if periodic: sel.periodic = True else: sel.periodic = False - return sel - - @pytest.mark.parametrize('meth, periodic', methods) - def test_around(self, u, meth, periodic): - sel = Parser.parse('around 5.0 resid 1', u.atoms) - sel = self.choosemeth(sel, meth, periodic) result = sel.apply(u.atoms) r1 = u.select_atoms('resid 1') @@ -528,38 +518,49 @@ def test_around(self, u, meth, periodic): ref.difference_update(set(r1.indices)) assert ref == set(result.indices) - @pytest.mark.parametrize('meth, periodic', methods) - def test_spherical_layer(self, u, meth, periodic): + @pytest.mark.parametrize('periodic', (True, False)) + def test_spherical_layer(self, u, periodic): sel = Parser.parse('sphlayer 2.4 6.0 resid 1', u.atoms) - sel = self.choosemeth(sel, meth, periodic) + if periodic: + sel.periodic = True + else: + sel.periodic = False + result = sel.apply(u.atoms) r1 = u.select_atoms('resid 1') box = u.dimensions if periodic else None - cog = r1.center_of_geometry(pbc=periodic).reshape(1, 3) + cog = r1.center_of_geometry().reshape(1, 3) d = distance_array(u.atoms.positions, cog, box=box) ref = set(np.where((d > 2.4) & (d < 6.0))[0]) assert ref == set(result.indices) - @pytest.mark.parametrize('meth, periodic', methods) - def test_spherical_zone(self, u, meth, periodic): + @pytest.mark.parametrize('periodic', (True, False)) + def test_spherical_zone(self, u, periodic): sel = Parser.parse('sphzone 5.0 resid 1', u.atoms) - sel = self.choosemeth(sel, meth, periodic) + if periodic: + sel.periodic = True + else: + sel.periodic = False + result = sel.apply(u.atoms) r1 = u.select_atoms('resid 1') box = u.dimensions if periodic else None - cog = r1.center_of_geometry(pbc=periodic).reshape(1, 3) + cog = r1.center_of_geometry().reshape(1, 3) d = distance_array(u.atoms.positions, cog, box=box) ref = set(np.where(d < 5.0)[0]) assert ref == set(result.indices) - @pytest.mark.parametrize('meth, periodic', methods) - def test_point(self, u, meth, periodic): + @pytest.mark.parametrize('periodic', (True, False)) + def test_point(self, u, periodic): sel = Parser.parse('point 5.0 5.0 5.0 3.0', u.atoms) - sel = self.choosemeth(sel, meth, periodic) + if periodic: + sel.periodic = True + else: + sel.periodic = False result = sel.apply(u.atoms) box = u.dimensions if periodic else None @@ -602,6 +603,12 @@ def test_cyzone(self, u, meth, periodic): assert ref == set(result.indices) + @pytest.mark.parametrize('periodic,expected', ([True, 33], [False, 25])) + def test_sphzone(self, u, periodic, expected): + sel = u.select_atoms('sphzone 5.0 resid 1', periodic=periodic) + + assert len(sel) == expected + class TestTriclinicDistanceSelections(BaseDistanceSelection): @pytest.fixture() @@ -1019,3 +1026,9 @@ def test_missing_icodes_range_VE(self, u): u = make_Universe(('resids',)) with pytest.raises(ValueError): u.select_atoms('resid 10A-12') + + +def test_arbitrary_atom_group_raises_error(): + u = make_Universe(trajectory=True) + with pytest.raises(TypeError): + u.select_atoms('around 2.0 group this', this=u.atoms[0]) diff --git a/testsuite/MDAnalysisTests/core/test_copying.py b/testsuite/MDAnalysisTests/core/test_copying.py index 84e60be555d..3a886135aab 100644 --- a/testsuite/MDAnalysisTests/core/test_copying.py +++ b/testsuite/MDAnalysisTests/core/test_copying.py @@ -203,4 +203,3 @@ def test_change_topology(self, refUniverse): assert new.atoms[0].name == previous assert refUniverse.atoms[0].name == 'newname' - diff --git a/testsuite/MDAnalysisTests/core/test_flag_deprecations.py b/testsuite/MDAnalysisTests/core/test_flag_deprecations.py new file mode 100644 index 00000000000..33825a49b0d --- /dev/null +++ b/testsuite/MDAnalysisTests/core/test_flag_deprecations.py @@ -0,0 +1,37 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +from __future__ import absolute_import, division + +import pytest + +import MDAnalysis as mda + + +@pytest.mark.parametrize('flag', ['use_pbc', 'use_periodic_selections', + 'use_KDTree_routines', 'convert_lengths', + 'length_unit', 'speed_unit', 'force_unit', + 'charge_unit', 'time_unit']) +def test_flag_deprecation(flag): + curr = mda.core.flags[flag] + + with pytest.warns(DeprecationWarning): + mda.core.flags[flag] = curr diff --git a/testsuite/MDAnalysisTests/core/test_fragments.py b/testsuite/MDAnalysisTests/core/test_fragments.py index 7625355d7a9..bcb19ae2280 100644 --- a/testsuite/MDAnalysisTests/core/test_fragments.py +++ b/testsuite/MDAnalysisTests/core/test_fragments.py @@ -28,11 +28,13 @@ ) import pytest +import MDAnalysis as mda from MDAnalysis.core.topologyattrs import Bonds from MDAnalysis.core import groups from MDAnalysis import NoDataError from MDAnalysisTests import make_Universe +from MDAnalysisTests.datafiles import TPR, XTC # Also used in topology/test_guessers @@ -175,3 +177,9 @@ def test_atom_fragment_nobonds_NDE(self): u = make_Universe() with pytest.raises(NoDataError): getattr(u.atoms[10], 'fragment') + + +def test_tpr_fragments(): + frags = mda.Universe(TPR, XTC).atoms.fragments + + assert len(frags[0]) == 3341 diff --git a/testsuite/MDAnalysisTests/core/test_groups.py b/testsuite/MDAnalysisTests/core/test_groups.py index 48cca68a7e0..b1ef21daf1e 100644 --- a/testsuite/MDAnalysisTests/core/test_groups.py +++ b/testsuite/MDAnalysisTests/core/test_groups.py @@ -19,7 +19,7 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -from __future__ import absolute_import +from __future__ import absolute_import, division from six.moves import range @@ -40,7 +40,7 @@ class TestGroupProperties(object): - """ Test attributes of all groups + """ Test attributes common to all groups """ @pytest.fixture() def u(self): @@ -54,6 +54,8 @@ def group_dict(self, u): 'segment': u.segments } + uni = make_Universe() # can't use fixtures in @pytest.mark.parametrize + def test_dimensions(self, u, group_dict): dimensions = np.arange(6) @@ -61,6 +63,79 @@ def test_dimensions(self, u, group_dict): group.dimensions = dimensions.copy() assert_array_equal(group.dimensions, dimensions) assert_equal(u.dimensions, group.dimensions) + + @pytest.mark.parametrize('group', (uni.atoms[:2], uni.residues[:2], + uni.segments[:2])) + def test_group_isunique(self, group): + assert len(group) == 2 + # Initially, cache must be empty: + with pytest.raises(KeyError): + _ = group._cache['isunique'] + # Check for correct value and type: + assert group.isunique is True + # Check if cache is set correctly: + assert group._cache['isunique'] is True + + # Add duplicate element to group: + group += group[0] + assert len(group) == 3 + # Cache must be reset since the group changed: + with pytest.raises(KeyError): + _ = group._cache['isunique'] + # Check for correct value and type: + assert group.isunique is False + # Check if cache is set correctly: + assert group._cache['isunique'] is False + + #Check empty group: + group = group[[]] + assert len(group) == 0 + # Cache must be empty: + with pytest.raises(KeyError): + _ = group._cache['isunique'] + # Check for correct value and type: + assert group.isunique is True + # Check if cache is set correctly: + assert group._cache['isunique'] is True + + @pytest.mark.parametrize('group', (uni.atoms[:2], uni.residues[:2], + uni.segments[:2])) + def test_group_unique(self, group): + # check unique group: + assert len(group) == 2 + # assert caches are empty: + with pytest.raises(KeyError): + _ = group._cache['isunique'] + with pytest.raises(KeyError): + _ = group._cache['unique'] + # assert that group.unique of the unique group references itself: + assert group.unique is group + # check if caches have been set: + assert group._cache['isunique'] is True + assert group._cache['unique'] is group + # add duplicate element to group: + group += group[0] + assert len(group) == 3 + # assert caches are cleared since the group changed: + with pytest.raises(KeyError): + _ = group._cache['isunique'] + with pytest.raises(KeyError): + _ = group._cache['unique'] + # assert that group.unique of the non-unique group doesn't reference + # itself: + assert group.unique is not group + # check if caches have been set correctly: + assert group._cache['isunique'] is False + assert group._cache['unique'] is group.unique + # check length and type: + assert len(group.unique) == 2 + assert type(group.unique) is type(group) + # check if caches of group.unique have been set correctly: + assert group.unique._cache['isunique'] is True + assert group.unique._cache['unique'] is group.unique + # assert that repeated access yields the same object (not a copy): + unique_group = group.unique + assert unique_group is group.unique class TestGroupSlicing(object): @@ -341,7 +416,6 @@ class TestGroupLevelTransition(object): *group_to_*group tests moves between levels _unique tests check that Upshifts only return unique higher level _listcomp tests check that Downshifts INCLUDE repeated elements - _unique tests the unique method (performs set operation on self) """ @pytest.fixture() @@ -352,46 +426,122 @@ def test_atomgroup_to_atomgroup(self, u): atm = u.atoms.atoms assert len(atm) == 125 assert isinstance(atm, groups.AtomGroup) + assert atm is u.atoms def test_atomgroup_to_residuegroup(self, u): - res = u.atoms.residues + atm = u.atoms + res = atm.residues assert len(res) == 25 assert isinstance(res, groups.ResidueGroup) + assert res == u.residues + assert res is not u.residues + assert res._cache['isunique'] is True + assert res._cache['unique'] is res def test_atomgroup_to_segmentgroup(self, u): seg = u.atoms.segments assert len(seg) == 5 assert isinstance(seg, groups.SegmentGroup) + assert seg == u.segments + assert seg is not u.segments + assert seg._cache['isunique'] is True + assert seg._cache['unique'] is seg def test_residuegroup_to_atomgroup(self, u): - atm = u.residues.atoms + res = u.residues + atm = res.atoms assert len(atm) == 125 assert isinstance(atm, groups.AtomGroup) + assert atm == u.atoms + assert atm is not u.atoms + # clear res' uniqueness caches: + if 'unique' in res._cache.keys(): + del res._cache['unique'] + if 'isunique' in res._cache.keys(): + del res._cache['isunique'] + atm = res.atoms + # assert uniqueness caches of atm are empty: + with pytest.raises(KeyError): + _ = atm._cache['isunique'] + with pytest.raises(KeyError): + _ = atm._cache['unique'] + # populate uniqueness cache of res: + assert res.isunique + atm = res.atoms + # assert uniqueness caches of atm are set: + assert atm._cache['isunique'] is True + assert atm._cache['unique'] is atm def test_residuegroup_to_residuegroup(self, u): res = u.residues.residues assert len(res) == 25 assert isinstance(res, groups.ResidueGroup) + assert res is u.residues def test_residuegroup_to_segmentgroup(self, u): seg = u.residues.segments assert len(seg) == 5 assert isinstance(seg, groups.SegmentGroup) + assert seg == u.segments + assert seg is not u.segments + assert seg._cache['isunique'] is True + assert seg._cache['unique'] is seg def test_segmentgroup_to_atomgroup(self, u): - atm = u.segments.atoms + seg = u.segments + atm = seg.atoms assert len(atm) == 125 assert isinstance(atm, groups.AtomGroup) + assert atm == u.atoms + assert atm is not u.atoms + # clear seg's uniqueness caches: + if 'unique' in seg._cache.keys(): + del seg._cache['unique'] + if 'isunique' in seg._cache.keys(): + del seg._cache['isunique'] + atm = seg.atoms + # assert uniqueness caches of atm are empty: + with pytest.raises(KeyError): + _ = atm._cache['isunique'] + with pytest.raises(KeyError): + _ = atm._cache['unique'] + # populate uniqueness cache of seg: + assert seg.isunique + atm = seg.atoms + # assert uniqueness caches of atm are set: + assert atm._cache['isunique'] is True + assert atm._cache['unique'] is atm def test_segmentgroup_to_residuegroup(self, u): - res = u.segments.residues + seg = u.segments + res = seg.residues assert len(res) == 25 assert isinstance(res, groups.ResidueGroup) + assert res == u.residues + assert res is not u.residues + # clear seg's uniqueness caches: + if 'unique' in seg._cache.keys(): + del seg._cache['unique'] + if 'isunique' in seg._cache.keys(): + del seg._cache['isunique'] + res = seg.residues + # assert uniqueness caches of res are empty: + with pytest.raises(KeyError): + _ = res._cache['isunique'] + with pytest.raises(KeyError): + _ = res._cache['unique'] + # populate uniqueness cache of seg: + assert seg.isunique + res = seg.residues + # assert uniqueness caches of res are set: + assert res._cache['isunique'] is True + assert res._cache['unique'] is res def test_segmentgroup_to_segmentgroup(self, u): seg = u.segments.segments assert len(seg) == 5 assert isinstance(seg, groups.SegmentGroup) + assert seg is u.segments def test_atom_to_residue(self, u): res = u.atoms[0].residue @@ -405,6 +555,11 @@ def test_residue_to_atomgroup(self, u): ag = u.residues[0].atoms assert isinstance(ag, groups.AtomGroup) assert len(ag) == 5 + assert ag._cache['isunique'] is True + assert ag._cache['unique'] is ag + del ag._cache['unique'] + del ag._cache['isunique'] + assert ag.isunique def test_residue_to_segment(self, u): seg = u.residues[0].segment @@ -414,62 +569,96 @@ def test_segment_to_atomgroup(self, u): ag = u.segments[0].atoms assert isinstance(ag, groups.AtomGroup) assert len(ag) == 25 + assert ag._cache['isunique'] is True + assert ag._cache['unique'] is ag + del ag._cache['unique'] + del ag._cache['isunique'] + assert ag.isunique def test_segment_to_residuegroup(self, u): rg = u.segments[0].residues assert isinstance(rg, groups.ResidueGroup) assert len(rg) == 5 + assert rg._cache['isunique'] is True + assert rg._cache['unique'] is rg + del rg._cache['unique'] + del rg._cache['isunique'] + assert rg.isunique def test_atomgroup_to_residuegroup_unique(self, u): ag = u.atoms[:5] + u.atoms[10:15] + u.atoms[:5] - - assert len(ag.residues) == 2 + rg = ag.residues + assert len(rg) == 2 + assert rg._cache['isunique'] is True + assert rg._cache['unique'] is rg def test_atomgroup_to_segmentgroup_unique(self, u): ag = u.atoms[0] + u.atoms[-1] + u.atoms[0] - - assert len(ag.segments) == 2 + sg = ag.segments + assert len(sg) == 2 + assert sg._cache['isunique'] is True + assert sg._cache['unique'] is sg def test_residuegroup_to_segmentgroup_unique(self, u): rg = u.residues[0] + u.residues[6] + u.residues[1] - - assert len(rg.segments) == 2 + sg = rg.segments + assert len(sg) == 2 + assert sg._cache['isunique'] is True + assert sg._cache['unique'] is sg def test_residuegroup_to_atomgroup_listcomp(self, u): rg = u.residues[0] + u.residues[0] + u.residues[4] - - assert len(rg.atoms) == 15 + ag = rg.atoms + assert len(ag) == 15 + # assert uniqueness caches of ag are empty: + with pytest.raises(KeyError): + _ = ag._cache['isunique'] + with pytest.raises(KeyError): + _ = ag._cache['unique'] + # populate uniqueness cache of rg: + assert not rg.isunique + ag = rg.atoms + # assert uniqueness caches of ag are still empty: + with pytest.raises(KeyError): + _ = ag._cache['isunique'] + with pytest.raises(KeyError): + _ = ag._cache['unique'] def test_segmentgroup_to_residuegroup_listcomp(self, u): sg = u.segments[0] + u.segments[0] + u.segments[1] - - assert len(sg.residues) == 15 + rg = sg.residues + assert len(rg) == 15 + # assert uniqueness caches of rg are empty: + with pytest.raises(KeyError): + _ = rg._cache['isunique'] + with pytest.raises(KeyError): + _ = rg._cache['unique'] + # populate uniqueness cache of sg: + assert not sg.isunique + rg = sg.residues + # assert uniqueness caches of rg are still empty: + with pytest.raises(KeyError): + _ = rg._cache['isunique'] + with pytest.raises(KeyError): + _ = rg._cache['unique'] def test_segmentgroup_to_atomgroup_listcomp(self, u): sg = u.segments[0] + u.segments[0] + u.segments[1] - - assert len(sg.atoms) == 75 - - def test_atomgroup_unique(self, u): - ag = u.atoms[:10] + u.atoms[:10] - - assert len(ag) == 20 - assert len(ag.unique) == 10 - assert isinstance(ag.unique, groups.AtomGroup) - - def test_residuegroup_unique(self, u): - rg = u.residues[:5] + u.residues[:5] - - assert len(rg) == 10 - assert len(rg.unique) == 5 - assert isinstance(rg.unique, groups.ResidueGroup) - - def test_segmentgroup_unique(self, u): - sg = u.segments[0] + u.segments[1] + u.segments[0] - - assert len(sg) == 3 - assert len(sg.unique) == 2 - assert isinstance(sg.unique, groups.SegmentGroup) + ag = sg.atoms + assert len(ag) == 75 + # assert uniqueness caches of ag are empty: + with pytest.raises(KeyError): + _ = ag._cache['isunique'] + with pytest.raises(KeyError): + _ = ag._cache['unique'] + # populate uniqueness cache of sg: + assert not sg.isunique + ag = sg.atoms + # assert uniqueness caches of ag are still empty: + with pytest.raises(KeyError): + _ = ag._cache['isunique'] + with pytest.raises(KeyError): + _ = ag._cache['unique'] class TestComponentComparisons(object): @@ -577,7 +766,6 @@ class TestGroupBy(object): @pytest.fixture() def u(self): return make_Universe(('segids', 'charges', 'resids')) - def test_groupby_float(self, u): gb = u.atoms.groupby('charges') @@ -588,7 +776,7 @@ def test_groupby_float(self, u): assert all(g.charges == ref) assert len(g) == 25 - @pytest.mark.parametrize('string', ['segids', b'segids', u'segids']) + @pytest.mark.parametrize('string', ['segids', b'segids', u'segids']) def test_groupby_string(self, u, string): gb = u.atoms.groupby(string) @@ -626,13 +814,13 @@ def test_groupby_int_float(self, u): for subref in [-1.5, -0.5, 0.0, 0.5, 1.5]: assert (ref, subref) in gb.keys() a = gb[(ref, subref)] - assert len(a) == 1 + assert len(a) == 1 assert all(a.resids == ref) assert all(a.charges == subref) def test_groupby_string_int(self, u): gb = u.atoms.groupby(['segids', 'resids']) - + assert len(gb) == 25 res = 1 for ref in ['SegA','SegB','SegC','SegD','SegE']: @@ -642,7 +830,7 @@ def test_groupby_string_int(self, u): assert all(a.segids == ref) assert all(a.resids == res) res += 1 - + class TestReprs(object): @pytest.fixture() @@ -786,6 +974,45 @@ def test_equal(self, groups): assert not a[0:1] == a[0], \ 'Element should not equal single element group.' + @pytest.mark.parametrize('group', (u.atoms[:2], u.residues[:2], + u.segments[:2])) + def test_copy(self, group): + # make sure uniqueness caches of group are empty: + with pytest.raises(KeyError): + _ = group._cache['isunique'] + with pytest.raises(KeyError): + _ = group._cache['unique'] + # make a copy: + cgroup = group.copy() + # check if cgroup is an identical copy of group: + assert type(cgroup) is type(group) + assert cgroup is not group + assert cgroup == group + # check if the copied group's uniqueness caches are empty: + with pytest.raises(KeyError): + _ = cgroup._cache['isunique'] + with pytest.raises(KeyError): + _ = cgroup._cache['unique'] + # populate group's uniqueness caches: + assert group.isunique + # make a copy: + cgroup = group.copy() + # check if the copied group's uniqueness caches are set correctly: + assert cgroup._cache['isunique'] is True + assert cgroup._cache['unique'] is cgroup + # add duplicate element to group: + group += group[0] + # populate group's uniqueness caches: + assert not group.isunique + # make a copy: + cgroup = group.copy() + # check if the copied group's uniqueness caches are set correctly: + assert cgroup._cache['isunique'] is False + with pytest.raises(KeyError): + _ = cgroup._cache['unique'] + # assert that duplicates are preserved: + assert cgroup == group + def test_issubset(self, groups): a, b, c, d, e = groups assert c.issubset(a) @@ -1061,12 +1288,12 @@ def test_SegmentGroup_nowarn_getitem(self, u): @pytest.fixture() def attr_universe(): return make_Universe(('names', 'resids', 'segids')) - + class TestAttributeSetting(object): @pytest.mark.parametrize('groupname', ['atoms', 'residues', 'segments']) def test_setting_group_fail(self, attr_universe, groupname): group = getattr(attr_universe, groupname) - + with pytest.raises(AttributeError): group.this = 'that' @@ -1078,7 +1305,7 @@ def test_setting_component_fails(self, attr_universe, groupname): component.this = 'that' @pytest.mark.parametrize('attr', ['name', 'resid', 'segid']) - @pytest.mark.parametrize('groupname', ['atoms', 'residues', 'segments']) + @pytest.mark.parametrize('groupname', ['atoms', 'residues', 'segments']) def test_group_set_singular(self, attr_universe, attr, groupname): # this should fail as you can't set the 'name' of a 'ResidueGroup' group = getattr(attr_universe, groupname) @@ -1120,9 +1347,9 @@ def test_segment_set_resid(self, attr_universe): def test_segment_set_segid(self, attr_universe): attr_universe.segments[0].segid = 'this' assert attr_universe.segments[0].segid == 'this' - + @pytest.mark.parametrize('attr', ['names', 'resids', 'segids']) - @pytest.mark.parametrize('groupname', ['atoms', 'residues', 'segments']) + @pytest.mark.parametrize('groupname', ['atoms', 'residues', 'segments']) def test_component_set_plural(self, attr, groupname): # this should fail as you can't set the 'Names' of an 'Atom' u = make_Universe(('names', 'resids', 'segids')) diff --git a/testsuite/MDAnalysisTests/core/test_segmentgroup.py b/testsuite/MDAnalysisTests/core/test_segmentgroup.py index fc45ff9c9b0..09c4588682f 100644 --- a/testsuite/MDAnalysisTests/core/test_segmentgroup.py +++ b/testsuite/MDAnalysisTests/core/test_segmentgroup.py @@ -41,7 +41,6 @@ def universe(): def g(universe): return universe.atoms.segments - def test_newSegmentGroup(universe): """test that slicing a SegmentGroup returns a new SegmentGroup (Issue 135)""" g = universe.atoms.segments diff --git a/testsuite/MDAnalysisTests/core/test_topologyattrs.py b/testsuite/MDAnalysisTests/core/test_topologyattrs.py index fbaa341021e..a40fb644280 100644 --- a/testsuite/MDAnalysisTests/core/test_topologyattrs.py +++ b/testsuite/MDAnalysisTests/core/test_topologyattrs.py @@ -543,3 +543,19 @@ def test_segment_record_types(self, rectype_uni): assert not rt[0].dtype == bool assert (rt[0] == 'ATOM').all() assert (rt[1] == 'HETATM').all() + + +def test_static_typing(): + ta = tpattrs.Charges(['1.0', '2.0', '3.0']) + + assert isinstance(ta.values, np.ndarray) + assert ta.values.dtype == float + + +def test_static_typing_from_empty(): + u = mda.Universe.empty(3) + + u.add_TopologyAttr('masses', values=['1.0', '2.0', '3.0']) + + assert isinstance(u._topology.masses.values, np.ndarray) + assert isinstance(u.atoms[0].mass, float) diff --git a/testsuite/MDAnalysisTests/core/test_topologyobjects.py b/testsuite/MDAnalysisTests/core/test_topologyobjects.py index 4e7bc4072df..7aeaa7a249b 100644 --- a/testsuite/MDAnalysisTests/core/test_topologyobjects.py +++ b/testsuite/MDAnalysisTests/core/test_topologyobjects.py @@ -154,18 +154,23 @@ def test_angle(self, PSFDCD): assert_almost_equal(angle.angle(), 107.20893, self.precision) assert_almost_equal(angle.value(), 107.20893, self.precision) + def test_angle_repr(self, PSFDCD): + angle = PSFDCD.atoms[[30, 10, 20]].angle + + assert_equal(repr(angle), '') + def test_angle_180(self): # we edit the coordinates, so make our own universe u = mda.Universe(PSF, DCD) angle = u.atoms[210].angles[0] - coords = np.array([[ 83.37363434, 65.01402283, 35.03564835], - [ 82.28535461, 59.99816513, 34.94399261], - [ 81.19387817, 54.97631073, 34.85218048]], + coords = np.array([[1, 1, 1], + [2, 1, 1], + [3, 1, 1]], dtype=np.float32) angle.atoms.positions = coords - assert_almost_equal(angle.value(), -180.0, self.precision) + assert_almost_equal(angle.value(), 180.0, self.precision) # Dihedral class check def test_dihedral(self, PSFDCD): @@ -174,6 +179,12 @@ def test_dihedral(self, PSFDCD): assert_almost_equal(dihedral.dihedral(), 18.317778, self.precision) assert_almost_equal(dihedral.value(), 18.317778, self.precision) + def test_dihedral_repr(self, PSFDCD): + dihedral = PSFDCD.atoms[[4, 7, 8, 1]].dihedral + + assert_equal(repr(dihedral), + '') + # Improper_Dihedral class check def test_improper(self, PSFDCD): imp = PSFDCD.atoms[4].impropers[0] @@ -181,6 +192,12 @@ def test_improper(self, PSFDCD): assert_almost_equal(imp.improper(), -3.8370631, self.precision) assert_almost_equal(imp.value(), -3.8370631, self.precision) + def test_improper_repr(self, PSFDCD): + imp = PSFDCD.atoms[[4, 7, 8, 1]].improper + + assert_equal( + repr(imp), + '') class TestTopologyGroup(object): """Tests TopologyDict and TopologyGroup classes with psf input""" @@ -703,3 +720,27 @@ def test_cross_universe_eq(): u2 = mda.Universe(PSF) assert not (u1.bonds[0] == u2.bonds[0]) + +def test_zero_size_TG_indices_bonds(): + u = mda.Universe.empty(10) + + u.add_TopologyAttr('bonds', values=[(1, 2), (2, 3)]) + + ag = u.atoms[[0]] + + idx = ag.bonds.to_indices() + + assert idx.shape == (0, 2) + assert idx.dtype == np.int32 + +def test_zero_size_TG_indices_angles(): + u = mda.Universe.empty(10) + + u.add_TopologyAttr('angles', values=[(1, 2, 3), (2, 3, 4)]) + + ag = u.atoms[[0]] + + idx = ag.angles.to_indices() + + assert idx.shape == (0, 3) + assert idx.dtype == np.int32 diff --git a/testsuite/MDAnalysisTests/core/test_universe.py b/testsuite/MDAnalysisTests/core/test_universe.py index dbcb13bd6c2..fe3672065e3 100644 --- a/testsuite/MDAnalysisTests/core/test_universe.py +++ b/testsuite/MDAnalysisTests/core/test_universe.py @@ -25,6 +25,7 @@ from six.moves import cPickle import os +import subprocess try: from cStringIO import StringIO @@ -55,6 +56,7 @@ import MDAnalysis as mda import MDAnalysis.coordinates from MDAnalysis.topology.base import TopologyReaderBase +from MDAnalysis.transformations import translate from MDAnalysisTests import assert_nowarns @@ -167,7 +169,12 @@ def test_Universe_invalidpermissionfile_IE_msg(self): temp_file = os.path.join(temp_dir.name, 'permission.denied.tpr') with open(temp_file, 'w'): pass - os.chmod(temp_file, 0o200) + + if os.name == 'nt': + subprocess.call("icacls {filename} /deny Users:RX".format(filename=temp_file), + shell=True) + else: + os.chmod(temp_file, 0o200) try: mda.Universe(os.path.join(temp_dir.name, 'permission.denied.tpr')) except IOError as e: @@ -183,6 +190,22 @@ def test_load_new_VE(self): with pytest.raises(TypeError): u.load_new('thisfile', format = 'soup') + def test_load_new_memory_reader_success(self): + u = mda.Universe(GRO) + prot = u.select_atoms('protein') + u2 = mda.Merge(prot) + assert u2.load_new( [ prot.positions ], format=mda.coordinates.memory.MemoryReader) is u2 + + def test_load_new_memory_reader_fails(self): + def load(): + u = mda.Universe(GRO) + prot = u.select_atoms('protein') + u2 = mda.Merge(prot) + u2.load_new( [[ prot.positions ]], format=mda.coordinates.memory.MemoryReader) + + with pytest.raises(TypeError): + load() + def test_universe_kwargs(self): u = mda.Universe(PSF, PDB_small, fake_kwarg=True) assert_equal(len(u.atoms), 3341, "Loading universe failed somehow") @@ -287,6 +310,21 @@ def test_chainid_quick_select(): assert len(u.C.atoms) == 5 assert len(u.D.atoms) == 7 +class TestTransformations(object): + """Tests the transformations keyword + """ + def test_callable(self): + u = mda.Universe(PSF,DCD, transformations=translate([10,10,10])) + uref = mda.Universe(PSF,DCD) + ref = translate([10,10,10])(uref.trajectory.ts) + assert_almost_equal(u.trajectory.ts.positions, ref, decimal=6) + + def test_list(self): + workflow = [translate([10,10,0]), translate([0,0,10])] + u = mda.Universe(PSF,DCD, transformations=workflow) + uref = mda.Universe(PSF,DCD) + ref = translate([10,10,10])(uref.trajectory.ts) + assert_almost_equal(u.trajectory.ts.positions, ref, decimal=6) class TestGuessMasses(object): """Tests the Mass Guesser in topology.guessers @@ -652,3 +690,30 @@ def test_no_segindex_warning(self): with pytest.warns(UserWarning): u = mda.Universe.empty(n_atoms=10, n_residues=2, n_segments=1, atom_resindex=res) + + def test_trajectory(self): + u = mda.Universe.empty(10, trajectory=True) + + assert len(u.atoms) == 10 + assert u.atoms.positions.shape == (10, 3) + + def test_trajectory_iteration(self): + u = mda.Universe.empty(10, trajectory=True) + + assert len(u.trajectory) == 1 + timesteps =[] + for ts in u.trajectory: + timesteps.append(ts.frame) + assert len(timesteps) == 1 + + def test_velocities(self): + u = mda.Universe.empty(10, trajectory=True, velocities=True) + + assert u.atoms.positions.shape == (10, 3) + assert u.atoms.velocities.shape == (10, 3) + + def test_forces(self): + u = mda.Universe.empty(10, trajectory=True, forces=True) + + assert u.atoms.positions.shape == (10, 3) + assert u.atoms.forces.shape == (10, 3) diff --git a/testsuite/MDAnalysisTests/core/test_updating_atomgroup.py b/testsuite/MDAnalysisTests/core/test_updating_atomgroup.py index dad07ad8990..48e1a647362 100644 --- a/testsuite/MDAnalysisTests/core/test_updating_atomgroup.py +++ b/testsuite/MDAnalysisTests/core/test_updating_atomgroup.py @@ -114,6 +114,18 @@ def test_kwarg_check(self, u): with pytest.raises(TypeError): u.select_atoms("group updating", {"updating": True}) + def test_atoms(self, ag_updating): + ag = ag_updating.atoms + assert isinstance(ag, mda.core.groups.AtomGroup) + assert ag is not ag_updating + assert ag == ag_updating + + def test_copy(self, ag_updating): + cgroup = ag_updating.copy() + assert isinstance(cgroup, mda.core.groups.UpdatingAtomGroup) + assert cgroup is not ag_updating + assert cgroup == ag_updating + class TestUpdatingSelectionNotraj(object): @pytest.fixture() diff --git a/testsuite/MDAnalysisTests/data/19hc.pdb.gz b/testsuite/MDAnalysisTests/data/19hc.pdb.gz new file mode 100644 index 00000000000..e95e242d264 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/19hc.pdb.gz differ diff --git a/testsuite/MDAnalysisTests/data/1a28.pdb.gz b/testsuite/MDAnalysisTests/data/1a28.pdb.gz new file mode 100644 index 00000000000..abf5f3e60bb Binary files /dev/null and b/testsuite/MDAnalysisTests/data/1a28.pdb.gz differ diff --git a/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error1.parm7 b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error1.parm7 new file mode 100644 index 00000000000..bfd99825c91 --- /dev/null +++ b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error1.parm7 @@ -0,0 +1,4 @@ +%ERROR VERSION_STAMP = V0001.000 DATE = 09/08/18 15:36:17 +%FLAG TITLE +%FORMAT(20a4) +ACE diff --git a/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error2.parm7 b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error2.parm7 new file mode 100644 index 00000000000..d33a6fccbfb --- /dev/null +++ b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error2.parm7 @@ -0,0 +1,4 @@ +%VERSION VERSION_STAMP = V0001.000 DATE = 09/08/18 15:36:17 +%FLAG ERROR +%FORMAT(20a4) +ACE diff --git a/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error3.parm7 b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error3.parm7 new file mode 100644 index 00000000000..f2639661d8a --- /dev/null +++ b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.error3.parm7 @@ -0,0 +1,14 @@ +%VERSION VERSION_STAMP = V0001.000 DATE = 09/08/18 15:36:17 +%FLAG TITLE +%FORMAT(20a4) +ACE +%FLAG POINTERS +%FORMAT(10I8) + 6 4 3 2 6 1 9 0 0 0 + 16 1 2 1 0 3 3 3 4 0 + 0 0 0 0 0 0 0 0 6 0 + 0 +%FLAG ATOM_NAME +%FORMAT(20a4) +HH31CH3 HH32HH33C O +FOO diff --git a/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.parm7 b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.parm7 new file mode 100644 index 00000000000..803a5c161ec --- /dev/null +++ b/testsuite/MDAnalysisTests/data/Amber/ace_mbondi3.parm7 @@ -0,0 +1,141 @@ +%VERSION VERSION_STAMP = V0001.000 DATE = 09/08/18 15:36:17 +%FLAG TITLE +%FORMAT(20a4) +ACE +%FLAG POINTERS +%FORMAT(10I8) + 6 4 3 2 6 1 9 0 0 0 + 16 1 2 1 0 3 3 3 4 0 + 0 0 0 0 0 0 0 0 6 0 + 0 +%FLAG ATOM_NAME +%FORMAT(20a4) +HH31CH3 HH32HH33C O +%FLAG CHARGE +%FORMAT(5E16.8) + 2.04636429E+00 -6.67300626E+00 2.04636429E+00 2.04636429E+00 1.08823576E+01 + -1.03484442E+01 +%FLAG ATOMIC_NUMBER +%FORMAT(10I8) + 1 6 1 1 6 8 +%FLAG MASS +%FORMAT(5E16.8) + 1.00800000E+00 1.20100000E+01 1.00800000E+00 1.00800000E+00 1.20100000E+01 + 1.60000000E+01 +%FLAG ATOM_TYPE_INDEX +%FORMAT(10I8) + 1 2 1 1 3 4 +%FLAG NUMBER_EXCLUDED_ATOMS +%FORMAT(10I8) + 5 4 3 2 1 1 +%FLAG NONBONDED_PARM_INDEX +%FORMAT(10I8) + 1 2 4 7 2 3 5 8 4 5 + 6 9 7 8 9 10 +%FLAG RESIDUE_LABEL +%FORMAT(20a4) +ACE +%FLAG RESIDUE_POINTER +%FORMAT(10I8) + 1 +%FLAG BOND_FORCE_CONSTANT +%FORMAT(5E16.8) + 5.70000000E+02 3.40000000E+02 3.17000000E+02 +%FLAG BOND_EQUIL_VALUE +%FORMAT(5E16.8) + 1.22900000E+00 1.09000000E+00 1.52200000E+00 +%FLAG ANGLE_FORCE_CONSTANT +%FORMAT(5E16.8) + 5.00000000E+01 3.50000000E+01 8.00000000E+01 +%FLAG ANGLE_EQUIL_VALUE +%FORMAT(5E16.8) + 1.91113635E+00 1.91113635E+00 2.10137732E+00 +%FLAG DIHEDRAL_FORCE_CONSTANT +%FORMAT(5E16.8) + 8.00000000E-01 0.00000000E+00 8.00000000E-02 +%FLAG DIHEDRAL_PERIODICITY +%FORMAT(5E16.8) + 1.00000000E+00 2.00000000E+00 3.00000000E+00 +%FLAG DIHEDRAL_PHASE +%FORMAT(5E16.8) + 0.00000000E+00 0.00000000E+00 3.14159400E+00 +%FLAG SCEE_SCALE_FACTOR +%FORMAT(5E16.8) + 1.20000000E+00 1.20000000E+00 1.20000000E+00 +%FLAG SCNB_SCALE_FACTOR +%FORMAT(5E16.8) + 2.00000000E+00 2.00000000E+00 2.00000000E+00 +%FLAG SOLTY +%FORMAT(5E16.8) + 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 +%FLAG LENNARD_JONES_ACOEF +%FORMAT(5E16.8) + 7.51607703E+03 9.71708117E+04 1.04308023E+06 8.61541883E+04 9.24822270E+05 + 8.19971662E+05 5.44261042E+04 6.47841731E+05 5.74393458E+05 3.79876399E+05 +%FLAG LENNARD_JONES_BCOEF +%FORMAT(5E16.8) + 2.17257828E+01 1.26919150E+02 6.75612247E+02 1.12529845E+02 5.99015525E+02 + 5.31102864E+02 1.11805549E+02 6.26720080E+02 5.55666448E+02 5.64885984E+02 +%FLAG BONDS_INC_HYDROGEN +%FORMAT(10I8) + 3 6 2 3 9 2 0 3 2 +%FLAG BONDS_WITHOUT_HYDROGEN +%FORMAT(10I8) + 12 15 1 3 12 3 +%FLAG ANGLES_INC_HYDROGEN +%FORMAT(10I8) + 9 3 12 1 6 3 9 2 6 3 + 12 1 0 3 6 2 0 3 9 2 + 0 3 12 1 +%FLAG ANGLES_WITHOUT_HYDROGEN +%FORMAT(10I8) + 3 12 15 3 +%FLAG DIHEDRALS_INC_HYDROGEN +%FORMAT(10I8) + 9 3 12 15 1 9 3 -12 15 2 + 9 3 -12 15 3 6 3 12 15 1 + 6 3 -12 15 2 6 3 -12 15 3 + 0 3 12 15 1 0 3 -12 15 2 + 0 3 -12 15 3 +%FLAG DIHEDRALS_WITHOUT_HYDROGEN +%FORMAT(10I8) + +%FLAG EXCLUDED_ATOMS_LIST +%FORMAT(10I8) + 2 3 4 5 6 3 4 5 6 4 + 5 6 5 6 6 0 +%FLAG HBOND_ACOEF +%FORMAT(5E16.8) + +%FLAG HBOND_BCOEF +%FORMAT(5E16.8) + +%FLAG HBCUT +%FORMAT(5E16.8) + +%FLAG AMBER_ATOM_TYPE +%FORMAT(20a4) +HC CT HC HC C O +%FLAG TREE_CHAIN_CLASSIFICATION +%FORMAT(20a4) +M M E E M E +%FLAG JOIN_ARRAY +%FORMAT(10I8) + 0 0 0 0 0 0 +%FLAG IROTAT +%FORMAT(10I8) + 0 0 0 0 0 0 +%FLAG RADIUS_SET +%FORMAT(1a80) +ArgH and AspGluO modified Bondi2 radii (mbondi3) +%FLAG RADII +%FORMAT(5E16.8) + 1.20000000E+00 1.70000000E+00 1.20000000E+00 1.20000000E+00 1.70000000E+00 + 1.50000000E+00 +%FLAG SCREEN +%FORMAT(5E16.8) + 8.50000000E-01 7.20000000E-01 8.50000000E-01 8.50000000E-01 7.20000000E-01 + 8.50000000E-01 +%FLAG IPOL +%FORMAT(1I8) + 0 diff --git a/testsuite/MDAnalysisTests/data/adk_oplsaa_GLY_rama.npy b/testsuite/MDAnalysisTests/data/adk_oplsaa_GLY_rama.npy new file mode 100644 index 00000000000..7f034dc41d0 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/adk_oplsaa_GLY_rama.npy differ diff --git a/testsuite/MDAnalysisTests/data/adk_oplsaa_LYS_janin.npy b/testsuite/MDAnalysisTests/data/adk_oplsaa_LYS_janin.npy new file mode 100644 index 00000000000..3117bca7f0b Binary files /dev/null and b/testsuite/MDAnalysisTests/data/adk_oplsaa_LYS_janin.npy differ diff --git a/testsuite/MDAnalysisTests/data/adk_oplsaa_dihedral.npy b/testsuite/MDAnalysisTests/data/adk_oplsaa_dihedral.npy new file mode 100644 index 00000000000..aba09266b8e Binary files /dev/null and b/testsuite/MDAnalysisTests/data/adk_oplsaa_dihedral.npy differ diff --git a/testsuite/MDAnalysisTests/data/adk_oplsaa_dihedral_list.npy b/testsuite/MDAnalysisTests/data/adk_oplsaa_dihedral_list.npy new file mode 100644 index 00000000000..63b7c570f61 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/adk_oplsaa_dihedral_list.npy differ diff --git a/testsuite/MDAnalysisTests/data/adk_oplsaa_janin.npy b/testsuite/MDAnalysisTests/data/adk_oplsaa_janin.npy new file mode 100644 index 00000000000..b47318958e3 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/adk_oplsaa_janin.npy differ diff --git a/testsuite/MDAnalysisTests/data/adk_oplsaa_rama.npy b/testsuite/MDAnalysisTests/data/adk_oplsaa_rama.npy new file mode 100644 index 00000000000..0ee56e9ebc0 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/adk_oplsaa_rama.npy differ diff --git a/testsuite/MDAnalysisTests/data/analysis/YiiP_lipids.gro.gz b/testsuite/MDAnalysisTests/data/analysis/YiiP_lipids.gro.gz new file mode 100644 index 00000000000..35603005e04 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/analysis/YiiP_lipids.gro.gz differ diff --git a/testsuite/MDAnalysisTests/data/analysis/YiiP_lipids.xtc b/testsuite/MDAnalysisTests/data/analysis/YiiP_lipids.xtc new file mode 100644 index 00000000000..60673398ffa Binary files /dev/null and b/testsuite/MDAnalysisTests/data/analysis/YiiP_lipids.xtc differ diff --git a/testsuite/MDAnalysisTests/data/coordinates/new_hexane.arc b/testsuite/MDAnalysisTests/data/coordinates/new_hexane.arc new file mode 100644 index 00000000000..6705ae636a9 --- /dev/null +++ b/testsuite/MDAnalysisTests/data/coordinates/new_hexane.arc @@ -0,0 +1,24 @@ + 6 Hexane (267 OPLS-UA in 38.8 Ang Box; JPC, 100, 14511 '96) + 38.860761 38.860761 38.860761 90.000000 90.000000 90.000000 + 1 CH3 -0.533809 8.893843 -17.718901 83 2 + 2 CH2 -0.492066 8.734009 -16.201869 86 1 3 + 3 CH2 0.609320 7.723360 -15.894925 86 2 4 + 4 CH2 0.723163 7.301395 -14.432851 86 3 5 + 5 CH2 1.923300 6.401842 -14.151512 86 4 6 + 6 CH3 1.576645 4.928146 -14.343148 83 5 + 6 Hexane (test file for MDA) + 39.860761 39.860761 39.860761 90.000000 90.000000 90.000000 + 1 CH3 0.039519 9.187867 -17.899888 83 2 + 2 CH2 -0.171280 8.486514 -16.561104 86 1 3 + 3 CH2 0.988507 7.632303 -16.057222 86 2 4 + 4 CH2 0.630146 7.086837 -14.677831 86 3 5 + 5 CH2 1.729866 6.240985 -14.042356 86 4 6 + 6 CH3 2.065117 4.899261 -14.687383 83 5 + 6 Hexane + 40.860761 40.860761 40.860761 90.000000 90.000000 90.000000 + 1 CH3 -0.533809 8.893843 -17.718901 83 2 + 2 CH2 -0.492066 8.734009 -16.201869 86 1 3 + 3 CH2 0.609320 7.723360 -15.894925 86 2 4 + 4 CH2 0.723163 7.301395 -14.432851 86 3 5 + 5 CH2 1.923300 6.401842 -14.151512 86 4 6 + 6 CH3 1.576645 4.928146 -14.343148 83 5 diff --git a/testsuite/MDAnalysisTests/data/fullerene.pdb.gz b/testsuite/MDAnalysisTests/data/fullerene.pdb.gz new file mode 100644 index 00000000000..828096e83e7 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/fullerene.pdb.gz differ diff --git a/testsuite/MDAnalysisTests/data/lammps/wat.lammpstrj.bz2 b/testsuite/MDAnalysisTests/data/lammps/wat.lammpstrj.bz2 new file mode 100644 index 00000000000..a008021d734 Binary files /dev/null and b/testsuite/MDAnalysisTests/data/lammps/wat.lammpstrj.bz2 differ diff --git a/testsuite/MDAnalysisTests/datafiles.py b/testsuite/MDAnalysisTests/datafiles.py index 97a791fdd55..11c608c88b8 100644 --- a/testsuite/MDAnalysisTests/datafiles.py +++ b/testsuite/MDAnalysisTests/datafiles.py @@ -44,7 +44,7 @@ "PSF_TRICLINIC", "DCD_TRICLINIC", # CHARMM c36 new unitcell, NPT 125 TIP3P (box vectors, see Issue 187 for details) "PSF_NAMD", "PDB_NAMD", # NAMD "PSF_NAMD_TRICLINIC", "DCD_NAMD_TRICLINIC", # NAMD, triclinic unitcell (Issue 187) - "PSF_NAMD_GBIS", "DCD_NAMD_GBIS", # NAMD, implicit solvent, 100 steps, #1819 + "PSF_NAMD_GBIS", "DCD_NAMD_GBIS", # NAMD, implicit solvent, 100 steps, #1819 "PSF_nosegid", # psf without a segid, Issue 121 "PDB_small", # PDB "PDB_closed", @@ -85,7 +85,7 @@ "XTC_sub_sol", "XYZ", "XYZ_psf", "XYZ_bz2", "XYZ_mini", "XYZ_five", # 3 and 5 atoms xyzs for an easy topology - "TXYZ", "ARC", # Tinker files + "TXYZ", "ARC", "ARC_PBC", # Tinker files "PRM", "TRJ", "TRJ_bz2", # Amber (no periodic box) "INPCRD", "PRMpbc", "TRJpbc_bz2", # Amber (periodic box) @@ -94,6 +94,8 @@ "PRMncdf", "TRJncdf", "NCDF", # Amber (netcdf) "PFncdf_Top", "PFncdf_Trj", # Amber ncdf with Positions and Forces "PRMcs", # Amber (format, Issue 1331) + "PRMNCRST", # Amber ncrst with positions/forces/velocities + "PRMErr1", "PRMErr2", "PRMErr3", # Amber TOP files to check raised errors "PQR", # PQR v1 "PQR_icodes", # PQR v2 with icodes "PDBQT_input", # PDBQT @@ -118,6 +120,7 @@ "LAMMPScnt", "LAMMPScnt2", # triclinic box "LAMMPShyd", "LAMMPShyd2", "LAMMPSdata_deletedatoms", # with deleted atoms + "LAMMPSDUMP", "unordered_res", # pdb file with resids non sequential "GMS_ASYMOPT", # GAMESS C1 optimization "GMS_SYMOPT", # GAMESS D4h optimization @@ -129,6 +132,7 @@ "waterPSF","waterDCD","rmsfArray", "HoomdXMLdata", "Make_Whole", # for testing the function lib.mdamath.make_whole, has 9 atoms + "fullerene", # for make_whole, a nice friendly C60 with bonds "Plength", "COORDINATES_XYZ", "COORDINATES_XYZ_BZ2", @@ -153,6 +157,11 @@ "legacy_DCD_NAMD_coords", # frame 0 read in for SiN_tric_namd.dcd using legacy DCD reader "legacy_DCD_c36_coords", # frames 1 and 4 read in for tip125_tric_C36.dcd using legacy DCD reader "GSD", + "GRO_MEMPROT", "XTC_MEMPROT", # YiiP transporter in POPE:POPG lipids with Na+, Cl-, Zn2+ dummy model without water + "DihedralArray", "DihedralsArray", # time series of single dihedral + "RamaArray", "GLYRamaArray", # time series of phi/psi angles + "JaninArray", "LYSJaninArray", # time series of chi1/chi2 angles + "PDB_rama", "PDB_janin" # for testing failures of Ramachandran and Janin classes ] from pkg_resources import resource_filename @@ -239,6 +248,8 @@ XTC_sub_sol = resource_filename(__name__, 'data/cobrotoxin.xtc') PDB_sub_sol = resource_filename(__name__, 'data/cobrotoxin.pdb') PDB_xlserial = resource_filename(__name__, 'data/xl_serial.pdb') +GRO_MEMPROT = resource_filename(__name__, 'data/analysis/YiiP_lipids.gro.gz') +XTC_MEMPROT = resource_filename(__name__, 'data/analysis/YiiP_lipids.xtc') XTC_multi_frame = resource_filename( __name__, 'data/xtc_test_only_10_frame_10_atoms.xtc' ) @@ -288,6 +299,7 @@ XYZ_five = resource_filename(__name__, 'data/five.xyz') TXYZ = resource_filename(__name__, 'data/coordinates/test.txyz') ARC = resource_filename(__name__, 'data/coordinates/test.arc') +ARC_PBC = resource_filename(__name__, 'data/coordinates/new_hexane.arc') PRM = resource_filename(__name__, 'data/Amber/ache.prmtop') TRJ = resource_filename(__name__, 'data/Amber/ache.mdcrd') @@ -311,6 +323,12 @@ PRMcs = resource_filename(__name__, 'data/Amber/chitosan.prmtop') +PRMNCRST = resource_filename(__name__, 'data/Amber/ace_mbondi3.parm7') + +PRMErr1 = resource_filename(__name__, 'data/Amber/ace_mbondi3.error1.parm7') +PRMErr2 = resource_filename(__name__, 'data/Amber/ace_mbondi3.error2.parm7') +PRMErr3 = resource_filename(__name__, 'data/Amber/ace_mbondi3.error3.parm7') + PQR = resource_filename(__name__, 'data/adk_open.pqr') PQR_icodes = resource_filename(__name__, 'data/1A2C.pqr') @@ -364,6 +382,7 @@ LAMMPShyd = resource_filename(__name__, "data/lammps/hydrogen-class1.data") LAMMPShyd2 = resource_filename(__name__, "data/lammps/hydrogen-class1.data2") LAMMPSdata_deletedatoms = resource_filename(__name__, 'data/lammps/deletedatoms.data') +LAMMPSDUMP = resource_filename(__name__, "data/lammps/wat.lammpstrj.bz2") unordered_res = resource_filename(__name__, "data/unordered_res.pdb") @@ -390,6 +409,7 @@ HoomdXMLdata = resource_filename(__name__, 'data/C12x64.xml.bz2') Make_Whole = resource_filename(__name__, 'data/make_whole.gro') +fullerene = resource_filename(__name__, 'data/fullerene.pdb.gz') Plength = resource_filename(__name__, 'data/plength.gro') Martini_membrane_gro = resource_filename(__name__, 'data/martini_dppc_chol_bilayer.gro') @@ -408,5 +428,14 @@ GSD = resource_filename(__name__, 'data/example.gsd') +DihedralArray = resource_filename(__name__, 'data/adk_oplsaa_dihedral.npy') +DihedralsArray = resource_filename(__name__, 'data/adk_oplsaa_dihedral_list.npy') +RamaArray = resource_filename(__name__, 'data/adk_oplsaa_rama.npy') +GLYRamaArray = resource_filename(__name__, 'data/adk_oplsaa_GLY_rama.npy') +JaninArray = resource_filename(__name__, 'data/adk_oplsaa_janin.npy') +LYSJaninArray = resource_filename(__name__, 'data/adk_oplsaa_LYS_janin.npy') +PDB_rama = resource_filename(__name__, 'data/19hc.pdb.gz') +PDB_janin = resource_filename(__name__, 'data/1a28.pdb.gz') + # This should be the last line: clean up namespace del resource_filename diff --git a/testsuite/MDAnalysisTests/import/test_import.py b/testsuite/MDAnalysisTests/import/test_import.py index c50b88d7c5d..277d85a450d 100644 --- a/testsuite/MDAnalysisTests/import/test_import.py +++ b/testsuite/MDAnalysisTests/import/test_import.py @@ -23,9 +23,12 @@ import sys import os import subprocess +import pytest """Test if importing MDAnalysis has unwanted side effects (PR #1794).""" +@pytest.mark.skipif(os.name == 'nt', + reason="fork-related import checks irrelevant on Windows") class TestMDAImport(object): # Tests concerning importing MDAnalysis. def test_os_dot_fork_not_called(self): diff --git a/testsuite/MDAnalysisTests/lib/test_augment.py b/testsuite/MDAnalysisTests/lib/test_augment.py new file mode 100644 index 00000000000..f80bce934e8 --- /dev/null +++ b/testsuite/MDAnalysisTests/lib/test_augment.py @@ -0,0 +1,108 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 + +from __future__ import absolute_import +import pytest +import numpy as np +from numpy.testing import assert_almost_equal, assert_equal + +from MDAnalysis.lib._augment import augment_coordinates, undo_augment +from MDAnalysis.lib.distances import apply_PBC, transform_StoR + +# Find images for several query points, +# here in fractional coordinates +# Every element of qres tuple is (query, images) +qres = ( + ([0.1, 0.5, 0.5], [[1.1, 0.5, 0.5]]), # box face + ([0.5, 0.5, 0.5], []), # box center + ([0.5, -0.1, 0.5], [[0.5, -0.1, 0.5]]), # box face + ([0.1, 0.1, 0.5], [[1.1, 0.1, 0.5], + [0.1, 1.1, 0.5], + [1.1, 1.1, 0.5]]), # box edge + ([0.5, -0.1, 1.1], [[0.5, -0.1, 0.1], + [0.5, 0.9, 1.1], + [0.5, -0.1, 1.1]]), # box edge + ([0.1, 0.1, 0.1], [[1.1, 0.1, 0.1], + [0.1, 1.1, 0.1], + [0.1, 0.1, 1.1], + [0.1, 1.1, 1.1], + [1.1, 1.1, 0.1], + [1.1, 0.1, 1.1], + [1.1, 1.1, 1.1]]), # box vertex + ([0.1, -0.1, 1.1], [[1.1, 0.9, 0.1], + [0.1, -0.1, 0.1], + [0.1, 0.9, 1.1], + [0.1, -0.1, 1.1], + [1.1, -0.1, 0.1], + [1.1, 0.9, 1.1], + [1.1, -0.1, 1.1]]), # box vertex + ([2.1, -3.1, 0.1], [[1.1, 0.9, 0.1], + [0.1, -0.1, 0.1], + [0.1, 0.9, 1.1], + [0.1, -0.1, 1.1], + [1.1, -0.1, 0.1], + [1.1, 0.9, 1.1], + [1.1, -0.1, 1.1]]), # box vertex + ([[0.1, 0.5, 0.5], + [0.5, -0.1, 0.5]], [[1.1, 0.5, 0.5], + [0.5, -0.1, 0.5]]) # multiple queries + ) + + +@pytest.mark.parametrize('b', ( + np.array([10, 10, 10, 90, 90, 90], dtype=np.float32), + np.array([10, 10, 10, 45, 60, 90], dtype=np.float32) + )) +@pytest.mark.parametrize('q, res', qres) +def test_augment(b, q, res): + radius = 1.5 + q = transform_StoR(np.array(q, dtype=np.float32), b) + if q.shape == (3, ): + q = q.reshape((1, 3)) + q = apply_PBC(q, b) + aug, mapping = augment_coordinates(q, b, radius) + if aug.size > 0: + aug = np.sort(aug, axis=0) + else: + aug = list() + if len(res) > 0: + cs = transform_StoR(np.array(res, dtype=np.float32), b) + cs = np.sort(cs, axis=0) + else: + cs = list() + assert_almost_equal(aug, cs, decimal=5) + + +@pytest.mark.parametrize('b', ( + np.array([10, 10, 10, 90, 90, 90], dtype=np.float32), + np.array([10, 10, 10, 45, 60, 90], dtype=np.float32) + )) +@pytest.mark.parametrize('qres', qres) +def test_undoaugment(b, qres): + radius = 1.5 + q = transform_StoR(np.array(qres[0], dtype=np.float32), b) + if q.shape == (3, ): + q = q.reshape((1, 3)) + q = apply_PBC(q, b) + aug, mapping = augment_coordinates(q, b, radius) + for idx, val in enumerate(aug): + imageid = np.asarray([len(q) + idx], dtype=np.int64) + assert_equal(mapping[idx], undo_augment(imageid, mapping, len(q))[0]) diff --git a/testsuite/MDAnalysisTests/lib/test_cutil.py b/testsuite/MDAnalysisTests/lib/test_cutil.py new file mode 100644 index 00000000000..c530a8864be --- /dev/null +++ b/testsuite/MDAnalysisTests/lib/test_cutil.py @@ -0,0 +1,61 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +from __future__ import absolute_import + +import pytest +import numpy as np +from numpy.testing import assert_equal + +from MDAnalysis.lib._cutil import unique_int_1d, find_fragments + + +@pytest.mark.parametrize('values', ( + [], # empty array + [1, 1, 1, 1, ], # all identical + [2, 3, 5, 7, ], # all different, monotonic + [5, 2, 7, 3, ], # all different, non-monotonic + [1, 2, 2, 4, 4, 6, ], # duplicates, monotonic + [1, 2, 2, 6, 4, 4, ], # duplicates, non-monotonic +)) +def test_unique_int_1d(values): + array = np.array(values, dtype=np.int64) + assert_equal(unique_int_1d(array), np.unique(array)) + + +@pytest.mark.parametrize('edges,ref', [ + ([[0, 1], [1, 2], [2, 3], [3, 4]], + [[0, 1, 2, 3, 4]]), # linear chain + ([[0, 1], [1, 2], [2, 3], [3, 4], [4, 10]], + [[0, 1, 2, 3, 4]]), # unused edge (4, 10) + ([[0, 1], [1, 2], [2, 3]], + [[0, 1, 2, 3], [4]]), # lone atom + ([[0, 1], [1, 2], [2, 0], [3, 4], [4, 3]], + [[0, 1, 2], [3, 4]]), # circular +]) +def test_find_fragments(edges, ref): + atoms = np.arange(5) + + fragments = find_fragments(atoms, edges) + + assert len(fragments) == len(ref) + for frag, r in zip(fragments, ref): + assert_equal(frag, r) diff --git a/testsuite/MDAnalysisTests/lib/test_distances.py b/testsuite/MDAnalysisTests/lib/test_distances.py index 5b9c434f15b..b146c5f458c 100644 --- a/testsuite/MDAnalysisTests/lib/test_distances.py +++ b/testsuite/MDAnalysisTests/lib/test_distances.py @@ -20,25 +20,1335 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # +from __future__ import division, absolute_import import pytest import numpy as np -from numpy.testing import assert_equal +from numpy.testing import assert_equal, assert_almost_equal +from itertools import combinations_with_replacement as comb -import MDAnalysis as mda +import MDAnalysis +from MDAnalysis.lib import distances +from MDAnalysis.lib import mdamath +from MDAnalysis.tests.datafiles import PSF, DCD, TRIC -def test_transform_StoR_pass(): +class TestCheckBox(object): + + prec = 6 + ref_ortho = np.ones(3, dtype=np.float32) + ref_tri_vecs = np.array([[1, 0, 0], [0, 1, 0], [0, 2 ** 0.5, 2 ** 0.5]], + dtype=np.float32) + + @pytest.mark.parametrize('box', + ([1, 1, 1, 90, 90, 90], + (1, 1, 1, 90, 90, 90), + ['1', '1', 1, 90, '90', '90'], + ('1', '1', 1, 90, '90', '90'), + np.array(['1', '1', 1, 90, '90', '90']), + np.array([1, 1, 1, 90, 90, 90], dtype=np.float32), + np.array([1, 1, 1, 90, 90, 90], dtype=np.float64), + np.array([1, 1, 1, 1, 1, 1, 90, 90, 90, 90, 90, 90], + dtype=np.float32)[::2])) + def test_ckeck_box_ortho(self, box): + boxtype, checked_box = distances._check_box(box) + assert boxtype == 'ortho' + assert_equal(checked_box, self.ref_ortho) + assert checked_box.dtype == np.float32 + assert checked_box.flags['C_CONTIGUOUS'] + + @pytest.mark.parametrize('box', + ([1, 1, 2, 45, 90, 90], + (1, 1, 2, 45, 90, 90), + ['1', '1', 2, 45, '90', '90'], + ('1', '1', 2, 45, '90', '90'), + np.array(['1', '1', 2, 45, '90', '90']), + np.array([1, 1, 2, 45, 90, 90], dtype=np.float32), + np.array([1, 1, 2, 45, 90, 90], dtype=np.float64), + np.array([1, 1, 1, 1, 2, 2, 45, 45, 90, 90, 90, 90], + dtype=np.float32)[::2])) + def test_check_box_tri_vecs(self, box): + boxtype, checked_box = distances._check_box(box) + assert boxtype == 'tri_vecs' + assert_almost_equal(checked_box, self.ref_tri_vecs, self.prec) + assert checked_box.dtype == np.float32 + assert checked_box.flags['C_CONTIGUOUS'] + + def test_check_box_wrong_data(self): + with pytest.raises(ValueError): + wrongbox = ['invalid', 1, 1, 90, 90, 90] + boxtype, checked_box = distances._check_box(wrongbox) + + def test_check_box_wrong_shape(self): + with pytest.raises(ValueError): + wrongbox = np.ones((3, 3), dtype=np.float32) + boxtype, checked_box = distances._check_box(wrongbox) + + +class TestCheckResultArray(object): + + ref = np.zeros(1, dtype=np.float64) + + def test_check_result_array_pass(self): + # Assert input array is returned if it has correct shape and dtype: + res = distances._check_result_array(self.ref, self.ref.shape) + assert res is self.ref + # Assert correct array is returned if input is None: + res = distances._check_result_array(None, self.ref.shape) + assert_equal(res, self.ref) + assert res.dtype == np.float64 + + def test_check_result_array_wrong_shape(self): + wrong_shape = (1,) + self.ref.shape + with pytest.raises(ValueError) as err: + res = distances._check_result_array(self.ref, wrong_shape) + assert err.msg == ("Result array has incorrect shape, should be " + "{0}, got {1}.".format(self.ref.shape, + wrong_shape)) + + def test_check_result_array_wrong_dtype(self): + wrong_dtype = np.int64 + ref_wrong_dtype = self.ref.astype(wrong_dtype) + with pytest.raises(TypeError) as err: + res = distances._check_result_array(ref_wrong_dtype, self.ref.shape) + assert err.msg == ("Result array must be of type numpy.float64, " + "got {}.".format(wrong_dtype)) + + +@pytest.mark.parametrize('coord_dtype', (np.float32, np.float64)) +def test_transform_StoR_pass(coord_dtype): box = np.array([10, 7, 3, 45, 60, 90], dtype=np.float32) - s = np.array([[0.5, -0.1, 0.5]], dtype=np.float32) + s = np.array([[0.5, -0.1, 0.5]], dtype=coord_dtype) original_r = np.array([[ 5.75, 0.36066014, 0.75000012]], dtype=np.float32) - test_r = mda.lib.distances.transform_StoR(s, box) + test_r = distances.transform_StoR(s, box) assert_equal(original_r, test_r) -def test_transform_StoR_fail(): - box = np.array([10, 7, 3, 45, 60, 90], dtype=np.float32) - s = np.array([[0.5, -0.1, 0.5]]) - with pytest.raises(TypeError, match='S must be of type float32'): - r = mda.lib.distances.transform_StoR(s, box) +def test_capped_distance_noresults(): + point1 = np.array([0.1, 0.1, 0.1], dtype=np.float32) + point2 = np.array([0.95, 0.1, 0.1], dtype=np.float32) + + pairs, dists = distances.capped_distance(point1, point2, max_cutoff=0.2) + + assert_equal(len(pairs), 0) + + +npoints_1 = (1, 100) + +boxes_1 = (np.array([1, 2, 3, 90, 90, 90], dtype=np.float32), # ortho + np.array([1, 2, 3, 30, 45, 60], dtype=np.float32), # tri_box + None, # Non Periodic + ) + + +query_1 = (np.array([0.1, 0.1, 0.1], dtype=np.float32), + np.array([[0.1, 0.1, 0.1], + [0.2, 0.1, 0.1]], dtype=np.float32)) + +method_1 = ('bruteforce', 'pkdtree', 'nsgrid') + +min_cutoff_1 = (None, 0.1) + + +@pytest.mark.parametrize('npoints', npoints_1) +@pytest.mark.parametrize('box', boxes_1) +@pytest.mark.parametrize('query', query_1) +@pytest.mark.parametrize('method', method_1) +@pytest.mark.parametrize('min_cutoff', min_cutoff_1) +def test_capped_distance_checkbrute(npoints, box, query, method, min_cutoff): + np.random.seed(90003) + points = (np.random.uniform(low=0, high=1.0, + size=(npoints, 3))*(boxes_1[0][:3])).astype(np.float32) + max_cutoff = 0.3 + # capped distance should be able to handle array of vectors + # as well as single vectors. + pairs, dist = distances.capped_distance(query, points, max_cutoff, + min_cutoff=min_cutoff, box=box, + method=method) + + if pairs.shape != (0, ): + found_pairs = pairs[:, 1] + else: + found_pairs = list() + + if(query.shape[0] == 3): + query = query.reshape((1, 3)) + + dists = distances.distance_array(query, points, box=box) + + if min_cutoff is None: + min_cutoff = 0. + indices = np.where((dists < max_cutoff) & (dists > min_cutoff)) + + assert_equal(np.sort(found_pairs, axis=0), np.sort(indices[1], axis=0)) + +# for coverage +@pytest.mark.parametrize('npoints', npoints_1) +@pytest.mark.parametrize('box', boxes_1) +@pytest.mark.parametrize('query', query_1) +@pytest.mark.parametrize('method', method_1) +@pytest.mark.parametrize('min_cutoff', min_cutoff_1) +def test_capped_distance_return(npoints, box, query, method, min_cutoff): + np.random.seed(90003) + points = (np.random.uniform(low=0, high=1.0, + size=(npoints, 3))*(boxes_1[0][:3])).astype(np.float32) + max_cutoff = 0.3 + # capped distance should be able to handle array of vectors + # as well as single vectors. + pairs = distances.capped_distance(query, points, max_cutoff, + min_cutoff=min_cutoff, box=box, + method=method, return_distances=False) + + if pairs.shape != (0, ): + found_pairs = pairs[:, 1] + else: + found_pairs = list() + + if(query.shape[0] == 3): + query = query.reshape((1, 3)) + + dists = distances.distance_array(query, points, box=box) + + if min_cutoff is None: + min_cutoff = 0. + indices = np.where((dists < max_cutoff) & (dists > min_cutoff)) + + assert_equal(np.sort(found_pairs, axis=0), np.sort(indices[1], axis=0)) + + +@pytest.mark.parametrize('npoints', npoints_1) +@pytest.mark.parametrize('box', boxes_1) +@pytest.mark.parametrize('method', method_1) +@pytest.mark.parametrize('min_cutoff', min_cutoff_1) +def test_self_capped_distance(npoints, box, method, min_cutoff): + np.random.seed(90003) + points = (np.random.uniform(low=0, high=1.0, + size=(npoints, 3))*(boxes_1[0][:3])).astype(np.float32) + max_cutoff = 0.2 + pairs, distance = distances.self_capped_distance(points, max_cutoff, + min_cutoff=min_cutoff, + box=box, method=method) + found_pairs, found_distance = [], [] + for i, coord in enumerate(points): + dist = distances.distance_array(coord, points[i+1:], box=box) + if min_cutoff is not None: + idx = np.where((dist < max_cutoff) & (dist > min_cutoff))[1] + else: + idx = np.where((dist < max_cutoff))[1] + for other_idx in idx: + j = other_idx + 1 + i + found_pairs.append((i, j)) + found_distance.append(dist[0, other_idx]) + assert_equal(len(pairs), len(found_pairs)) + + +@pytest.mark.parametrize('box', (None, + np.array([1, 1, 1, 90, 90, 90], dtype=np.float32), + np.array([1, 1, 1, 60, 75, 80], dtype=np.float32))) +@pytest.mark.parametrize('npoints,cutoff,meth', + [(1, 0.02, '_bruteforce_capped_self'), + (1, 0.2, '_bruteforce_capped_self'), + (600, 0.02, '_pkdtree_capped_self'), + (600, 0.2, '_nsgrid_capped_self')]) +def test_method_selfselection(box, npoints, cutoff, meth): + np.random.seed(90003) + points = (np.random.uniform(low=0, high=1.0, + size=(npoints, 3))).astype(np.float32) + method = distances._determine_method_self(points, cutoff, box=box) + assert_equal(method.__name__, meth) + + +@pytest.mark.parametrize('box', (None, + np.array([1, 1, 1, 90, 90, 90], dtype=np.float32), + np.array([1, 1, 1, 60, 75, 80], dtype=np.float32))) +@pytest.mark.parametrize('npoints,cutoff,meth', + [(1, 0.02, '_bruteforce_capped'), + (1, 0.2, '_bruteforce_capped'), + (200, 0.02, '_nsgrid_capped'), + (200, 0.35, '_bruteforce_capped'), + (10000, 0.35, '_nsgrid_capped')]) +def test_method_selection(box, npoints, cutoff, meth): + np.random.seed(90003) + points = (np.random.uniform(low=0, high=1.0, + size=(npoints, 3)).astype(np.float32)) + method = distances._determine_method(points, points, cutoff, box=box) + assert_equal(method.__name__, meth) + + +@pytest.fixture() +def ref_system(): + box = np.array([1., 1., 2., 90., 90., 90], dtype=np.float32) + points = np.array( + [ + [0, 0, 0], [1, 1, 2], [1, 0, 2], # identical under PBC + [0.5, 0.5, 1.5], + ], dtype=np.float32) + ref = points[0:1] + conf = points[1:] + + return box, points, ref, conf + + +@pytest.mark.parametrize('backend', ['serial', 'openmp']) +class TestDistanceArray(object): + @staticmethod + def _dist(x, ref): + ref = np.asarray(ref, dtype=np.float32) + r = x - ref + return np.sqrt(np.dot(r, r)) + + def test_noPBC(self, backend, ref_system): + box, points, ref, conf = ref_system + + d = distances.distance_array(ref, points, backend=backend) + + assert_almost_equal(d, np.array([[ + self._dist(points[0], ref[0]), + self._dist(points[1], ref[0]), + self._dist(points[2], ref[0]), + self._dist(points[3], ref[0])] + ])) + + def test_PBC(self, backend, ref_system): + box, points, ref, conf = ref_system + + d = distances.distance_array(ref, points, box=box, backend=backend) + + assert_almost_equal(d, np.array([[0., 0., 0., self._dist(points[3], ref=[1, 1, 2])]])) + + def test_PBC2(self, backend): + a = np.array([7.90146923, -13.72858524, 3.75326586], dtype=np.float32) + b = np.array([-1.36250901, 13.45423985, -0.36317623], dtype=np.float32) + box = np.array([5.5457325, 5.5457325, 5.5457325, 90., 90., 90.], dtype=np.float32) + + def mindist(a, b, box): + x = a - b + return np.linalg.norm(x - np.rint(x / box) * box) + + ref = mindist(a, b, box[:3]) + val = distances.distance_array(a, b, box=box, backend=backend)[0, 0] + + assert_almost_equal(val, ref, decimal=6, + err_msg="Issue 151 not correct (PBC in distance array)") + + +@pytest.fixture() +def DCD_Universe(): + universe = MDAnalysis.Universe(PSF, DCD) + trajectory = universe.trajectory + + return universe, trajectory + +@pytest.mark.parametrize('backend', ['serial', 'openmp']) +class TestDistanceArrayDCD(object): + # reasonable precision so that tests succeed on 32 and 64 bit machines + # (the reference values were obtained on 64 bit) + # Example: + # Items are not equal: wrong maximum distance value + # ACTUAL: 52.470254967456412 + # DESIRED: 52.470257062419059 + prec = 5 + + def test_simple(self, DCD_Universe, backend): + U, trajectory = DCD_Universe + trajectory.rewind() + x0 = U.atoms.positions + trajectory[10] + x1 = U.atoms.positions + d = distances.distance_array(x0, x1, backend=backend) + assert_equal(d.shape, (3341, 3341), "wrong shape (should be (Natoms,Natoms))") + assert_almost_equal(d.min(), 0.11981228170520701, self.prec, + err_msg="wrong minimum distance value") + assert_almost_equal(d.max(), 53.572192429459619, self.prec, + err_msg="wrong maximum distance value") + + def test_outarray(self, DCD_Universe, backend): + U, trajectory = DCD_Universe + trajectory.rewind() + x0 = U.atoms.positions + trajectory[10] + x1 = U.atoms.positions + natoms = len(U.atoms) + d = np.zeros((natoms, natoms), np.float64) + distances.distance_array(x0, x1, result=d, backend=backend) + assert_equal(d.shape, (natoms, natoms), "wrong shape, shoud be (Natoms,Natoms) entries") + assert_almost_equal(d.min(), 0.11981228170520701, self.prec, + err_msg="wrong minimum distance value") + assert_almost_equal(d.max(), 53.572192429459619, self.prec, + err_msg="wrong maximum distance value") + + def test_periodic(self, DCD_Universe, backend): + # boring with the current dcd as that has no PBC + U, trajectory = DCD_Universe + trajectory.rewind() + x0 = U.atoms.positions + trajectory[10] + x1 = U.atoms.positions + d = distances.distance_array(x0, x1, box=U.coord.dimensions, + backend=backend) + assert_equal(d.shape, (3341, 3341), "should be square matrix with Natoms entries") + assert_almost_equal(d.min(), 0.11981228170520701, self.prec, + err_msg="wrong minimum distance value with PBC") + assert_almost_equal(d.max(), 53.572192429459619, self.prec, + err_msg="wrong maximum distance value with PBC") + + + +@pytest.mark.parametrize('backend', ['serial', 'openmp']) +class TestSelfDistanceArrayDCD(object): + prec = 5 + + def test_simple(self, DCD_Universe, backend): + U, trajectory = DCD_Universe + trajectory.rewind() + x0 = U.atoms.positions + d = distances.self_distance_array(x0, backend=backend) + N = 3341 * (3341 - 1) / 2 + assert_equal(d.shape, (N,), "wrong shape (should be (Natoms*(Natoms-1)/2,))") + assert_almost_equal(d.min(), 0.92905562402529318, self.prec, + err_msg="wrong minimum distance value") + assert_almost_equal(d.max(), 52.4702570624190590, self.prec, + err_msg="wrong maximum distance value") + + def test_outarray(self, DCD_Universe, backend): + U, trajectory = DCD_Universe + trajectory.rewind() + x0 = U.atoms.positions + natoms = len(U.atoms) + N = natoms * (natoms - 1) // 2 + d = np.zeros((N,), np.float64) + distances.self_distance_array(x0, result=d, backend=backend) + assert_equal(d.shape, (N,), "wrong shape (should be (Natoms*(Natoms-1)/2,))") + assert_almost_equal(d.min(), 0.92905562402529318, self.prec, + err_msg="wrong minimum distance value") + assert_almost_equal(d.max(), 52.4702570624190590, self.prec, + err_msg="wrong maximum distance value") + + def test_periodic(self, DCD_Universe, backend): + # boring with the current dcd as that has no PBC + U, trajectory = DCD_Universe + trajectory.rewind() + x0 = U.atoms.positions + natoms = len(U.atoms) + N = natoms * (natoms - 1) / 2 + d = distances.self_distance_array(x0, box=U.coord.dimensions, + backend=backend) + assert_equal(d.shape, (N,), "wrong shape (should be (Natoms*(Natoms-1)/2,))") + assert_almost_equal(d.min(), 0.92905562402529318, self.prec, + err_msg="wrong minimum distance value with PBC") + assert_almost_equal(d.max(), 52.4702570624190590, self.prec, + err_msg="wrong maximum distance value with PBC") + + +@pytest.mark.parametrize('backend', ['serial', 'openmp']) +class TestTriclinicDistances(object): + """Unit tests for the Triclinic PBC functions. + Tests: + # transforming to and from S space (fractional coords) + MDAnalysis.lib.distances.transform_StoR + MDAnalysis.lib.distances.transform_RtoS + # distance calculations with PBC + MDAnalysis.lib.distances.self_distance_array + MDAnalysis.lib.distances.distance_array + """ + + prec = 2 + + @staticmethod + @pytest.fixture() + def TRIC(): + return MDAnalysis.Universe(TRIC) + + @staticmethod + @pytest.fixture() + def tri_vec_box(TRIC): + return MDAnalysis.coordinates.core.triclinic_vectors(TRIC.dimensions) + + @staticmethod + @pytest.fixture() + def box(TRIC): + return TRIC.dimensions + + @staticmethod + @pytest.fixture() + def S_mol(TRIC): + S_mol1 = np.array([TRIC.atoms[383].position]) + S_mol2 = np.array([TRIC.atoms[390].position]) + + return S_mol1, S_mol2 + + @staticmethod + @pytest.fixture() + def S_mol_single(TRIC): + S_mol1 = TRIC.atoms[383].position + S_mol2 = TRIC.atoms[390].position + return S_mol1, S_mol2 + + @pytest.mark.parametrize('S_mol', [S_mol, S_mol_single], indirect=True) + def test_transforms(self, S_mol, tri_vec_box, box, backend): + # To check the cython coordinate transform, the same operation is done in numpy + # Is a matrix multiplication of Coords x tri_vec_box = NewCoords, so can use np.dot + S_mol1, S_mol2 = S_mol + # Test transformation + R_mol1 = distances.transform_StoR(S_mol1, box, backend=backend) + R_np1 = np.dot(S_mol1, tri_vec_box) + R_mol2 = distances.transform_StoR(S_mol2, box, backend=backend) + R_np2 = np.dot(S_mol2, tri_vec_box) + + assert_almost_equal(R_mol1, R_np1, self.prec, err_msg="StoR transform failed for S_mol1") + assert_almost_equal(R_mol2, R_np2, self.prec, err_msg="StoR transform failed for S_mol2") + + # Round trip test + S_test1 = distances.transform_RtoS(R_mol1, box, backend=backend) + S_test2 = distances.transform_RtoS(R_mol2, box, backend=backend) + + assert_almost_equal(S_test1, S_mol1, self.prec, err_msg="Round trip 1 failed in transform") + assert_almost_equal(S_test2, S_mol2, self.prec, err_msg="Round trip 2 failed in transform") + + def test_selfdist(self, S_mol, box, tri_vec_box, backend): + S_mol1, S_mol2 = S_mol + R_coords = distances.transform_StoR(S_mol1, box, backend=backend) + # Transform functions are tested elsewhere so taken as working here + dists = distances.self_distance_array(R_coords, box=box, backend=backend) + # Manually calculate self_distance_array + manual = np.zeros(len(dists), dtype=np.float64) + distpos = 0 + for i, Ri in enumerate(R_coords): + for Rj in R_coords[i + 1:]: + Rij = Rj - Ri + Rij -= round(Rij[2] / tri_vec_box[2][2]) * tri_vec_box[2] + Rij -= round(Rij[1] / tri_vec_box[1][1]) * tri_vec_box[1] + Rij -= round(Rij[0] / tri_vec_box[0][0]) * tri_vec_box[0] + Rij = np.linalg.norm(Rij) # find norm of Rij vector + manual[distpos] = Rij # and done, phew + distpos += 1 + + assert_almost_equal(dists, manual, self.prec, + err_msg="self_distance_array failed with input 1") + + # Do it again for input 2 (has wider separation in points) + R_coords = distances.transform_StoR(S_mol2, box, backend=backend) + # Transform functions are tested elsewhere so taken as working here + dists = distances.self_distance_array(R_coords, box=box, backend=backend) + # Manually calculate self_distance_array + manual = np.zeros(len(dists), dtype=np.float64) + distpos = 0 + for i, Ri in enumerate(R_coords): + for Rj in R_coords[i + 1:]: + Rij = Rj - Ri + Rij -= round(Rij[2] / tri_vec_box[2][2]) * tri_vec_box[2] + Rij -= round(Rij[1] / tri_vec_box[1][1]) * tri_vec_box[1] + Rij -= round(Rij[0] / tri_vec_box[0][0]) * tri_vec_box[0] + Rij = np.linalg.norm(Rij) # find norm of Rij vector + manual[distpos] = Rij # and done, phew + distpos += 1 + + assert_almost_equal(dists, manual, self.prec, + err_msg="self_distance_array failed with input 2") + + def test_distarray(self, S_mol, tri_vec_box, box, backend): + S_mol1, S_mol2 = S_mol + + R_mol1 = distances.transform_StoR(S_mol1, box, backend=backend) + R_mol2 = distances.transform_StoR(S_mol2, box, backend=backend) + + # Try with box + dists = distances.distance_array(R_mol1, R_mol2, box=box, backend=backend) + # Manually calculate distance_array + manual = np.zeros((len(R_mol1), len(R_mol2))) + for i, Ri in enumerate(R_mol1): + for j, Rj in enumerate(R_mol2): + Rij = Rj - Ri + Rij -= round(Rij[2] / tri_vec_box[2][2]) * tri_vec_box[2] + Rij -= round(Rij[1] / tri_vec_box[1][1]) * tri_vec_box[1] + Rij -= round(Rij[0] / tri_vec_box[0][0]) * tri_vec_box[0] + Rij = np.linalg.norm(Rij) # find norm of Rij vector + manual[i][j] = Rij + + assert_almost_equal(dists, manual, self.prec, + err_msg="distance_array failed with box") + + def test_pbc_dist(self, S_mol, box, backend): + S_mol1, S_mol2 = S_mol + results = np.array([[37.629944]]) + dists = distances.distance_array(S_mol1, S_mol2, box=box, backend=backend) + + assert_almost_equal(dists, results, self.prec, + err_msg="distance_array failed to retrieve PBC distance") + + def test_pbc_wrong_wassenaar_distance(self, backend): + box = [2, 2, 2, 60, 60, 60] + tri_vec_box = mdamath.triclinic_vectors(box) + a, b, c = tri_vec_box + point_a = a + b + point_b = .5 * point_a + dist = distances.distance_array(point_a, point_b, box=box, backend=backend) + assert_almost_equal(dist[0, 0], 1) + # check that our distance is different from the wassenaar distance as + # expected. + assert np.linalg.norm(point_a - point_b) != dist[0, 0] + + +@pytest.mark.parametrize('backend', ['serial', 'openmp']) +class TestCythonFunctions(object): + # Unit tests for calc_bonds calc_angles and calc_dihedrals in lib.distances + # Tests both numerical results as well as input types as Cython will silently + # produce nonsensical results if given wrong data types otherwise. + prec = 5 + + @staticmethod + @pytest.fixture() + def box(): + return np.array([10., 10., 10., 90., 90., 90.], dtype=np.float32) + + @staticmethod + @pytest.fixture() + def triclinic_box(): + box_vecs = np.array([[10., 0., 0.], [1., 10., 0., ], [1., 0., 10.]], + dtype=np.float32) + return mdamath.triclinic_box(box_vecs[0], box_vecs[1], box_vecs[2]) + + @staticmethod + @pytest.fixture() + def positions(): + # dummy atom data + a = np.array([[0., 0., 0.], [0., 0., 0.], [0., 11., 0.], [1., 1., 1.]], dtype=np.float32) + b = np.array([[0., 0., 0.], [1., 1., 1.], [0., 0., 0.], [29., -21., 99.]], dtype=np.float32) + c = np.array([[0., 0., 0.], [2., 2., 2.], [11., 0., 0.], [1., 9., 9.]], dtype=np.float32) + d = np.array([[0., 0., 0.], [3., 3., 3.], [11., -11., 0.], [65., -65., 65.]], dtype=np.float32) + return a, b, c, d + + @staticmethod + def convert_position_dtype(a, b, c, d, dtype): + return a.astype(dtype), b.astype(dtype), c.astype(dtype), d.astype(dtype) + + @staticmethod + @pytest.fixture() + def wronglength(): + # has a different length to other inputs and should raise ValueError + return np.array([[0., 0., 0.], [3., 3., 3.]], + dtype=np.float32) + + # coordinate shifts for single coord tests + shifts = [((0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0)), # no shifting + ((1, 0, 0), (0, 1, 1), (0, 0, 1), (1, 1, 0)), # single box lengths + ((-1, 0, 1), (0, -1, 0), (1, 0, 1), (-1, -1, -1)), # negative single + ((4, 3, -2), (-2, 2, 2), (-5, 2, 2), (0, 2, 2))] # multiple boxlengths + + @pytest.mark.parametrize('dtype', (np.float32, np.float64)) + def test_bonds(self, positions, box, backend, dtype): + a, b, c, d = self.convert_position_dtype(*positions, dtype=dtype) + dists = distances.calc_bonds(a, b, backend=backend) + assert_equal(len(dists), 4, err_msg="calc_bonds results have wrong length") + dists_pbc = distances.calc_bonds(a, b, box=box, backend=backend) + #tests 0 length + assert_almost_equal(dists[0], 0.0, self.prec, err_msg="Zero length calc_bonds fail") + assert_almost_equal(dists[1], 1.7320508075688772, self.prec, + err_msg="Standard length calc_bonds fail") # arbitrary length check + # PBC checks, 2 without, 2 with + assert_almost_equal(dists[2], 11.0, self.prec, + err_msg="PBC check #1 w/o box") # pbc check 1, subtract single box length + assert_almost_equal(dists_pbc[2], 1.0, self.prec, + err_msg="PBC check #1 with box") + assert_almost_equal(dists[3], 104.26888318, self.prec, # pbc check 2, subtract multiple box + err_msg="PBC check #2 w/o box") # lengths in all directions + assert_almost_equal(dists_pbc[3], 3.46410072, self.prec, + err_msg="PBC check #w with box") + + def test_bonds_badbox(self, positions, backend): + a, b, c, d = positions + badbox1 = np.array([10., 10., 10.], dtype=np.float64) + badbox2 = np.array([[10., 10.], [10., 10., ]], dtype=np.float32) + + with pytest.raises(ValueError): + distances.calc_bonds(a, b, box=badbox1, backend=backend) + + with pytest.raises(ValueError): + distances.calc_bonds(a, b, box=badbox2, backend=backend) + + def test_bonds_badresult(self, positions, backend): + a, b, c, d = positions + badresult = np.zeros(len(a) - 1) # Bad result array + with pytest.raises(ValueError): + distances.calc_bonds(a, b, result=badresult, backend=backend) + + def test_bonds_triclinic(self, positions, triclinic_box, backend): + a, b, c, d = positions + dists = distances.calc_bonds(a, b, box=triclinic_box, backend=backend) + reference = np.array([0.0, 1.7320508, 1.4142136, 2.82842712]) + assert_almost_equal(dists, reference, self.prec, err_msg="calc_bonds with triclinic box failed") + + @pytest.mark.parametrize('shift', shifts) + @pytest.mark.parametrize('periodic', [True, False]) + def test_bonds_single_coords(self, shift, periodic, backend): + box = np.array([10, 20, 30, 90., 90., 90.], dtype=np.float32) + + coords = np.array([[1, 1, 1], [3, 1, 1]], dtype=np.float32) + + shift1, shift2, _, _ = shift + + coords[0] += shift1 * box[:3] + coords[1] += shift2 * box[:3] + + box = box if periodic else None + result = distances.calc_bonds(coords[0], coords[1], box, backend=backend) + + reference = 2.0 if periodic else np.linalg.norm(coords[0] - coords[1]) + + assert_almost_equal(result, reference, decimal=self.prec) + + @pytest.mark.parametrize('dtype', (np.float32, np.float64)) + def test_angles(self, positions, backend, dtype): + a, b, c, d = self.convert_position_dtype(*positions, dtype=dtype) + angles = distances.calc_angles(a, b, c, backend=backend) + # Check calculated values + assert_equal(len(angles), 4, err_msg="calc_angles results have wrong length") + # assert_almost_equal(angles[0], 0.0, self.prec, + # err_msg="Zero length angle calculation failed") # What should this be? + assert_almost_equal(angles[1], np.pi, self.prec, + err_msg="180 degree angle calculation failed") + assert_almost_equal(np.rad2deg(angles[2]), 90., self.prec, + err_msg="Ninety degree angle in calc_angles failed") + assert_almost_equal(angles[3], 0.098174833, self.prec, + err_msg="Small angle failed in calc_angles") + + def test_angles_bad_result(self, positions, backend): + a, b, c, d = positions + badresult = np.zeros(len(a) - 1) # Bad result array + with pytest.raises(ValueError): + distances.calc_angles(a, b, c, result=badresult, backend=backend) + + @pytest.mark.parametrize('case', [ + (np.array([[1, 1, 1], [1, 2, 1], [2, 2, 1]], dtype=np.float32), 0.5 * np.pi), # 90 degree angle + (np.array([[1, 1, 1], [1, 2, 1], [1, 3, 1]], dtype=np.float32), np.pi), # straight line / 180. + (np.array([[1, 1, 1], [1, 2, 1], [2, 1, 1]], dtype=np.float32), 0.25 * np.pi), # 45 + ]) + @pytest.mark.parametrize('shift', shifts) + @pytest.mark.parametrize('periodic', [True, False]) + def test_angles_single_coords(self, case, shift, periodic, backend): + def manual_angle(x, y, z): + return mdamath.angle(y - x, y - z) + + box = np.array([10, 20, 30, 90., 90., 90.], dtype=np.float32) + (a, b, c), ref = case + + shift1, shift2, shift3, _ = shift + + a += shift1 * box[:3] + b += shift2 * box[:3] + c += shift3 * box[:3] + + box = box if periodic else None + result = distances.calc_angles(a, b, c, box, backend=backend) + reference = ref if periodic else manual_angle(a, b, c) + assert_almost_equal(result, reference, decimal=4) + + @pytest.mark.parametrize('dtype', (np.float32, np.float64)) + def test_dihedrals(self, positions, backend, dtype): + a, b, c, d = self.convert_position_dtype(*positions, dtype=dtype) + dihedrals = distances.calc_dihedrals(a, b, c, d, backend=backend) + # Check calculated values + assert_equal(len(dihedrals), 4, err_msg="calc_dihedrals results have wrong length") + assert np.isnan(dihedrals[0]), "Zero length dihedral failed" + assert np.isnan(dihedrals[1]), "Straight line dihedral failed" + assert_almost_equal(dihedrals[2], np.pi, self.prec, err_msg="180 degree dihedral failed") + assert_almost_equal(dihedrals[3], -0.50714064, self.prec, + err_msg="arbitrary dihedral angle failed") + + def test_dihedrals_wronglength(self, positions, wronglength, backend): + a, b, c, d = positions + with pytest.raises(ValueError): + distances.calc_dihedrals(a, wronglength, c, d, backend=backend) + + with pytest.raises(ValueError): + distances.calc_dihedrals(wronglength, b, c, d, backend=backend) + + with pytest.raises(ValueError): + distances.calc_dihedrals(a, b, wronglength, d, backend=backend) + + with pytest.raises(ValueError): + distances.calc_dihedrals(a, b, c, wronglength, backend=backend) + + def test_dihedrals_bad_result(self, positions, backend): + a, b, c, d = positions + badresult = np.zeros(len(a) - 1) # Bad result array + + with pytest.raises(ValueError): + distances.calc_dihedrals(a, b, c, d, result=badresult, backend=backend) + + @pytest.mark.parametrize('case', [ + (np.array([[1, 2, 1], [1, 1, 1], [2, 1, 1], [2, 2, 1]], dtype=np.float32), 0.), # 0 degree angle (cis) + (np.array([[1, 2, 1], [1, 1, 1], [2, 1, 1], [2, 0, 1]], dtype=np.float32), np.pi), # 180 degree (trans) + (np.array([[1, 2, 1], [1, 1, 1], [2, 1, 1], [2, 1, 2]], dtype=np.float32), 0.5 * np.pi), # 90 degree + (np.array([[1, 2, 1], [1, 1, 1], [2, 1, 1], [2, 1, 0]], dtype=np.float32), 0.5 * np.pi), # other 90 degree + (np.array([[1, 2, 1], [1, 1, 1], [2, 1, 1], [2, 2, 2]], dtype=np.float32), 0.25 * np.pi), # 45 degree + (np.array([[1, 2, 1], [1, 1, 1], [2, 1, 1], [2, 0, 2]], dtype=np.float32), 0.75 * np.pi), # 135 + ]) + @pytest.mark.parametrize('shift', shifts) + @pytest.mark.parametrize('periodic', [True, False]) + def test_dihedrals_single_coords(self, case, shift, periodic, backend): + def manual_dihedral(a, b, c, d): + return mdamath.dihedral(b - a, c - b, d - c) + + box = np.array([10., 10., 10., 90., 90., 90.], dtype=np.float32) + + (a, b, c, d), ref = case + + shift1, shift2, shift3, shift4 = shift + + a += shift1 * box[:3] + b += shift2 * box[:3] + c += shift3 * box[:3] + d += shift4 * box[:3] + + box = box if periodic else None + result = distances.calc_dihedrals(a, b, c, d, box, backend=backend) + reference = ref if periodic else manual_dihedral(a, b, c, d) + assert_almost_equal(abs(result), abs(reference), decimal=4) + + def test_numpy_compliance(self, positions, backend): + a, b, c, d = positions + # Checks that the cython functions give identical results to the numpy versions + bonds = distances.calc_bonds(a, b, backend=backend) + angles = distances.calc_angles(a, b, c, backend=backend) + dihedrals = distances.calc_dihedrals(a, b, c, d, backend=backend) + + bonds_numpy = np.array([mdamath.norm(y - x) for x, y in zip(a, b)]) + vec1 = a - b + vec2 = c - b + angles_numpy = np.array([mdamath.angle(x, y) for x, y in zip(vec1, vec2)]) + ab = a - b + bc = b - c + cd = c - d + dihedrals_numpy = np.array([mdamath.dihedral(x, y, z) for x, y, z in zip(ab, bc, cd)]) + + assert_almost_equal(bonds, bonds_numpy, self.prec, + err_msg="Cython bonds didn't match numpy calculations") + # numpy 0 angle returns NaN rather than 0 + assert_almost_equal(angles[1:], angles_numpy[1:], self.prec, + err_msg="Cython angles didn't match numpy calcuations") + assert_almost_equal(dihedrals, dihedrals_numpy, self.prec, + err_msg="Cython dihedrals didn't match numpy calculations") + + +@pytest.mark.parametrize('backend', ['serial', 'openmp']) +class Test_apply_PBC(object): + prec = 6 + + def test_ortho_PBC(self, backend): + U = MDAnalysis.Universe(PSF, DCD) + atoms = U.atoms.positions + box = np.array([2.5, 2.5, 3.5, 90., 90., 90.], dtype=np.float32) + with pytest.raises(ValueError): + cyth1 = distances.apply_PBC(atoms, box[:3], backend=backend) + cyth2 = distances.apply_PBC(atoms, box, backend=backend) + reference = atoms - np.floor(atoms / box[:3]) * box[:3] + + assert_almost_equal(cyth2, reference, self.prec, + err_msg="Ortho apply_PBC #2 failed comparison with np") + + def test_tric_PBC(self, backend): + U = MDAnalysis.Universe(TRIC) + atoms = U.atoms.positions + box = U.dimensions + + def numpy_PBC(coords, box): + # move to fractional coordinates + fractional = distances.transform_RtoS(coords, box) + # move fractional coordinates to central cell + fractional -= np.floor(fractional) + # move back to real coordinates + return distances.transform_StoR(fractional, box) + + cyth1 = distances.apply_PBC(atoms, box, backend=backend) + reference = numpy_PBC(atoms, box) + + assert_almost_equal(cyth1, reference, decimal=4, + err_msg="Triclinic apply_PBC failed comparison with np") + + box = np.array([10, 7, 3, 45, 60, 90], dtype=np.float32) + r = np.array([5.75, 0.36066014, 0.75], dtype=np.float32) + r_in_cell = distances.apply_PBC(r, box) + + assert_almost_equal([5.75, 7.3606596, 0.75], r_in_cell, self.prec) + +@pytest.mark.parametrize('backend', ['serial', 'openmp']) +class TestPeriodicAngles(object): + """Test case for properly considering minimum image convention when calculating angles and dihedrals + (Issue 172) + """ + @staticmethod + @pytest.fixture() + def positions(): + a = np.array([[0.0, 1.0, 0.0]], dtype=np.float32) + b = np.array([[0.0, 0.0, 0.0]], dtype=np.float32) + c = np.array([[1.0, 0.0, 0.0]], dtype=np.float32) + d = np.array([[1.0, 0.0, 1.0]], dtype=np.float32) + box = np.array([10.0, 10.0, 10.0], dtype=np.float32) + return a, b, c, d, box + + prec = 5 + + def test_angles(self, positions, backend): + # Shift atom coordinates a few box lengths in random directions and see if we still get same results + a, b, c, d, box = positions + a2 = a + box * (-1, 0, 0) + b2 = b + box * (1, 0, 1) + c2 = c + box * (-2, 5, -7) + + ref = distances.calc_angles(a, b, c, backend=backend) + + box = np.append(box, [90, 90, 90]) + test1 = distances.calc_angles(a2, b, c, box=box, backend=backend) + test2 = distances.calc_angles(a, b2, c, box=box, backend=backend) + test3 = distances.calc_angles(a, b, c2, box=box, backend=backend) + test4 = distances.calc_angles(a2, b2, c2, box=box, backend=backend) + + for val in [test1, test2, test3, test4]: + assert_almost_equal(ref, val, self.prec, err_msg="Min image in angle calculation failed") + + def test_dihedrals(self, positions, backend): + a, b, c, d, box = positions + a2 = a + box * (-1, 0, 0) + b2 = b + box * (1, 0, 1) + c2 = c + box * (-2, 5, -7) + d2 = d + box * (0, -5, 0) + + ref = distances.calc_dihedrals(a, b, c, d, backend=backend) + + box = np.append(box, [90, 90, 90]) + test1 = distances.calc_dihedrals(a2, b, c, d, box=box, backend=backend) + test2 = distances.calc_dihedrals(a, b2, c, d, box=box, backend=backend) + test3 = distances.calc_dihedrals(a, b, c2, d, box=box, backend=backend) + test4 = distances.calc_dihedrals(a, b, c, d2, box=box, backend=backend) + test5 = distances.calc_dihedrals(a2, b2, c2, d2, box=box, backend=backend) + + for val in [test1, test2, test3, test4, test5]: + assert_almost_equal(ref, val, self.prec, err_msg="Min image in dihedral calculation failed") + +class TestInputUnchanged(object): + """Tests ensuring that the following functions in MDAnalysis.lib.distances + do not alter their input coordinate arrays: + * distance_array + * self_distance_array + * capped_distance + * self_capped_distance + * transform_RtoS + * transform_StoR + * calc_bonds + * calc_angles + * calc_dihedrals + * apply_PBC + """ + + boxes = ([1.0, 1.0, 1.0, 90.0, 90.0, 90.0], # orthorhombic + [1.0, 1.0, 1.0, 80.0, 80.0, 80.0], # triclinic + None) # no PBC + + @staticmethod + @pytest.fixture() + def coords(): + # input coordinates, some outside the [1, 1, 1] box: + return [np.array([[0.1, 0.1, 0.1], [-0.9, -0.9, -0.9]], dtype=np.float32), + np.array([[0.1, 0.1, 1.9], [-0.9, -0.9, 0.9]], dtype=np.float32), + np.array([[0.1, 1.9, 1.9], [-0.9, 0.9, 0.9]], dtype=np.float32), + np.array([[0.1, 1.9, 0.1], [-0.9, 0.9, -0.9]], dtype=np.float32)] + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_input_unchanged_distance_array(self, coords, box, backend): + crds = coords[:2] + refs = [crd.copy() for crd in crds] + res = distances.distance_array(crds[0], crds[1], box=box, + backend=backend) + assert_equal(crds, refs) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_input_unchanged_self_distance_array(self, coords, box, backend): + crd = coords[0] + ref = crd.copy() + res = distances.self_distance_array(crd, box=box, backend=backend) + assert_equal(crd, ref) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('met', ["bruteforce", "pkdtree", "nsgrid", None]) + def test_input_unchanged_capped_distance(self, coords, box, met): + crds = coords[:2] + refs = [crd.copy() for crd in crds] + res = distances.capped_distance(crds[0], crds[1], max_cutoff=0.3, + box=box, method=met) + assert_equal(crds, refs) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('met', ["bruteforce", "pkdtree", "nsgrid", None]) + def test_input_unchanged_self_capped_distance(self, coords, box, met): + crd = coords[0] + ref = crd.copy() + r_cut = 0.25 + res = distances.self_capped_distance(crd, max_cutoff=r_cut, box=box, + method=met) + assert_equal(crd, ref) + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_input_unchanged_transform_RtoS_and_StoR(self, coords, box, backend): + crd = coords[0] + ref = crd.copy() + res = distances.transform_RtoS(crd, box, backend=backend) + assert_equal(crd, ref) + crd = res + ref = crd.copy() + res = distances.transform_StoR(crd, box, backend=backend) + assert_equal(crd, ref) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_input_unchanged_calc_bonds(self, coords, box, backend): + crds = coords[:2] + refs = [crd.copy() for crd in crds] + res = distances.calc_bonds(crds[0], crds[1], box=box, backend=backend) + assert_equal(crds, refs) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_input_unchanged_calc_angles(self, coords, box, backend): + crds = coords[:3] + refs = [crd.copy() for crd in crds] + res = distances.calc_angles(crds[0], crds[1], crds[2], box=box, + backend=backend) + assert_equal(crds, refs) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_input_unchanged_calc_dihedrals(self, coords, box, backend): + crds = coords + refs = [crd.copy() for crd in crds] + res = distances.calc_dihedrals(crds[0], crds[1], crds[2], crds[3], + box=box, backend=backend) + assert_equal(crds, refs) + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_input_unchanged_apply_PBC(self, coords, box, backend): + crd = coords[0] + ref = crd.copy() + res = distances.apply_PBC(crd, box, backend=backend) + assert_equal(crd, ref) + + +class TestEmptyInputCoordinates(object): + """Tests ensuring that the following functions in MDAnalysis.lib.distances + do not choke on empty input coordinate arrays: + * distance_array + * self_distance_array + * capped_distance + * self_capped_distance + * transform_RtoS + * transform_StoR + * calc_bonds + * calc_angles + * calc_dihedrals + * apply_PBC + """ + + max_cut = 0.25 # max_cutoff parameter for *capped_distance() + min_cut = 0.0 # optional min_cutoff parameter for *capped_distance() + + boxes = ([1.0, 1.0, 1.0, 90.0, 90.0, 90.0], # orthorhombic + [1.0, 1.0, 1.0, 80.0, 80.0, 80.0], # triclinic + None) # no PBC + + @staticmethod + @pytest.fixture() + def empty_coord(): + # empty coordinate array: + return np.empty((0, 3), dtype=np.float32) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_distance_array(self, empty_coord, box, backend): + res = distances.distance_array(empty_coord, empty_coord, box=box, + backend=backend) + assert_equal(res, np.empty((0, 0), dtype=np.float64)) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_self_distance_array(self, empty_coord, box, backend): + res = distances.self_distance_array(empty_coord, box=box, + backend=backend) + assert_equal(res, np.empty((0,), dtype=np.float64)) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('min_cut', [min_cut, None]) + @pytest.mark.parametrize('ret_dist', [False, True]) + @pytest.mark.parametrize('met', ["bruteforce", "pkdtree", "nsgrid", None]) + def test_empty_input_capped_distance(self, empty_coord, min_cut, box, met, + ret_dist): + res = distances.capped_distance(empty_coord, empty_coord, + max_cutoff=self.max_cut, + min_cutoff=min_cut, box=box, method=met, + return_distances=ret_dist) + if ret_dist: + assert_equal(res[0], np.empty((0, 2), dtype=np.int64)) + assert_equal(res[1], np.empty((0,), dtype=np.float64)) + else: + assert_equal(res, np.empty((0, 2), dtype=np.int64)) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('min_cut', [min_cut, None]) + @pytest.mark.parametrize('met', ["bruteforce", "pkdtree", "nsgrid", None]) + def test_empty_input_self_capped_distance(self, empty_coord, min_cut, box, + met): + res = distances.self_capped_distance(empty_coord, + max_cutoff=self.max_cut, + min_cutoff=min_cut, box=box, + method=met) + assert_equal(res[0], np.empty((0, 2), dtype=np.int64)) + assert_equal(res[1], np.empty((0,), dtype=np.float64)) + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_transform_RtoS(self, empty_coord, box, backend): + res = distances.transform_RtoS(empty_coord, box, backend=backend) + assert_equal(res, empty_coord) + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_transform_StoR(self, empty_coord, box, backend): + res = distances.transform_StoR(empty_coord, box, backend=backend) + assert_equal(res, empty_coord) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_calc_bonds(self, empty_coord, box, backend): + res = distances.calc_bonds(empty_coord, empty_coord, box=box, + backend=backend) + assert_equal(res, np.empty((0,), dtype=np.float64)) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_calc_angles(self, empty_coord, box, backend): + res = distances.calc_angles(empty_coord, empty_coord, empty_coord, + box=box, backend=backend) + assert_equal(res, np.empty((0,), dtype=np.float64)) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_calc_dihedrals(self, empty_coord, box, backend): + res = distances.calc_dihedrals(empty_coord, empty_coord, empty_coord, + empty_coord, box=box, backend=backend) + assert_equal(res, np.empty((0,), dtype=np.float64)) + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_empty_input_apply_PBC(self, empty_coord, box, backend): + res = distances.apply_PBC(empty_coord, box, backend=backend) + assert_equal(res, empty_coord) + + +class TestOutputTypes(object): + """Tests ensuring that the following functions in MDAnalysis.lib.distances + return results of the types stated in the docs: + * distance_array: + - numpy.ndarray (shape=(n, m), dtype=numpy.float64) + * self_distance_array: + - numpy.ndarray (shape=(n*(n-1)//2,), dtype=numpy.float64) + * capped_distance: + - numpy.ndarray (shape=(n, 2), dtype=numpy.int64) + - numpy.ndarray (shape=(n,), dtype=numpy.float64) (optional) + * self_capped_distance: + - numpy.ndarray (shape=(n, 2), dtype=numpy.int64) + - numpy.ndarray (shape=(n,), dtype=numpy.float64) + * transform_RtoS: + - numpy.ndarray (shape=input.shape, dtype=numpy.float32) + * transform_StoR: + - numpy.ndarray (shape=input.shape, dtype=numpy.float32) + * calc_bonds: + - numpy.ndarray (shape=(n,), dtype=numpy.float64) for at least one + shape (n,3) input, or numpy.float64 if all inputs are of shape (3,) + * calc_angles: + - numpy.ndarray (shape=(n,), dtype=numpy.float64) for at least one + shape (n,3) input, or numpy.float64 if all inputs are of shape (3,) + * calc_dihedrals: + - numpy.ndarray (shape=(n,), dtype=numpy.float64) for at least one + shape (n,3) input, or numpy.float64 for if all inputs are of + shape (3,) + * apply_PBC: + - numpy.ndarray (shape=input.shape, dtype=numpy.float32) + """ + max_cut = 0.25 # max_cutoff parameter for *capped_distance() + min_cut = 0.0 # optional min_cutoff parameter for *capped_distance() + + boxes = ([1.0, 1.0, 1.0, 90.0, 90.0, 90.0], # orthorhombic + [1.0, 1.0, 1.0, 80.0, 80.0, 80.0], # triclinic + None) # no PBC + + coords = [np.empty((0, 3), dtype=np.float32), # empty coord array + np.array([[0.1, 0.1, 0.1]], dtype=np.float32), # coord array + np.array([0.1, 0.1, 0.1], dtype=np.float32), # single coord + np.array([[-1.1, -1.1, -1.1]], dtype=np.float32)] # outside box + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('incoords', list(comb(coords, 2))) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_type_distance_array(self, incoords, box, backend): + res = distances.distance_array(*incoords, box=box, backend=backend) + assert type(res) == np.ndarray + assert res.shape == (incoords[0].shape[0] % 2, incoords[1].shape[0] % 2) + assert res.dtype.type == np.float64 + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('incoords', coords) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_type_self_distance_array(self, incoords, box, backend): + res = distances.self_distance_array(incoords, box=box, backend=backend) + assert type(res) == np.ndarray + assert res.shape == (0,) + assert res.dtype.type == np.float64 + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('min_cut', [min_cut, None]) + @pytest.mark.parametrize('ret_dist', [False, True]) + @pytest.mark.parametrize('incoords', list(comb(coords, 2))) + @pytest.mark.parametrize('met', ["bruteforce", "pkdtree", "nsgrid", None]) + def test_output_type_capped_distance(self, incoords, min_cut, box, met, + ret_dist): + res = distances.capped_distance(*incoords, max_cutoff=self.max_cut, + min_cutoff=min_cut, box=box, method=met, + return_distances=ret_dist) + if ret_dist: + pairs, dist = res + else: + pairs = res + assert type(pairs) == np.ndarray + assert pairs.dtype.type == np.int64 + assert pairs.ndim == 2 + assert pairs.shape[1] == 2 + if ret_dist: + assert type(dist) == np.ndarray + assert dist.dtype.type == np.float64 + assert dist.shape == (pairs.shape[0],) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('min_cut', [min_cut, None]) + @pytest.mark.parametrize('incoords', coords) + @pytest.mark.parametrize('met', ["bruteforce", "pkdtree", "nsgrid", None]) + def test_output_type_self_capped_distance(self, incoords, min_cut, box, + met): + pairs, dist = distances.self_capped_distance(incoords, + max_cutoff=self.max_cut, + min_cutoff=min_cut, + box=box, method=met) + assert type(pairs) == np.ndarray + assert type(dist) == np.ndarray + assert pairs.dtype.type == np.int64 + assert dist.dtype.type == np.float64 + assert pairs.ndim == 2 + assert pairs.shape[1] == 2 + assert dist.shape == (pairs.shape[0],) + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('incoords', coords) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_dtype_transform_RtoS(self, incoords, box, backend): + res = distances.transform_RtoS(incoords, box, backend=backend) + assert type(res) == np.ndarray + assert res.dtype.type == np.float32 + assert res.shape == incoords.shape + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('incoords', coords) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_dtype_transform_RtoS(self, incoords, box, backend): + res = distances.transform_RtoS(incoords, box, backend=backend) + assert type(res) == np.ndarray + assert res.dtype.type == np.float32 + assert res.shape == incoords.shape + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('incoords', + [2 * [coords[0]]] + list(comb(coords[1:], 2))) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_type_calc_bonds(self, incoords, box, backend): + res = distances.calc_bonds(*incoords, box=box, backend=backend) + maxdim = max([crd.ndim for crd in incoords]) + if maxdim == 1: + assert type(res) == np.float64 + else: + assert type(res) == np.ndarray + assert res.dtype.type == np.float64 + coord = [crd for crd in incoords if crd.ndim == maxdim][0] + assert res.shape == (coord.shape[0],) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('incoords', + [3 * [coords[0]]] + list(comb(coords[1:], 3))) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_type_calc_angles(self, incoords, box, backend): + res = distances.calc_angles(*incoords, box=box, backend=backend) + maxdim = max([crd.ndim for crd in incoords]) + if maxdim == 1: + assert type(res) == np.float64 + else: + assert type(res) == np.ndarray + assert res.dtype.type == np.float64 + coord = [crd for crd in incoords if crd.ndim == maxdim][0] + assert res.shape == (coord.shape[0],) + + @pytest.mark.parametrize('box', boxes) + @pytest.mark.parametrize('incoords', + [4 * [coords[0]]] + list(comb(coords[1:], 4))) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_type_calc_dihedrals(self, incoords, box, backend): + res = distances.calc_dihedrals(*incoords, box=box, backend=backend) + maxdim = max([crd.ndim for crd in incoords]) + if maxdim == 1: + assert type(res) == np.float64 + else: + assert type(res) == np.ndarray + assert res.dtype.type == np.float64 + coord = [crd for crd in incoords if crd.ndim == maxdim][0] + assert res.shape == (coord.shape[0],) + + @pytest.mark.parametrize('box', boxes[:2]) + @pytest.mark.parametrize('incoords', coords) + @pytest.mark.parametrize('backend', ['serial', 'openmp']) + def test_output_type_apply_PBC(self, incoords, box, backend): + res = distances.apply_PBC(incoords, box, backend=backend) + assert type(res) == np.ndarray + assert res.dtype.type == np.float32 + assert res.shape == incoords.shape + + +class TestDistanceBackendSelection(object): + @staticmethod + @pytest.fixture() + def backend_selection_pos(): + positions = np.random.rand(10, 3) + N = positions.shape[0] + result = np.empty(N * (N - 1) // 2, dtype=np.float64) + + return positions, result + + @pytest.mark.parametrize('backend', [ + "serial", "Serial", "SeRiAL", "SERIAL", + "openmp", "OpenMP", "oPENmP", "OPENMP", + ]) + def test_case_insensitivity(self, backend, backend_selection_pos): + positions, result = backend_selection_pos + try: + distances._run("calc_self_distance_array", args=(positions, result), + backend=backend) + except RuntimeError: + pytest.fail("Failed to understand backend {0}".format(backend)) + + def test_wront_backend(self, backend_selection_pos): + positions, result = backend_selection_pos + with pytest.raises(ValueError): + distances._run("calc_self_distance_array", args=(positions, result), + backend="not implemented stuff") + +def test_used_openmpflag(): + assert isinstance(distances.USED_OPENMP, bool) diff --git a/testsuite/MDAnalysisTests/lib/test_neighborsearch.py b/testsuite/MDAnalysisTests/lib/test_neighborsearch.py index 226ba7fac42..6f0675d430e 100644 --- a/testsuite/MDAnalysisTests/lib/test_neighborsearch.py +++ b/testsuite/MDAnalysisTests/lib/test_neighborsearch.py @@ -41,8 +41,8 @@ def universe(): def test_search(universe): - """simply check that for a centered protein in a large box pkdtree - and kdtree return the same result""" + """simply check that for a centered protein in a large box periodic + and non-periodic return the same result""" ns = NeighborSearch.AtomNeighborSearch(universe.atoms) pns = NeighborSearch.AtomNeighborSearch(universe.atoms, universe.atoms.dimensions) diff --git a/testsuite/MDAnalysisTests/lib/test_nsgrid.py b/testsuite/MDAnalysisTests/lib/test_nsgrid.py new file mode 100644 index 00000000000..03b3e24c7d3 --- /dev/null +++ b/testsuite/MDAnalysisTests/lib/test_nsgrid.py @@ -0,0 +1,216 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2018 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# + +from __future__ import print_function, absolute_import + +import pytest + +from numpy.testing import assert_equal, assert_allclose +import numpy as np + +import MDAnalysis as mda +from MDAnalysisTests.datafiles import GRO, Martini_membrane_gro +from MDAnalysis.lib import nsgrid + + +@pytest.fixture +def universe(): + u = mda.Universe(GRO) + return u + +def run_grid_search(u, ref_id, cutoff=3): + coords = u.atoms.positions + searchcoords = u.atoms.positions[ref_id] + if searchcoords.shape == (3, ): + searchcoords = searchcoords[None, :] + # Run grid search + searcher = nsgrid.FastNS(cutoff, coords, box=u.dimensions) + + return searcher.search(searchcoords) + + +def test_pbc_box(): + """Check that PBC box accepts only well-formated boxes""" + pbc = True + with pytest.raises(TypeError): + nsgrid.PBCBox([]) + + with pytest.raises(ValueError): + nsgrid.PBCBox(np.zeros((3)), pbc) # Bad shape + nsgrid.PBCBox(np.zeros((3, 3)), pbc) # Collapsed box + nsgrid.PBCBOX(np.array([[0, 0, 0], [0, 1, 0], [0, 0, 1]]), pbc) # 2D box + nsgrid.PBCBOX(np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), pbc) # Box provided as array of integers + nsgrid.PBCBOX(np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], dtype=float), pbc) # Box provided as array of double + + +def test_nsgrid_badcutoff(universe): + with pytest.raises(ValueError): + run_grid_search(universe, 0, -4) + run_grid_search(universe, 0, 100000) + + +def test_ns_grid_noneighbor(universe): + """Check that grid search returns empty lists/arrays when there is no neighbors""" + ref_id = 0 + cutoff = 0.5 + + results_grid = run_grid_search(universe, ref_id, cutoff) + + # same indices will be selected as neighbour here + assert len(results_grid.get_distances()[0]) == 1 + assert len(results_grid.get_indices()[0]) == 1 + assert len(results_grid.get_pairs()) == 1 + assert len(results_grid.get_pair_distances()) == 1 + + +def test_nsgrid_PBC_rect(): + """Check that nsgrid works with rect boxes and PBC""" + ref_id = 191 + results = np.array([191, 192, 672, 682, 683, 684, 995, 996, 2060, 2808, 3300, 3791, + 3792]) - 1 # Atomid are from gmx select so there start from 1 and not 0. hence -1! + + universe = mda.Universe(Martini_membrane_gro) + cutoff = 7 + + # FastNS is called differently to max coverage + searcher = nsgrid.FastNS(cutoff, universe.atoms.positions, box=universe.dimensions) + + results_grid = searcher.search(universe.atoms.positions[ref_id][None, :]).get_indices()[0] + + results_grid2 = searcher.search(universe.atoms.positions).get_indices() # call without specifying any ids, should do NS for all beads + + assert_equal(np.sort(results), np.sort(results_grid)) + assert_equal(len(universe.atoms), len(results_grid2)) + assert searcher.cutoff == 7 + assert_equal(np.sort(results_grid), np.sort(results_grid2[ref_id])) + + +def test_nsgrid_PBC(universe): + """Check that grid search works when PBC is needed""" + + ref_id = 13937 + results = np.array([4398, 4401, 13938, 13939, 13940, 13941, 17987, 23518, 23519, 23521, 23734, + 47451]) - 1 # Atomid are from gmx select so there start from 1 and not 0. hence -1! + + results_grid = run_grid_search(universe, ref_id).get_indices()[0] + + assert_equal(np.sort(results), np.sort(results_grid)) + + +def test_nsgrid_pairs(universe): + """Check that grid search returns the proper pairs""" + + ref_id = 13937 + neighbors = np.array([4398, 4401, 13938, 13939, 13940, 13941, 17987, 23518, 23519, 23521, 23734, + 47451]) - 1 # Atomid are from gmx select so there start from 1 and not 0. hence -1! + results = [] + + results = np.array(results) + + results_grid = run_grid_search(universe, ref_id).get_pairs() + + assert_equal(np.sort(neighbors, axis=0), np.sort(results_grid[:, 1], axis=0)) + + +def test_nsgrid_pair_distances(universe): + """Check that grid search returns the proper pair distances""" + + ref_id = 13937 + results = np.array([0.0, 0.270, 0.285, 0.096, 0.096, 0.015, 0.278, 0.268, 0.179, 0.259, 0.290, + 0.270]) * 10 # These distances where obtained by gmx distance so they are in nm + + results_grid = run_grid_search(universe, ref_id).get_pair_distances() + + assert_allclose(np.sort(results), np.sort(results_grid), atol=1e-2) + + +def test_nsgrid_distances(universe): + """Check that grid search returns the proper distances""" + + ref_id = 13937 + results = np.array([0.0, 0.270, 0.285, 0.096, 0.096, 0.015, 0.278, 0.268, 0.179, 0.259, 0.290, + 0.270]) * 10 # These distances where obtained by gmx distance so they are in nm + + results_grid = run_grid_search(universe, ref_id).get_distances()[0] + + assert_allclose(np.sort(results), np.sort(results_grid), atol=1e-2) + + +@pytest.mark.parametrize('box, results', + ((None, [3, 13, 24]), + (np.array([10., 10., 10., 90., 90., 90.]), [3, 13, 24, 39, 67]), + (np.array([10., 10., 10., 60., 75., 90.]), [3, 13, 24, 39, 60, 79]))) +def test_nsgrid_search(box, results): + np.random.seed(90003) + points = (np.random.uniform(low=0, high=1.0, + size=(100, 3))*(10.)).astype(np.float32) + cutoff = 2.0 + query = np.array([1., 1., 1.], dtype=np.float32).reshape((1, 3)) + + if box is None: + pseudobox = np.zeros(6, dtype=np.float32) + all_coords = np.concatenate([points, query]) + lmax = all_coords.max(axis=0) + lmin = all_coords.min(axis=0) + pseudobox[:3] = 1.1*(lmax - lmin) + pseudobox[3:] = 90. + shiftpoints, shiftquery = points.copy(), query.copy() + shiftpoints -= lmin + shiftquery -= lmin + searcher = nsgrid.FastNS(cutoff, shiftpoints, box=pseudobox, pbc=False) + searchresults = searcher.search(shiftquery) + else: + searcher = nsgrid.FastNS(cutoff, points, box) + searchresults = searcher.search(query) + indices = searchresults.get_indices()[0] + assert_equal(np.sort(indices), results) + + +@pytest.mark.parametrize('box, result', + ((None, 21), + (np.array([0., 0., 0., 90., 90., 90.]), 21), + (np.array([10., 10., 10., 90., 90., 90.]), 26), + (np.array([10., 10., 10., 60., 75., 90.]), 33))) +def test_nsgrid_selfsearch(box, result): + np.random.seed(90003) + points = (np.random.uniform(low=0, high=1.0, + size=(100, 3))*(10.)).astype(np.float32) + cutoff = 1.0 + if box is None or np.allclose(box[:3], 0): + # create a pseudobox + # define the max range + # and supply the pseudobox + # along with only one set of coordinates + pseudobox = np.zeros(6, dtype=np.float32) + lmax = points.max(axis=0) + lmin = points.min(axis=0) + pseudobox[:3] = 1.1*(lmax - lmin) + pseudobox[3:] = 90. + shiftref = points.copy() + shiftref -= lmin + searcher = nsgrid.FastNS(cutoff, shiftref, box=pseudobox, pbc=False) + searchresults = searcher.self_search() + else: + searcher = nsgrid.FastNS(cutoff, points, box=box) + searchresults = searcher.self_search() + pairs = searchresults.get_pairs() + assert_equal(len(pairs)//2, result) diff --git a/testsuite/MDAnalysisTests/lib/test_pkdtree.py b/testsuite/MDAnalysisTests/lib/test_pkdtree.py index f4fbbee239d..57dd947e55c 100644 --- a/testsuite/MDAnalysisTests/lib/test_pkdtree.py +++ b/testsuite/MDAnalysisTests/lib/test_pkdtree.py @@ -21,63 +21,15 @@ # from __future__ import print_function, absolute_import -from six.moves import zip -from itertools import product import pytest import numpy as np -from numpy.testing import assert_equal, assert_almost_equal +from numpy.testing import assert_equal -from MDAnalysis.lib.pkdtree import PeriodicKDTree -from MDAnalysis.lib.mdamath import triclinic_vectors, triclinic_box -from MDAnalysis.lib.distances import (_box_check, transform_RtoS, - transform_StoR, apply_PBC) - -# -# Testing initialization with different boxes. -# -boxes_1 = (np.array([1, 2, 3, 90, 90, 90], dtype=np.float32), # ortho - np.array([1, 2, 3, 30, 45, 60], dtype=np.float32), # tri_box - triclinic_vectors( # tri_vecs - np.array([1, 2, 3, 90, 90, 45], dtype=np.float32)), - np.array([[0.5, 0.9, 1.9], # tri_vecs_bad - [2.0, 0.4, 0.1], - [0.0, 0.6, 0.5]], dtype=np.float32) - ) -rec_m = (np.array([[1, 0, 0], - [0, 1, 0], - [0, 0, 1]], dtype=np.float32), - np.array([[0.67044002, -0.38707867, -0.6329931], - [0, 0.54741204, -0.83686334], - [0, 0, 1]], dtype=np.float32), - np.array([[0.707106829, -0.707106829, 0], - [0, 1, 0], - [0, 0, 1]], dtype=np.float32), - np.array([[0.42783618, -0.16049984, -0.88949198], - [-0, 0.95654362, 0.29158944], - [0, 0, 1]], dtype=np.float32), - ) - - -@pytest.mark.parametrize('box, rm', zip(boxes_1, rec_m)) -def test_initialize_bm(box, rm): - """ - Assert the construction of the recripocal box matrix. - """ - assert_almost_equal(PeriodicKDTree(box)._rm, rm, decimal=7) - - -def test_set_coords(): - match = 'coords must be a sequence of 3 dimensional coordinates' - with pytest.raises(ValueError, match=match): - xy = np.array([[2, 2], [5, 5], [1.1, 1.1]], dtype=np.float32) - tree = PeriodicKDTree(boxes_1[0]) - tree.set_coords(xy) +from MDAnalysis.lib.pkdtree import PeriodicKDTree +from MDAnalysis.lib.distances import transform_StoR -# -# Testing for correct images generation for a given query point. -# # fractional coordinates for data points f_dataset = np.array([[0.2, 0.2, 0.2], # center of the box @@ -87,124 +39,116 @@ def test_set_coords(): [2.1, 2.1, 0.3]], # wrapped to [1, 1, 3] dtype=np.float32) -radius = 1.5 - -boxes_2 = ([10, 10, 10, 90, 90, 90], # ortho - [10, 10, 10, 45, 60, 90]) # tri_box - -# Find images for several query points, here in fractional coordinates. -queries = ([0.1, 0.5, 0.5], # box face - [0.5, 0.5, 0.5], # box center - [0.5, -0.1, 0.5], # box face - [0.1, 0.1, 0.5], # box edge - [0.5, -0.1, 1.1], # box edge - [0.1, 0.1, 0.1], # box vertex - [0.1, -0.1, 1.1], # box vertex - [2.1, -3.1, 0.1] # box vertex - ) - -# Images for the previous query vectors, here in fractional coordinates. -images = (([1.1, 0.5, 0.5],), - (), - ([0.5, -0.1, 0.5],), - ([1.1, 0.1, 0.5], [0.1, 1.1, 0.5], [1.1, 1.1, 0.5]), - ([0.5, -0.1, 0.1], [0.5, 0.9, 1.1], [0.5, -0.1, 1.1]), - ([1.1, 0.1, 0.1], [0.1, 1.1, 0.1], [0.1, 0.1, 1.1], - [0.1, 1.1, 1.1], [1.1, 1.1, 0.1], [1.1, 0.1, 1.1], - [1.1, 1.1, 1.1]), - ([1.1, 0.9, 0.1], [0.1, -0.1, 0.1], [0.1, 0.9, 1.1], - [0.1, -0.1, 1.1], [1.1, -0.1, 0.1], [1.1, 0.9, 1.1], - [1.1, -0.1, 1.1]), - ([1.1, 0.9, 0.1], [0.1, -0.1, 0.1], [0.1, 0.9, 1.1], - [0.1, -0.1, 1.1], [1.1, -0.1, 0.1], [1.1, 0.9, 1.1], - [1.1, -0.1, 1.1])) - - -@pytest.mark.parametrize('b, qcs', product(boxes_2, zip(queries, images))) -def test_find_images(b, qcs): - """ - Test the generation of images for a given query vector and type of box. - - Parameters - ---------- - b : list - MDAnalysis dimensions like list - qns : tuple - a query point and a list of expected neighbors. - """ + +@pytest.mark.parametrize('b, cut, result', ( + (None, 1.0, + 'Donot provide cutoff distance' + ' for non PBC aware calculations'), + ([10, 10, 10, 90, 90, 90], None, + 'Provide a cutoff distance with' + ' tree.set_coords(...)'))) +def test_setcoords(b, cut, result): + coords = np.array([[1, 1, 1], [2, 2, 2]], dtype=np.float32) + if b is not None: + b = np.array(b, dtype=np.float32) + tree = PeriodicKDTree(box=b) + print(b, tree.box, cut, result) + with pytest.raises(RuntimeError, match=result): + tree.set_coords(coords, cutoff=cut) + + +def test_searchfail(): + coords = np.array([[1, 1, 1], [2, 2, 2]], dtype=np.float32) + b = np.array([10, 10, 10, 90, 90, 90], dtype=np.float32) + cutoff = 1.0 + search_radius = 2.0 + query = np.array([1, 1, 1], dtype=np.float32) + tree = PeriodicKDTree(box=b) + tree.set_coords(coords, cutoff=cutoff) + match = 'Set cutoff greater or equal to the radius.' + with pytest.raises(RuntimeError, match=match): + tree.search(query, search_radius) + + +@pytest.mark.parametrize('b, q, result', ( + ([10, 10, 10, 90, 90, 90], [0.5, -0.1, 1.1], []), + ([10, 10, 10, 90, 90, 90], [2.1, -3.1, 0.1], [2, 3, 4]), + ([10, 10, 10, 45, 60, 90], [2.1, -3.1, 0.1], [2, 3]) + )) +def test_search(b, q, result): b = np.array(b, dtype=np.float32) - q = transform_StoR(np.array(qcs[0], dtype=np.float32), b) - tree = PeriodicKDTree(b) + q = transform_StoR(np.array(q, dtype=np.float32), b) + cutoff = 3.0 coords = transform_StoR(f_dataset, b) - tree.set_coords(coords) # Input real space coordinates - cs = np.sort(transform_StoR(np.array(qcs[1], dtype=np.float32), b), axis=0) - q_wrapped = apply_PBC(q.reshape((1, 3)), b) - found_images = np.sort(tree.find_images(q_wrapped, radius), axis=0) - assert_almost_equal(found_images, cs, decimal=6) - - -# -# Testing for neighbor finding -# - -# Find neighbors for a given query vector, here in fractional coordinates. -queries_2 = ([0.5, 0.5, 0.5], # case box center - [0, 1, 0.07], # box face - [0.1, 0.1, 0.5], # box edge - [0.1, 0.1, 0.1], # box vertex - ([-1.9, 4.2, 0.2], [2.1, -3.1, 0.1]) # multiple queries - ) -# Expected neighbors of queries_2 in the orthogonal box case, here in -# fractional coordinates. -n_ortho = (([0.5, 0.5, 0.5],), - ([1.1, -1.1, 1.1], ), - (), - ([0.11, 0.11, 0.11], ), - ([0.2, 0.2, 0.2], [0.11, 0.11, 0.11], [2.1, 2.1, 0.3], - [1.1, -1.1, 1.1]) - ) -# Expected neighbors for previous queries in the trigonal box case -n_tric = (([0.5, 0.5, 0.5],), - ([1.1, -1.1, 1.1], ), - (), - ([0.11, 0.11, 0.11], ), - ([0.2, 0.2, 0.2], [2.1, 2.1, 0.3], [1.1, -1.1, 1.1]) - ) - -# Combinations of boxes, query points, and expected neighbors. -doublets = list() -for b, n in zip(boxes_2, (n_ortho, n_tric)): - doublets.extend(list(product([b], zip(queries_2, n)))) - - -@pytest.mark.parametrize('b, qns', doublets) -def test_search(b, qns): - """ - Test finding neighbors for a given query vector and type of box. - - Parameters - ---------- - b : list - MDAnalysis dimensions like list - qns : tuple - a query point and a list of expected neighbors. - """ + tree = PeriodicKDTree(box=b) + tree.set_coords(coords, cutoff=cutoff) + indices = tree.search(q, cutoff) + assert_equal(indices, result) + + +def test_nopbc(): + cutoff = 0.3 + q = np.array([0.2, 0.3, 0.1]) + coords = f_dataset.copy() + tree = PeriodicKDTree(box=None) + tree.set_coords(coords) + indices = tree.search(q, cutoff) + assert_equal(indices, [0, 2]) + + +@pytest.mark.parametrize('b, radius, result', ( + ([10, 10, 10, 90, 90, 90], 2.0, [[0, 2], + [0, 4], + [2, 4]]), + ([10, 10, 10, 45, 60, 90], 2.0, [[0, 4], + [2, 4]]), + ([10, 10, 10, 45, 60, 90], 4.5, + 'Set cutoff greater or equal to the radius.'), + ([10, 10, 10, 45, 60, 90], 0.1, []) + )) +def test_searchpairs(b, radius, result): b = np.array(b, dtype=np.float32) - q = transform_StoR(np.array(qns[0], dtype=np.float32), b) - # Setting up the periodic tree - tree = PeriodicKDTree(b) + cutoff = 2.0 coords = transform_StoR(f_dataset, b) - tree.set_coords(coords) # Input real space coordinates - # Carry out the search and retrieve results - tree.search(q, radius) - indices = tree.get_indices() - if indices: - found_neighbors = np.sort(coords[indices], axis=0) - else: - found_neighbors = list() - if qns[1]: - expected_neighbors = transform_StoR(np.array(qns[1],dtype=np.float32), b) - expected_neighbors = np.sort(expected_neighbors, axis=0) + tree = PeriodicKDTree(box=b) + tree.set_coords(coords, cutoff=cutoff) + if cutoff < radius: + with pytest.raises(RuntimeError, match=result): + indices = tree.search_pairs(radius) else: - expected_neighbors = list() - assert_equal(found_neighbors, expected_neighbors) + indices = tree.search_pairs(radius) + assert_equal(len(indices), len(result)) + + +@pytest.mark.parametrize('radius, result', ((0.1, []), + (0.3, [[0, 2]]))) +def test_ckd_searchpairs_nopbc(radius, result): + coords = f_dataset.copy() + tree = PeriodicKDTree() + tree.set_coords(coords) + indices = tree.search_pairs(radius) + assert_equal(indices, result) + + +@pytest.mark.parametrize('b, q, result', ( + ([10, 10, 10, 90, 90, 90], [0.5, -0.1, 1.1], []), + ([10, 10, 10, 90, 90, 90], [2.1, -3.1, 0.1], [[0, 2], + [0, 3], + [0, 4]]), + ([10, 10, 10, 90, 90, 90], [[2.1, -3.1, 0.1], + [0.5, 0.5, 0.5]], [[0, 2], + [0, 3], + [0, 4], + [1, 1]]), + ([10, 10, 10, 45, 60, 90], [2.1, -3.1, 0.1], [[0, 2], + [0, 3]]) + )) +def test_searchtree(b, q, result): + b = np.array(b, dtype=np.float32) + cutoff = 3.0 + coords = transform_StoR(f_dataset, b) + q = transform_StoR(np.array(q, dtype=np.float32), b) + tree = PeriodicKDTree(box=b) + tree.set_coords(coords, cutoff=cutoff) + pairs = tree.search_tree(q, cutoff) + assert_equal(pairs, result) diff --git a/testsuite/MDAnalysisTests/lib/test_util.py b/testsuite/MDAnalysisTests/lib/test_util.py index c010dc887fb..0b1f6343767 100644 --- a/testsuite/MDAnalysisTests/lib/test_util.py +++ b/testsuite/MDAnalysisTests/lib/test_util.py @@ -24,6 +24,10 @@ from six.moves import range, StringIO import pytest +import os +import warnings +import re +import textwrap import numpy as np from numpy.testing import (assert_equal, assert_almost_equal, @@ -32,12 +36,15 @@ import MDAnalysis as mda import MDAnalysis.lib.util as util import MDAnalysis.lib.mdamath as mdamath -from MDAnalysis.lib.util import cached +from MDAnalysis.lib.util import (cached, static_variables, warn_if_not_unique, + check_coords) from MDAnalysis.core.topologyattrs import Bonds -from MDAnalysis.exceptions import NoDataError +from MDAnalysis.exceptions import NoDataError, DuplicateWarning -from MDAnalysisTests.datafiles import Make_Whole +from MDAnalysisTests.datafiles import ( + Make_Whole, TPR, GRO, fullerene, two_water_gro, +) def convert_aa_code_long_data(): @@ -105,7 +112,10 @@ def test_ValueError(self, x): def test_greedy_splitext(inp="foo/bar/boing.2.pdb.bz2", - ref=("foo/bar/boing", ".2.pdb.bz2")): + ref=["foo/bar/boing", ".2.pdb.bz2"]): + inp = os.path.normpath(inp) + ref[0] = os.path.normpath(ref[0]) + ref[1] = os.path.normpath(ref[1]) root, ext = util.greedy_splitext(inp) assert root == ref[0], "root incorrect" assert ext == ref[1], "extension incorrect" @@ -234,6 +244,8 @@ class TestMakeWhole(object): +-----------+ """ + prec = 5 + @pytest.fixture() def universe(self): universe = mda.Universe(Make_Whole) @@ -241,6 +253,29 @@ def universe(self): universe.add_TopologyAttr(Bonds(bondlist)) return universe + def test_single_atom_no_bonds(self): + # Call make_whole on single atom with no bonds, shouldn't move + u = mda.Universe(Make_Whole) + # Atom0 is isolated + bondlist = [(1, 2), (1, 3), (1, 4), (4, 5), (4, 6), (4, 7)] + u.add_TopologyAttr(Bonds(bondlist)) + + ag = u.atoms[[0]] + refpos = ag.positions.copy() + mdamath.make_whole(ag) + + assert_array_almost_equal(ag.positions, refpos) + + def test_scrambled_ag(self, universe): + # if order of atomgroup is mixed + ag = universe.atoms[[1, 3, 2, 4, 0, 6, 5, 7]] + + mdamath.make_whole(ag) + + # artificial system which uses 1nm bonds, so + # largest bond should be 20A + assert ag.bonds.values().max() < 20.1 + @staticmethod @pytest.fixture() def ag(universe): @@ -253,25 +288,11 @@ def test_no_bonds(self): with pytest.raises(NoDataError): mdamath.make_whole(ag) - def test_not_orthogonal(self, universe, ag): - # Not an orthogonal unit cell - - universe.dimensions = [10., 10., 10., 80., 80., 80] - with pytest.raises(ValueError): - mdamath.make_whole(ag) - def test_zero_box_size(self, universe, ag): universe.dimensions = [0., 0., 0., 90., 90., 90.] with pytest.raises(ValueError): mdamath.make_whole(ag) - def test_too_small_box_size(self, universe, ag): - # Set the z dimensions to 0.5, which is small compared to the - # bonds (1-2) - universe.dimensions = [100.0, 100.0, 0.5, 90., 90., 90.] - with pytest.raises(ValueError): - mdamath.make_whole(ag) - def test_wrong_reference_atom(self, universe, ag): # Reference atom not in atomgroup with pytest.raises(ValueError): @@ -282,15 +303,6 @@ def test_impossible_solve(self, universe): with pytest.raises(ValueError): mdamath.make_whole(universe.atoms) - def test_walk_1(self, universe, ag): - # self.ag is contiguous - assert mdamath._is_contiguous(ag, universe.residues[0].atoms[0]) - - def test_walk_2(self, universe): - # u.atoms isnt all contiguous - assert not mdamath._is_contiguous(universe.atoms, - universe.residues[0].atoms[0]) - def test_solve_1(self, universe, ag): # regular usage of function @@ -300,13 +312,13 @@ def test_solve_1(self, universe, ag): assert_array_almost_equal(universe.atoms[:4].positions, refpos) assert_array_almost_equal(universe.atoms[4].position, - np.array([110.0, 50.0, 0.0])) + np.array([110.0, 50.0, 0.0]), decimal=self.prec) assert_array_almost_equal(universe.atoms[5].position, - np.array([110.0, 60.0, 0.0])) + np.array([110.0, 60.0, 0.0]), decimal=self.prec) assert_array_almost_equal(universe.atoms[6].position, - np.array([110.0, 40.0, 0.0])) + np.array([110.0, 40.0, 0.0]), decimal=self.prec) assert_array_almost_equal(universe.atoms[7].position, - np.array([120.0, 50.0, 0.0])) + np.array([120.0, 50.0, 0.0]), decimal=self.prec) def test_solve_2(self, universe, ag): # use but specify the center atom @@ -317,13 +329,13 @@ def test_solve_2(self, universe, ag): assert_array_almost_equal(universe.atoms[4:8].positions, refpos) assert_array_almost_equal(universe.atoms[0].position, - np.array([-20.0, 50.0, 0.0])) + np.array([-20.0, 50.0, 0.0]), decimal=self.prec) assert_array_almost_equal(universe.atoms[1].position, - np.array([-10.0, 50.0, 0.0])) + np.array([-10.0, 50.0, 0.0]), decimal=self.prec) assert_array_almost_equal(universe.atoms[2].position, - np.array([-10.0, 60.0, 0.0])) + np.array([-10.0, 60.0, 0.0]), decimal=self.prec) assert_array_almost_equal(universe.atoms[3].position, - np.array([-10.0, 40.0, 0.0])) + np.array([-10.0, 40.0, 0.0]), decimal=self.prec) def test_solve_3(self, universe): # put in a chunk that doesn't need any work @@ -359,6 +371,39 @@ def test_double_frag_short_bonds(self, universe, ag): with pytest.raises(ValueError): mdamath.make_whole(universe.atoms) + def test_make_whole_triclinic(self): + u = mda.Universe(TPR, GRO) + thing = u.select_atoms('not resname SOL NA+') + mdamath.make_whole(thing) + + blengths = thing.bonds.values() + + assert blengths.max() < 2.0 + + def test_make_whole_fullerene(self): + # lots of circular bonds as a nice pathological case + u = mda.Universe(fullerene) + + bbox = u.atoms.bbox() + u.dimensions[:3] = bbox[1] - bbox[0] + u.dimensions[3:] = 90.0 + + blengths = u.atoms.bonds.values() + # kaboom + u.atoms[::2].translate([u.dimensions[0], -2 * u.dimensions[1], 0.0]) + u.atoms[1::2].translate([0.0, 7 * u.dimensions[1], -5 * u.dimensions[2]]) + + mdamath.make_whole(u.atoms) + + assert_array_almost_equal(u.atoms.bonds.values(), blengths, decimal=self.prec) + + def test_make_whole_multiple_molecules(self): + u = mda.Universe(two_water_gro, guess_bonds=True) + + for f in u.atoms.fragments: + mdamath.make_whole(f) + + assert u.atoms.bonds.values().max() < 2.0 class Class_with_Caches(object): def __init__(self): @@ -926,8 +971,6 @@ def test_blocks_of_1(self): view = util.blocks_of(arr, 1, 1) - # should return a (4, 1, 1) view - # ie 4 lots of 1x1 assert view.shape == (4, 1, 1) assert_array_almost_equal(view, np.array([[[0]], [[5]], [[10]], [[15]]])) @@ -946,7 +989,6 @@ def test_blocks_of_2(self): view = util.blocks_of(arr, 2, 2) - # should return (2, 2, 2) assert view.shape == (2, 2, 2) assert_array_almost_equal(view, np.array([[[0, 1], [4, 5]], [[10, 11], [14, 15]]])) @@ -968,10 +1010,20 @@ def test_blocks_of_3(self): assert view.shape == (4, 2, 1) + def test_blocks_of_4(self): + # testing block exceeding array size results in empty view + arr = np.arange(4).reshape(2, 2) + view = util.blocks_of(arr, 3, 3) + assert view.shape == (0, 3, 3) + view[:] = 100 + assert_array_equal(arr, np.arange(4).reshape(2, 2)) + def test_blocks_of_ValueError(self): arr = np.arange(16).reshape(4, 4) with pytest.raises(ValueError): - util.blocks_of(arr, 2, 1) + util.blocks_of(arr, 2, 1) # blocks don't fit + with pytest.raises(ValueError): + util.blocks_of(arr[:, ::2], 2, 1) # non-contiguous input class TestNamespace(object): @@ -1076,5 +1128,543 @@ def test_flatten_dict(self): assert k[0] in d assert k[1] in d[k[0]] assert result[k] in d[k[0]].values() - - + +class TestStaticVariables(object): + """Tests concerning the decorator @static_variables + """ + + def test_static_variables(self): + x = [0] + + @static_variables(foo=0, bar={'test': x}) + def myfunc(): + assert myfunc.foo is 0 + assert type(myfunc.bar) is type(dict()) + if 'test2' not in myfunc.bar: + myfunc.bar['test2'] = "a" + else: + myfunc.bar['test2'] += "a" + myfunc.bar['test'][0] += 1 + return myfunc.bar['test'] + + assert hasattr(myfunc, 'foo') + assert hasattr(myfunc, 'bar') + + y = myfunc() + assert y is x + assert x[0] is 1 + assert myfunc.bar['test'][0] is 1 + assert myfunc.bar['test2'] == "a" + + x = [0] + y = myfunc() + assert y is not x + assert myfunc.bar['test'][0] is 2 + assert myfunc.bar['test2'] == "aa" + +class TestWarnIfNotUnique(object): + """Tests concerning the decorator @warn_if_not_uniue + """ + + @pytest.fixture() + def warn_msg(self, func, group, group_name): + msg = ("{}.{}(): {} {} contains duplicates. Results might be " + "biased!".format(group.__class__.__name__, func.__name__, + group_name, group.__repr__())) + return msg + + def test_warn_if_not_unique(self, atoms): + # Check that the warn_if_not_unique decorator has a "static variable" + # warn_if_not_unique.warned: + assert hasattr(warn_if_not_unique, 'warned') + assert warn_if_not_unique.warned is False + + def test_warn_if_not_unique_once_outer(self, atoms): + + # Construct a scenario with two nested functions, each one decorated + # with @warn_if_not_unique: + + @warn_if_not_unique + def inner(group): + if not group.isunique: + # The inner function should not trigger a warning, and the state + # of warn_if_not_unique.warned should reflect that: + assert warn_if_not_unique.warned is True + return 0 + + @warn_if_not_unique + def outer(group): + return inner(group) + + # Check that no warning is raised for a unique group: + assert atoms.isunique + with pytest.warns(None) as w: + x = outer(atoms) + assert x is 0 + assert not w.list + + # Check that a warning is raised for a group with duplicates: + ag = atoms + atoms[0] + msg = self.warn_msg(outer, ag, "'ag'") + with pytest.warns(DuplicateWarning) as w: + assert warn_if_not_unique.warned is False + x = outer(ag) + # Assert that the "warned" state is restored: + assert warn_if_not_unique.warned is False + # Check correct function execution: + assert x is 0 + # Only one warning must have been raised: + assert len(w) == 1 + # For whatever reason pytest.warns(DuplicateWarning, match=msg) + # doesn't work, so we compare the recorded warning message instead: + assert w[0].message.args[0] == msg + # Make sure the warning uses the correct stacklevel and references + # this file instead of MDAnalysis/lib/util.py: + assert w[0].filename == __file__ + + def test_warned_state_restored_on_failure(self, atoms): + + # A decorated function raising an exception: + @warn_if_not_unique + def thisfails(group): + raise ValueError() + + ag = atoms + atoms[0] + msg = self.warn_msg(thisfails, ag, "'ag'") + with pytest.warns(DuplicateWarning) as w: + assert warn_if_not_unique.warned is False + with pytest.raises(ValueError): + thisfails(ag) + # Assert that the "warned" state is restored despite `thisfails` + # raising an exception: + assert warn_if_not_unique.warned is False + assert len(w) == 1 + assert w[0].message.args[0] == msg + assert w[0].filename == __file__ + + def test_warn_if_not_unique_once_inner(self, atoms): + + # Construct a scenario with two nested functions, each one decorated + # with @warn_if_not_unique, but the outer function adds a duplicate + # to the group: + + @warn_if_not_unique + def inner(group): + return 0 + + @warn_if_not_unique + def outer(group): + dupgroup = group + group[0] + return inner(dupgroup) + + # Check that even though outer() is called the warning is raised for + # inner(): + msg = self.warn_msg(inner, atoms + atoms[0], "'dupgroup'") + with pytest.warns(DuplicateWarning) as w: + assert warn_if_not_unique.warned is False + x = outer(atoms) + # Assert that the "warned" state is restored: + assert warn_if_not_unique.warned is False + # Check correct function execution: + assert x is 0 + # Only one warning must have been raised: + assert len(w) == 1 + assert w[0].message.args[0] == msg + assert w[0].filename == __file__ + + def test_warn_if_not_unique_multiple_references(self, atoms): + ag = atoms + atoms[0] + aag = ag + aaag = aag + + @warn_if_not_unique + def func(group): + return group.isunique + + # Check that the warning message contains the names of all references to + # the group in alphabetic order: + msg = self.warn_msg(func, ag, "'aaag' a.k.a. 'aag' a.k.a. 'ag'") + with pytest.warns(DuplicateWarning) as w: + x = func(ag) + # Assert that the "warned" state is restored: + assert warn_if_not_unique.warned is False + # Check correct function execution: + assert x is False + # Check warning message: + assert w[0].message.args[0] == msg + # Check correct file referenced: + assert w[0].filename == __file__ + + def test_warn_if_not_unique_unnamed(self, atoms): + + @warn_if_not_unique + def func(group): + pass + + msg = self.warn_msg(func, atoms + atoms[0], + "'unnamed {}'".format(atoms.__class__.__name__)) + with pytest.warns(DuplicateWarning) as w: + func(atoms + atoms[0]) + # Check warning message: + assert w[0].message.args[0] == msg + + def test_warn_if_not_unique_fails_for_non_groupmethods(self): + + @warn_if_not_unique + def func(group): + pass + + class dummy(object): + pass + + with pytest.raises(AttributeError): + func(dummy()) + + def test_filter_duplicate_with_userwarning(self, atoms): + + @warn_if_not_unique + def func(group): + pass + + with warnings.catch_warnings(record=True) as record: + warnings.resetwarnings() + warnings.filterwarnings("ignore", category=UserWarning) + with pytest.warns(None) as w: + func(atoms) + assert not w.list + assert len(record) == 0 + +class TestCheckCoords(object): + """Tests concerning the decorator @check_coords + """ + + prec = 6 + + def test_default_options(self): + a_in = np.zeros(3, dtype=np.float32) + b_in = np.ones(3, dtype=np.float32) + b_in2 = np.ones((2, 3), dtype=np.float32) + + @check_coords('a','b') + def func(a, b): + # check that enforce_copy is True by default: + assert a is not a_in + assert b is not b_in + # check that convert_single is True by default: + assert a.shape == (1, 3) + assert b.shape == (1, 3) + return a + b + + # check that allow_single is True by default: + res = func(a_in, b_in) + # check that reduce_result_if_single is True by default: + assert res.shape == (3,) + # check correct function execution: + assert_array_equal(res, b_in) + + # check that check_lenghts_match is True by default: + with pytest.raises(ValueError): + res = func(a_in, b_in2) + + def test_enforce_copy(self): + + a_2d = np.ones((1, 3), dtype=np.float32) + b_1d = np.zeros(3, dtype=np.float32) + c_2d = np.zeros((1, 6), dtype=np.float32)[:, ::2] + d_2d = np.zeros((1, 3), dtype=np.int64) + + @check_coords('a', 'b', 'c', 'd', enforce_copy=False) + def func(a, b, c, d): + # Assert that if enforce_copy is False: + # no copy is made if input shape, order, and dtype are correct: + assert a is a_2d + # a copy is made if input shape has to be changed: + assert b is not b_1d + # a copy is made if input order has to be changed: + assert c is not c_2d + # a copy is made if input dtype has to be changed: + assert d is not d_2d + # Assert correct dtype conversion: + assert d.dtype == np.float32 + assert_almost_equal(d, d_2d, self.prec) + # Assert all shapes are converted to (1, 3): + assert a.shape == b.shape == c.shape == d.shape == (1, 3) + return a + b + c + d + + # Call func() to: + # - test the above assertions + # - ensure that input of single coordinates is simultaneously possible + # with different shapes (3,) and (1, 3) + res = func(a_2d, b_1d, c_2d, d_2d) + # Since some inputs are not 1d, even though reduce_result_if_single is + # True, the result must have shape (1, 3): + assert res.shape == (1, 3) + # check correct function execution: + assert_array_equal(res, a_2d) + + def test_no_allow_single(self): + + @check_coords('a', allow_single=False) + def func(a): + pass + + with pytest.raises(ValueError) as err: + func(np.zeros(3, dtype=np.float32)) + assert err.msg == ("func(): a.shape must be (n, 3), got (3,).") + + def test_no_convert_single(self): + + a_1d = np.arange(-3, 0, dtype=np.float32) + + @check_coords('a', enforce_copy=False, convert_single=False) + def func(a): + # assert no conversion and no copy were performed: + assert a is a_1d + return a + + res = func(a_1d) + # Assert result has been reduced: + assert res == a_1d[0] + assert type(res) is np.float32 + + def test_no_reduce_result_if_single(self): + + a_1d = np.zeros(3, dtype=np.float32) + + # Test without shape conversion: + @check_coords('a', enforce_copy=False, convert_single=False, + reduce_result_if_single=False) + def func(a): + return a + + res = func(a_1d) + # make sure the input array is just passed through: + assert res is a_1d + + # Test with shape conversion: + @check_coords('a', enforce_copy=False, reduce_result_if_single=False) + def func(a): + return a + + res = func(a_1d) + assert res.shape == (1, 3) + assert_array_equal(res[0], a_1d) + + def test_no_check_lengths_match(self): + + a_2d = np.zeros((1, 3), dtype=np.float32) + b_2d = np.zeros((3, 3), dtype=np.float32) + + @check_coords('a', 'b', enforce_copy=False, check_lengths_match=False) + def func(a, b): + return a, b + + res_a, res_b = func(a_2d, b_2d) + # Assert arrays are just passed through: + assert res_a is a_2d + assert res_b is b_2d + + def test_invalid_input(self): + + a_inv_dtype = np.array([['hello', 'world', '!']]) + a_inv_type = [[0., 0., 0.]] + a_inv_shape_1d = np.zeros(6, dtype=np.float32) + a_inv_shape_2d = np.zeros((3, 2), dtype=np.float32) + + @check_coords('a') + def func(a): + pass + + with pytest.raises(TypeError) as err: + func(a_inv_dtype) + assert err.msg.startswith("func(): a.dtype must be convertible to " + "float32, got ") + + with pytest.raises(TypeError) as err: + func(a_inv_type) + assert err.msg == ("func(): Parameter 'a' must be a numpy.ndarray, " + "got .") + + with pytest.raises(ValueError) as err: + func(a_inv_shape_1d) + assert err.msg == ("func(): a.shape must be (3,) or (n, 3), got " + "(6,).") + + with pytest.raises(ValueError) as err: + func(a_inv_shape_2d) + assert err.msg == ("func(): a.shape must be (3,) or (n, 3), got " + "(3, 2).") + + def test_usage_with_kwargs(self): + + a_2d = np.zeros((1, 3), dtype=np.float32) + + @check_coords('a', enforce_copy=False) + def func(a, b, c=0): + return a, b, c + + # check correct functionality if passed as keyword argument: + a, b, c = func(a=a_2d, b=0, c=1) + assert a is a_2d + assert b == 0 + assert c == 1 + + def test_wrong_func_call(self): + + @check_coords('a', enforce_copy=False) + def func(a, b, c=0): + pass + + # Make sure invalid call marker is present: + func._invalid_call = False + + # usage with posarg doubly defined: + assert not func._invalid_call + with pytest.raises(TypeError): + func(0, a=0) # pylint: disable=redundant-keyword-arg + assert func._invalid_call + func._invalid_call = False + + # usage with missing posargs: + assert not func._invalid_call + with pytest.raises(TypeError): + func(0) + assert func._invalid_call + func._invalid_call = False + + # usage with missing posargs (supplied as kwargs): + assert not func._invalid_call + with pytest.raises(TypeError): + func(a=0, c=1) + assert func._invalid_call + func._invalid_call = False + + # usage with too many posargs: + assert not func._invalid_call + with pytest.raises(TypeError): + func(0, 0, 0, 0) + assert func._invalid_call + func._invalid_call = False + + # usage with unexpected kwarg: + assert not func._invalid_call + with pytest.raises(TypeError): + func(a=0, b=0, c=1, d=1) # pylint: disable=unexpected-keyword-arg + assert func._invalid_call + func._invalid_call = False + + def test_wrong_decorator_usage(self): + + # usage without parantheses: + @check_coords + def func(): + pass + + with pytest.raises(TypeError): + func() + + # usage without arguments: + with pytest.raises(ValueError) as err: + @check_coords() + def func(): + pass + + assert err.msg == ("Decorator check_coords() cannot be used " + "without positional arguments.") + + # usage with defaultarg: + with pytest.raises(ValueError) as err: + @check_coords('a') + def func(a=1): + pass + + assert err.msg == ("In decorator check_coords(): Name 'a' doesn't " + "correspond to any positional argument of the " + "decorated function func().") + + # usage with invalid parameter name: + with pytest.raises(ValueError) as err: + @check_coords('b') + def func(a): + pass + + assert err.msg == ("In decorator check_coords(): Name 'b' doesn't " + "correspond to any positional argument of the " + "decorated function func().") + + +@pytest.mark.parametrize("old_name", (None, "MDAnalysis.Universe")) +@pytest.mark.parametrize("new_name", (None, "Multiverse")) +@pytest.mark.parametrize("remove", (None, "99.0.0", 2099)) +@pytest.mark.parametrize("message", (None, "use the new stuff")) +def test_deprecate(old_name, new_name, remove, message, release="2.7.1"): + def AlternateUniverse(anything): + # important: first line needs to be """\ so that textwrap.dedent() + # works + """\ + AlternateUniverse provides a true view of the Universe. + + Parameters + ---------- + anything : object + + Returns + ------- + truth + + """ + return True + + oldfunc = util.deprecate(AlternateUniverse, old_name=old_name, + new_name=new_name, + release=release, remove=remove, + message=message) + with pytest.warns(DeprecationWarning, match_expr="`.+` is deprecated"): + oldfunc(42) + + doc = oldfunc.__doc__ + name = old_name if old_name else AlternateUniverse.__name__ + + deprecation_line_1 = ".. deprecated:: {0}".format(release) + assert re.search(deprecation_line_1, doc) + + if message: + deprecation_line_2 = message + else: + if new_name is None: + default_message = "`{0}` is deprecated!".format(name) + else: + default_message = "`{0}` is deprecated, use `{1}` instead!".format( + name, new_name) + deprecation_line_2 = default_message + assert re.search(deprecation_line_2, doc) + + if remove: + deprecation_line_3 = "`{0}` will be removed in release {1}".format( + name, remove) + assert re.search(deprecation_line_3, doc) + + # check that the old docs are still present + assert re.search(textwrap.dedent(AlternateUniverse.__doc__), doc) + + +def test_deprecate_missing_release_ValueError(): + with pytest.raises(ValueError): + util.deprecate(mda.Universe) + +def test_set_function_name(name="bar"): + def foo(): + pass + util._set_function_name(foo, name) + assert foo.__name__ == name + +@pytest.mark.parametrize("text", + ("", + "one line text", + " one line with leading space", + "multiline\n\n with some\n leading space", + " multiline\n\n with all\n leading space")) +def test_dedent_docstring(text): + doc = util.dedent_docstring(text) + for line in doc.splitlines(): + assert line == line.lstrip() diff --git a/testsuite/MDAnalysisTests/topology/test_dms.py b/testsuite/MDAnalysisTests/topology/test_dms.py index efcdd5ddcea..322ebf6d779 100644 --- a/testsuite/MDAnalysisTests/topology/test_dms.py +++ b/testsuite/MDAnalysisTests/topology/test_dms.py @@ -56,4 +56,3 @@ def test_atomsels(self, filename): s3 = u.select_atoms("resname ALA") assert len(s3) == 190 - diff --git a/testsuite/MDAnalysisTests/topology/test_gsd.py b/testsuite/MDAnalysisTests/topology/test_gsd.py index 833ad2586f9..eb667059bbe 100644 --- a/testsuite/MDAnalysisTests/topology/test_gsd.py +++ b/testsuite/MDAnalysisTests/topology/test_gsd.py @@ -28,8 +28,11 @@ from MDAnalysisTests.topology.base import ParserBase from MDAnalysisTests.datafiles import GSD from numpy.testing import assert_equal +import os +@pytest.mark.skipif(os.name == 'nt', + reason="gsd not windows compatible") class TestGSDParser(ParserBase): parser = mda.topology.GSDParser.GSDParser ref_filename = GSD diff --git a/testsuite/MDAnalysisTests/topology/test_guessers.py b/testsuite/MDAnalysisTests/topology/test_guessers.py index 574d8bd7a45..7bbb585bf22 100644 --- a/testsuite/MDAnalysisTests/topology/test_guessers.py +++ b/testsuite/MDAnalysisTests/topology/test_guessers.py @@ -25,11 +25,13 @@ from numpy.testing import assert_equal import numpy as np +import MDAnalysis as mda from MDAnalysis.topology import guessers from MDAnalysis.core.topologyattrs import Angles from MDAnalysisTests import make_Universe from MDAnalysisTests.core.test_fragments import make_starshape +from MDAnalysisTests.datafiles import two_water_gro class TestGuessMasses(object): @@ -99,3 +101,12 @@ def test_guess_impropers(): vals = guessers.guess_improper_dihedrals(ag.angles) assert_equal(len(vals), 12) + + +def test_guess_bonds(): + u = mda.Universe(two_water_gro) + bonds = guessers.guess_bonds(u.atoms, u.atoms.positions, u.dimensions) + assert_equal(bonds, ((0, 1), + (0, 2), + (3, 4), + (3, 5))) diff --git a/testsuite/MDAnalysisTests/topology/test_lammpsdata.py b/testsuite/MDAnalysisTests/topology/test_lammpsdata.py index 9a094bdf222..98360215853 100644 --- a/testsuite/MDAnalysisTests/topology/test_lammpsdata.py +++ b/testsuite/MDAnalysisTests/topology/test_lammpsdata.py @@ -35,6 +35,7 @@ LAMMPShyd, LAMMPShyd2, LAMMPSdata_deletedatoms, + LAMMPSDUMP, ) @@ -237,3 +238,33 @@ def test_interpret_atom_style_missing(): match='atom_style string missing required.+?'): style = mda.topology.LAMMPSParser.DATAParser._interpret_atom_style( 'id charge z y x') + + +class TestDumpParser(ParserBase): + expected_attrs = ['types'] + guessed_attrs = ['masses'] + expected_n_atoms = 24 + expected_n_residues = 1 + expected_n_segments = 1 + + parser = mda.topology.LAMMPSParser.LammpsDumpParser + ref_filename = LAMMPSDUMP + + def test_creates_universe(self): + u = mda.Universe(self.ref_filename, format='LAMMPSDUMP') + + assert isinstance(u, mda.Universe) + assert len(u.atoms) == 24 + + def test_masses_warning(self): + # masses are mandatory, but badly guessed + # check that user is alerted + with self.parser(self.ref_filename) as p: + with pytest.warns(UserWarning, match='Guessed all Masses to 1.0'): + p.parse() + + def test_id_ordering(self): + # ids are nonsequential in file, but should get rearranged + u = mda.Universe(self.ref_filename, format='LAMMPSDUMP') + # the 4th in file has id==13, but should have been sorted + assert u.atoms[3].id == 4 diff --git a/testsuite/MDAnalysisTests/topology/test_mmtf.py b/testsuite/MDAnalysisTests/topology/test_mmtf.py index 1389e567745..0c4bfd66051 100644 --- a/testsuite/MDAnalysisTests/topology/test_mmtf.py +++ b/testsuite/MDAnalysisTests/topology/test_mmtf.py @@ -108,11 +108,12 @@ def u(self): class TestMMTFFetch(TestMMTFUniverse): @pytest.fixture() - @mock.patch('mmtf.fetch') - def u(self, mock_fetch): + def u(self): top = mmtf.parse(MMTF) - mock_fetch.return_value = top - return mda.fetch_mmtf('173D') # string is irrelevant + with mock.patch('mmtf.fetch') as mock_fetch: + mock_fetch.return_value = top + + return mda.fetch_mmtf('173D') # string is irrelevant class TestSelectModels(object): diff --git a/testsuite/MDAnalysisTests/topology/test_pdb.py b/testsuite/MDAnalysisTests/topology/test_pdb.py index 74950921365..2182671280d 100644 --- a/testsuite/MDAnalysisTests/topology/test_pdb.py +++ b/testsuite/MDAnalysisTests/topology/test_pdb.py @@ -42,6 +42,29 @@ _PDBPARSER = mda.topology.PDBParser.PDBParser +hybrid36 = [ + ("A0000", 100000), + ("MEGAN", 20929695), + ("J0NNY", 15247214), + ("DREW6", 6417862), + ("ST3V3", 31691119), + ("ADA8M", 719798), + ("a0000", 43770016), + ("megan", 64599711), + ("j0nny", 58917230), + ("drew6", 50087878), + ("st3v3", 75361135), + ("ada8m", 44389814), + (" 6", 6), + (" 24", 24), + (" 645", 645), + (" 4951", 4951), + ("10267", 10267) +] + +@pytest.mark.parametrize('hybrid, integer', hybrid36) +def test_hy36decode(hybrid, integer): + assert mda.topology.PDBParser.hy36decode(5, hybrid) == integer class TestPDBParser(ParserBase): """This one has neither chainids or segids""" @@ -183,3 +206,25 @@ def test_PDB_no_resid(): assert len(u.residues) == 1 # should have default resid of 1 assert u.residues[0].resid == 1 + +PDB_hex = """\ +REMARK For testing reading of hex atom numbers +REMARK This has MODELs then hex atom numbers entries +CRYST1 80.000 80.017 80.017 90.00 90.00 90.00 P 1 1 +MODEL 1 +HETATM 1 H 2 L 400 20.168 00.034 40.428 +HETATMA0000 H 2 L 400 40.168 50.034 40.428 +HETATMA0001 H 2 L 400 30.453 60.495 50.132 +HETATMA0002 H 2 L 400 20.576 40.354 60.483 +HETATMA0003 H 2 L 400 10.208 30.067 70.045 +END +""" + +def test_PDB_hex(): + u = mda.Universe(StringIO(PDB_hex), format='PDB') + assert len(u.atoms) == 5 + assert u.atoms[0].id == 1 + assert u.atoms[1].id == 100000 + assert u.atoms[2].id == 100001 + assert u.atoms[3].id == 100002 + assert u.atoms[4].id == 100003 diff --git a/testsuite/MDAnalysisTests/topology/test_pqr.py b/testsuite/MDAnalysisTests/topology/test_pqr.py index 216a7a71c2d..c6c89ab5d2b 100644 --- a/testsuite/MDAnalysisTests/topology/test_pqr.py +++ b/testsuite/MDAnalysisTests/topology/test_pqr.py @@ -90,7 +90,7 @@ def test_gromacs_flavour(): assert u.atoms[0].type == 'O' assert u.atoms[0].segid == 'SYSTEM' assert not u._topology.types.is_guessed - assert u.atoms[0].radius == pytest.approx(1.48) - assert u.atoms[0].charge == pytest.approx(-0.67) + assert_almost_equal(u.atoms[0].radius, 1.48, decimal=5) + assert_almost_equal(u.atoms[0].charge, -0.67, decimal=5) # coordinatey things assert_almost_equal(u.atoms[0].position, [15.710, 17.670, 23.340], decimal=4) diff --git a/testsuite/MDAnalysisTests/topology/test_top.py b/testsuite/MDAnalysisTests/topology/test_top.py index d493d72fa0d..29008f30971 100644 --- a/testsuite/MDAnalysisTests/topology/test_top.py +++ b/testsuite/MDAnalysisTests/topology/test_top.py @@ -21,6 +21,7 @@ # from __future__ import absolute_import import MDAnalysis as mda +import pytest from MDAnalysisTests.topology.base import ParserBase from MDAnalysisTests.datafiles import ( @@ -28,13 +29,18 @@ PRM12, # anti.top PRM7, # tz2.truncoct.parm7.bz2 PRMpbc, + PRMNCRST, + PRMErr1, + PRMErr2, + PRMErr3 ) class TOPBase(ParserBase): parser = mda.topology.TOPParser.TOPParser expected_attrs = [ - "names", "types", "type_indices", "charges", "masses", "resnames" + "names", "types", "type_indices", "charges", "masses", "resnames", + "bonds", "angles", "dihedrals", "impropers" ] expected_n_segments = 1 @@ -45,30 +51,232 @@ def test_attr_size(self, top): assert len(top.charges) == self.expected_n_atoms assert len(top.masses) == self.expected_n_atoms assert len(top.resnames) == self.expected_n_residues + assert len(top.bonds.values) == self.expected_n_bonds + assert len(top.angles.values) == self.expected_n_angles + assert len(top.dihedrals.values) == self.expected_n_dihedrals + assert len(top.impropers.values) == self.expected_n_impropers + + def test_bonds_atom_counts(self, filename): + u = mda.Universe(filename) + assert len(u.atoms[[0]].bonds) == self.expected_n_zero_bonds + assert len(u.atoms[[self.atom_i]].bonds) == self.expected_n_i_bonds + + def test_angles_atom_counts(self, filename): + u = mda.Universe(filename) + assert len(u.atoms[[0]].angles) == self.expected_n_zero_angles + assert len(u.atoms[[self.atom_i]].angles) == self.expected_n_i_angles + + def test_dihedrals_atom_counts(self, filename): + u = mda.Universe(filename) + assert len(u.atoms[[0]].dihedrals) == self.expected_n_zero_dihedrals + assert len(u.atoms[[self.atom_i]].dihedrals) == \ + self.expected_n_i_dihedrals + + def test_impropers_atom_counts(self, filename): + u = mda.Universe(filename) + assert len(u.atoms[[0]].impropers) == self.expected_n_zero_impropers + assert len(u.atoms[[self.atom_i]].impropers) == \ + self.expected_n_i_impropers + + def test_bonds_identity(self, top): + vals = top.bonds.values + for bond in self.atom_zero_bond_values: + assert (bond in vals) or (bond[::-1] in vals) + for bond in self.atom_i_bond_values: + assert (bond in vals) or (bond[::-1] in vals) + + def test_angles_identity(self, top): + vals = top.angles.values + for ang in self.atom_zero_angle_values: + assert (ang in vals) or (ang[::-1] in vals) + for ang in self.atom_i_angle_values: + assert (ang in vals) or (ang[::-1] in vals) + + def test_dihedrals_identity(self, top): + vals = top.dihedrals.values + for dih in self.atom_zero_dihedral_values: + assert (dih in vals) or (dih[::-1] in vals) + for dih in self.atom_i_dihedral_values: + assert (dih in vals) or (dih[::-1] in vals) + + def test_impropers_identity(self, top): + vals = top.impropers.values + for imp in self.atom_zero_improper_values: + assert (imp in vals) or (imp[::-1] in vals) + for imp in self.atom_i_improper_values: + assert (imp in vals) or (imp[::-1] in vals) + + def test_angle_atoms_bonded(self, top): + vals = top.bonds.values + for ang in top.angles.values: + for b in ((ang[0], ang[1]), (ang[1], ang[2])): + assert (b in vals) or (b[::-1] in vals) + + def test_dihedral_atoms_bonded(self, top): + vals = top.bonds.values + for dih in top.dihedrals.values: + for b in ((dih[0], dih[1]), (dih[1], dih[2]), (dih[2], dih[3])): + assert (b in vals) or (b[::-1] in vals) + + def test_improper_atoms_bonded(self, top): + vals = top.bonds.values + for imp in top.impropers.values: + for b in ((imp[0], imp[2]), (imp[1], imp[2]), (imp[2], imp[3])): + assert (b in vals) or (b[::-1] in vals) class TestPRMParser(TOPBase): ref_filename = PRM expected_n_atoms = 252 expected_n_residues = 14 + expected_n_bonds = 259 + expected_n_angles = 456 + expected_n_dihedrals = 673 + expected_n_impropers = 66 guessed_attrs = ['elements'] + atom_i = 79 + expected_n_zero_bonds = 4 + expected_n_i_bonds = 3 + expected_n_zero_angles = 9 + expected_n_i_angles = 9 + expected_n_zero_dihedrals = 14 + expected_n_i_dihedrals = 15 + expected_n_zero_impropers = 0 + expected_n_i_impropers = 4 + atom_zero_bond_values = ((0, 4), (0, 1), (0, 2), (0, 3)) + atom_i_bond_values = ((79, 80), (79, 83), (77, 79)) + atom_zero_angle_values = ((0, 4, 6), (0, 4, 10), (3, 0, 4), + (2, 0, 3), (2, 0, 4), (1, 0, 2), + (1, 0, 3), (1, 0, 4), (0, 4, 5)) + atom_i_angle_values = ((80, 79, 83), (77, 79, 80), (77, 79, 83), + (74, 77, 79), (79, 80, 81), (79, 80, 82), + (79, 83, 84), (79, 83, 85), (78, 77, 79)) + atom_zero_dihedral_values = ((0, 4, 10, 11), (0, 4, 10, 12), + (3, 0, 4, 5), (3, 0, 4, 6), + (3, 0, 4, 10), (2, 0, 4, 5), + (2, 0, 4, 6), (2, 0, 4, 10), + (1, 0, 4, 5), (1, 0, 4, 6), + (1, 0, 4, 10), (0, 4, 6, 7), + (0, 4, 6, 8), (0, 4, 6, 9)) + atom_i_dihedral_values = ((71, 74, 77, 79), (74, 77, 79, 80), + (74, 77, 79, 83), (75, 74, 77, 79), + (76, 74, 77, 79), (77, 79, 80, 81), + (77, 79, 80, 82), (77, 79, 83, 84), + (77, 79, 83, 85), (78, 77, 79, 80), + (78, 77, 79, 83), (80, 79, 83, 84), + (80, 79, 83, 85), (81, 80, 79, 83), + (82, 80, 79, 83)) + atom_zero_improper_values = () + atom_i_improper_values = ((74, 79, 77, 78), (77, 80, 79, 83), + (79, 81, 80, 82), (79, 84, 83, 85)) class TestPRM12Parser(TOPBase): ref_filename = PRM12 expected_attrs = [ - "names", "types", "type_indices", "charges", "masses", "resnames" + "names", "types", "type_indices", "charges", "masses", "resnames", + "bonds", "angles", "dihedrals", "impropers" ] expected_n_atoms = 8923 expected_n_residues = 2861 + expected_n_bonds = 8947 + expected_n_angles = 756 + expected_n_dihedrals = 1128 + expected_n_impropers = 72 + expected_n_zero_bonds = 1 + expected_n_i_bonds = 4 + expected_n_zero_angles = 1 + expected_n_i_angles = 12 + expected_n_zero_dihedrals = 3 + expected_n_i_dihedrals = 28 + expected_n_zero_impropers = 0 + expected_n_i_impropers = 1 + atom_i = 335 ref_proteinatoms = 0 + atom_zero_bond_values = ((0, 1),) + atom_i_bond_values = ((335, 337), (335, 354), + (334, 335), (335, 336)) + atom_zero_angle_values = ((0, 1, 2),) + atom_i_angle_values = ((337, 335, 354), (335, 337, 338), + (335, 337, 351), (335, 354, 352), + (334, 335, 337), (334, 335, 354), + (332, 334, 335), (336, 335, 337), + (336, 335, 354), (335, 354, 355), + (335, 354, 356), (334, 335, 336)) + atom_zero_dihedral_values = ((0, 1, 2, 3), (0, 1, 2, 4), + (0, 1, 2, 5)) + atom_i_dihedral_values = ((329, 332, 334, 335), (332, 334, 335, 336), + (332, 334, 335, 337), (332, 334, 335, 354), + (332, 352, 354, 335), (333, 332, 334, 335), + (334, 335, 337, 338), (334, 335, 337, 351), + (334, 335, 354, 352), (334, 335, 354, 355), + (334, 335, 354, 356), (335, 334, 332, 352), + (335, 337, 338, 339), (335, 337, 338, 340), + (335, 337, 351, 341), (335, 337, 351, 350), + (335, 354, 352, 353), (335, 354, 352, 357), + (336, 335, 337, 338), (336, 335, 337, 351), + (336, 335, 354, 352), (336, 335, 354, 355), + (336, 335, 354, 356), (337, 335, 354, 352), + (337, 335, 354, 355), (337, 335, 354, 356), + (338, 337, 335, 354), (351, 337, 335, 354)) + atom_zero_improper_values = () + atom_i_improper_values = ((335, 337, 338, 351),) class TestParm7Parser(TOPBase): ref_filename = PRM7 expected_n_atoms = 5827 expected_n_residues = 1882 + expected_n_bonds = 5834 + expected_n_angles = 402 + expected_n_dihedrals = 602 + expected_n_impropers = 55 guessed_attrs = ['elements'] + atom_i = 135 + expected_n_zero_bonds = 4 + expected_n_i_bonds = 4 + expected_n_zero_angles = 9 + expected_n_i_angles = 13 + expected_n_zero_dihedrals = 14 + expected_n_i_dihedrals = 27 + expected_n_zero_impropers = 0 + expected_n_i_impropers = 2 + atom_zero_bond_values = ((0, 4), (0, 1), (0, 2), (0, 3)) + atom_i_bond_values = ((135, 137), (135, 155), (133, 135), + (135, 136)) + atom_zero_angle_values = ((0, 4, 6), (0, 4, 11), (3, 0, 4), + (2, 0, 3), (2, 0, 4), (1, 0, 2), + (1, 0, 3), (1, 0, 4), (0, 4, 5)) + atom_i_angle_values = ((131, 133, 135), (137, 135, 155), + (135, 137, 140), (135, 155, 156), + (135, 155, 157), (133, 135, 137), + (133, 135, 155), (136, 135, 137), + (136, 135, 155), (135, 137, 138), + (135, 137, 139), (134, 133, 135), + (133, 135, 136)) + atom_zero_dihedral_values = ((0, 4, 6, 7), (0, 4, 6, 8), + (0, 4, 6, 9), (0, 4, 11, 12), + (0, 4, 11, 13), (1, 0, 4, 5), + (1, 0, 4, 6), (1, 0, 4, 11), + (2, 0, 4, 5), (2, 0, 4, 6), + (2, 0, 4, 11), (3, 0, 4, 5), + (3, 0, 4, 6), (3, 0, 4, 11)) + atom_i_dihedral_values = ((113, 131, 133, 135), (131, 133, 135, 136), + (131, 133, 135, 137), (131, 133, 135, 155), + (132, 131, 133, 135), (133, 135, 137, 138), + (133, 135, 137, 139), (133, 135, 137, 140), + (133, 135, 155, 156), (133, 135, 155, 157), + (134, 133, 135, 136), (134, 133, 135, 137), + (134, 133, 135, 155), (135, 137, 140, 141), + (135, 137, 140, 154), (135, 155, 157, 158), + (135, 155, 157, 159), (136, 135, 137, 138), + (136, 135, 137, 139), (136, 135, 137, 140), + (136, 135, 155, 156), (136, 135, 155, 157), + (137, 135, 155, 156), (137, 135, 155, 157), + (138, 137, 135, 155), (139, 137, 135, 155), + (140, 137, 135, 155)) + atom_zero_improper_values = () + atom_i_improper_values = ((131, 135, 133, 134), (135, 157, 155, 156)) class TestPRM2(TOPBase): @@ -76,4 +284,79 @@ class TestPRM2(TOPBase): expected_n_atoms = 5071 expected_n_residues = 1686 ref_proteinatoms = 22 + expected_n_bonds = 5070 + expected_n_angles = 36 + expected_n_dihedrals = 41 + expected_n_impropers = 4 guessed_attrs = ['elements'] + atom_i = 14 + expected_n_zero_bonds = 1 + expected_n_i_bonds = 3 + expected_n_zero_angles = 3 + expected_n_i_angles = 8 + expected_n_zero_dihedrals = 2 + expected_n_i_dihedrals = 18 + expected_n_zero_impropers = 0 + expected_n_i_impropers = 2 + atom_zero_bond_values = ((0, 1),) + atom_i_bond_values = ((14, 15), (14, 16), (8, 14)) + atom_zero_angle_values = ((0, 1, 2), (0, 1, 3), (0, 1, 4)) + atom_i_angle_values = ((15, 14, 16), (14, 16, 18), (10, 8, 14), + (8, 14, 15), (8, 14, 16), (6, 8, 14), + (14, 16, 17), (9, 8, 14)) + atom_zero_dihedral_values = ((0, 1, 4, 5), (0, 1, 4, 6)) + atom_i_dihedral_values = ((4, 6, 8, 14), (6, 8, 14, 15), + (6, 8, 14, 16), (7, 6, 8, 14), + (8, 14, 16, 17), (8, 14, 16, 18), + (9, 8, 14, 15), (9, 8, 14, 16), + (10, 8, 14, 15), (10, 8, 14, 16), + (11, 10, 8, 14), (12, 10, 8, 14), + (13, 10, 8, 14), (14, 16, 18, 19), + (14, 16, 18, 20), (14, 16, 18, 21), + (15, 14, 16, 17), (15, 14, 16, 18)) + atom_zero_improper_values = () + atom_i_improper_values = ((8, 16, 14, 15), (14, 18, 16, 17)) + + +class TestPRMNCRST(TOPBase): + # Test case of PARM7 with no non-hydrogen including dihedrals + ref_filename = PRMNCRST + expected_n_atoms = 6 + expected_n_residues = 1 + ref_proteinatoms = 6 + expected_n_bonds = 5 + expected_n_angles = 7 + expected_n_dihedrals = 3 + expected_n_impropers = 0 + atom_i = 4 + expected_n_zero_bonds = 1 + expected_n_i_bonds = 2 + expected_n_zero_angles = 3 + expected_n_i_angles = 4 + expected_n_zero_dihedrals = 1 + expected_n_i_dihedrals = 3 + expected_n_zero_impropers = 0 + expected_n_i_impropers = 0 + atom_zero_bond_values = ((0, 1),) + atom_i_bond_values = ((1, 4), (4, 5)) + atom_zero_angle_values = ((0, 1, 2), (0, 1, 3), (0, 1, 4)) + atom_i_angle_values = ((0, 1, 4), (1, 4, 5), (2, 1, 4), (3, 1, 4)) + atom_zero_dihedral_values = ((0, 1, 4, 5),) + atom_i_dihedral_values = ((0, 1, 4, 5), (2, 1, 4, 5), (3, 1, 4, 5)) + atom_zero_improper_values = () + atom_i_improper_values = () + + +class TestErrors(object): + # Check Errors being raised + def test_versionline(self): + with pytest.raises(ValueError): + u = mda.Universe(PRMErr1) + + def test_title(self): + with pytest.raises(ValueError): + u = mda.Universe(PRMErr2) + + def test_flag(self): + with pytest.raises(IndexError): + u = mda.Universe(PRMErr3) diff --git a/testsuite/MDAnalysisTests/topology/test_tprparser.py b/testsuite/MDAnalysisTests/topology/test_tprparser.py index 500606c3ab2..1d99622a7a2 100644 --- a/testsuite/MDAnalysisTests/topology/test_tprparser.py +++ b/testsuite/MDAnalysisTests/topology/test_tprparser.py @@ -212,3 +212,26 @@ def test_all_impropers(topology, impr): impr_type, elements = impr impr_type_in_topology(impr_type, elements, topology) + + +@pytest.fixture(params=( + TPR400, TPR402, TPR403, TPR404, TPR405, TPR406, TPR407, TPR450, TPR451, + TPR452, TPR453, TPR454, TPR502, TPR504, TPR505, TPR510, TPR2016, TPR2018, +)) +def bonds_water(request): + parser = MDAnalysis.topology.TPRParser.TPRParser(request.param).parse() + # The index of the first water atom is 1960 + first = 1960 + bonds = [ + bond + for bond in parser.bonds.values + if bond[0] >= first and bond[1] >= first + ] + return bonds + + +def test_settle(bonds_water): + # There are 101 water molecule with 2 bonds each + assert len(bonds_water) == 202 + # The last index corresponds to the last water atom + assert bonds_water[-1][1] == 2262 diff --git a/testsuite/MDAnalysisTests/transformations/test_rotate.py b/testsuite/MDAnalysisTests/transformations/test_rotate.py new file mode 100644 index 00000000000..39384712e51 --- /dev/null +++ b/testsuite/MDAnalysisTests/transformations/test_rotate.py @@ -0,0 +1,286 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# + +from __future__ import absolute_import + +import numpy as np +import pytest +from numpy.testing import assert_array_almost_equal + +import MDAnalysis as mda +from MDAnalysis.transformations import rotateby +from MDAnalysis.lib.transformations import rotation_matrix +from MDAnalysisTests import make_Universe + +@pytest.fixture() +def rotate_universes(): + # create the Universe objects for the tests + reference = make_Universe(trajectory=True) + transformed = make_Universe(['masses'], trajectory=True) + transformed.trajectory.ts.dimensions = np.array([372., 373., 374., 90, 90, 90]) + return reference, transformed + + +def test_rotation_matrix(): + # test if the rotation_matrix function is working properly + # simple angle and unit vector on origin + angle = 180 + vector = [0, 0, 1] + pos = [0, 0, 0] + ref_matrix = np.asarray([[-1, 0, 0], + [0, -1, 0], + [0, 0, 1]], np.float64) + matrix = rotation_matrix(np.deg2rad(angle), vector, pos)[:3, :3] + assert_array_almost_equal(matrix, ref_matrix, decimal=6) + # another angle in a custom axis + angle = 60 + vector = [1, 2, 3] + pos = [1, 2, 3] + ref_matrix = np.asarray([[ 0.53571429, -0.6229365 , 0.57005291], + [ 0.76579365, 0.64285714, -0.01716931], + [-0.35576719, 0.44574074, 0.82142857]], np.float64) + matrix = rotation_matrix(np.deg2rad(angle), vector, pos)[:3, :3] + assert_array_almost_equal(matrix, ref_matrix, decimal=6) + +@pytest.mark.parametrize('point', ( + np.asarray([0, 0, 0]), + np.asarray([[0, 0, 0]])) +) +def test_rotateby_custom_point(rotate_universes, point): + # what happens when we use a custom point for the axis of rotation? + ref_u = rotate_universes[0] + trans_u = rotate_universes[1] + trans = trans_u.trajectory.ts + ref = ref_u.trajectory.ts + vector = [1, 0, 0] + pos = point.reshape(3, ) + angle = 90 + matrix = rotation_matrix(np.deg2rad(angle), vector, pos) + ref_u.atoms.transform(matrix) + transformed = rotateby(angle, vector, point=point)(trans) + assert_array_almost_equal(transformed.positions, ref.positions, decimal=6) + + +@pytest.mark.parametrize('vector', ( + np.asarray([1, 0, 0]), + np.asarray([[1, 0, 0]])) +) +def test_rotateby_vector(rotate_universes, vector): + # what happens when we use a custom point for the axis of rotation? + ref_u = rotate_universes[0] + trans_u = rotate_universes[1] + trans = trans_u.trajectory.ts + ref = ref_u.trajectory.ts + point = [0, 0, 0] + angle = 90 + vec = vector.reshape(3, ) + matrix = rotation_matrix(np.deg2rad(angle), vec, point) + ref_u.atoms.transform(matrix) + transformed = rotateby(angle, vector, point=point)(trans) + assert_array_almost_equal(transformed.positions, ref.positions, decimal=6) + + +def test_rotateby_atomgroup_cog_nopbc(rotate_universes): + # what happens when we rotate arround the center of geometry of a residue + # without pbc? + ref_u = rotate_universes[0] + trans_u = rotate_universes[1] + trans = trans_u.trajectory.ts + ref = ref_u.trajectory.ts + center_pos = [6,7,8] + vector = [1,0,0] + angle = 90 + matrix = rotation_matrix(np.deg2rad(angle), vector, center_pos) + ref_u.atoms.transform(matrix) + selection = trans_u.residues[0].atoms + transformed = rotateby(angle, vector, ag=selection, weights=None)(trans) + assert_array_almost_equal(transformed.positions, ref.positions, decimal=6) + + +def test_rotateby_atomgroup_com_nopbc(rotate_universes): + # what happens when we rotate arround the center of mass of a residue + # without pbc? + ref_u = rotate_universes[0] + trans_u = rotate_universes[1] + trans = trans_u.trajectory.ts + ref = ref_u.trajectory.ts + vector = [1,0,0] + angle = 90 + selection = trans_u.residues[0].atoms + center_pos = selection.center_of_mass() + matrix = rotation_matrix(np.deg2rad(angle), vector, center_pos) + ref_u.atoms.transform(matrix) + transformed = rotateby(angle, vector, ag=selection, weights='mass')(trans) + assert_array_almost_equal(transformed.positions, ref.positions, decimal=6) + + +def test_rotateby_atomgroup_cog_pbc(rotate_universes): + # what happens when we rotate arround the center of geometry of a residue + # with pbc? + ref_u = rotate_universes[0] + trans_u = rotate_universes[1] + trans = trans_u.trajectory.ts + ref = ref_u.trajectory.ts + vector = [1,0,0] + angle = 90 + selection = trans_u.residues[0].atoms + center_pos = selection.center_of_geometry(pbc=True) + matrix = rotation_matrix(np.deg2rad(angle), vector, center_pos) + ref_u.atoms.transform(matrix) + transformed = rotateby(angle, vector, ag=selection, weights=None, wrap=True)(trans) + assert_array_almost_equal(transformed.positions, ref.positions, decimal=6) + + +def test_rotateby_atomgroup_com_pbc(rotate_universes): + # what happens when we rotate arround the center of mass of a residue + # with pbc? + ref_u = rotate_universes[0] + trans_u = rotate_universes[1] + trans = trans_u.trajectory.ts + ref = ref_u.trajectory.ts + vector = [1,0,0] + angle = 90 + selection = trans_u.residues[0].atoms + center_pos = selection.center_of_mass(pbc=True) + matrix = rotation_matrix(np.deg2rad(angle), vector, center_pos) + ref_u.atoms.transform(matrix) + transformed = rotateby(angle, vector, ag=selection, weights='mass', wrap=True)(trans) + assert_array_almost_equal(transformed.positions, ref.positions, decimal=6) + + +@pytest.mark.parametrize('ag', ( + [0, 1], + [0, 1, 2, 3, 4], + np.array([0, 1]), + np.array([0, 1, 2, 3, 4]), + np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]), + np.array([[0], [1], [2]]), + 'thisisnotanag', + 1) +) +def test_rotateby_bad_ag(rotate_universes, ag): + # this universe as a box size zero + ts = rotate_universes[0].trajectory.ts + ag = rotate_universes[0].residues[0].atoms + # what happens if something other than an AtomGroup is given? + angle = 90 + vector = [0, 0, 1] + bad_ag = 1 + with pytest.raises(ValueError): + rotateby(angle, vector, ag = bad_ag)(ts) + + +@pytest.mark.parametrize('point', ( + [0, 1], + [0, 1, 2, 3, 4], + np.array([0, 1]), + np.array([0, 1, 2, 3, 4]), + np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]), + np.array([[0], [1], [2]]), + 'thisisnotapoint', + 1) +) +def test_rotateby_bad_point(rotate_universes, point): + # this universe as a box size zero + ts = rotate_universes[0].trajectory.ts + # what if the box is in the wrong format? + angle = 90 + vector = [0, 0, 1] + bad_position = point + with pytest.raises(ValueError): + rotateby(angle, vector, point=bad_position)(ts) + + +@pytest.mark.parametrize('direction', ( + [0, 1], + [0, 1, 2, 3, 4], + np.array([0, 1]), + np.array([0, 1, 2, 3, 4]), + np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]), + np.array([[0], [1], [2]]), + 'thisisnotadirection', + 1) +) +def test_rotateby_bad_direction(rotate_universes, direction): + # this universe as a box size zero + ts = rotate_universes[0].trajectory.ts + # what if the box is in the wrong format? + angle = 90 + point = [0, 0, 0] + with pytest.raises(ValueError): + rotateby(angle, direction, point=point)(ts) + + +def test_rotateby_bad_pbc(rotate_universes): + # this universe as a box size zero + ts = rotate_universes[0].trajectory.ts + ag = rotate_universes[0].residues[0].atoms + # is pbc passed to the center methods? + # if yes it should raise an exception for boxes that are zero in size + vector = [1, 0, 0] + angle = 90 + with pytest.raises(ValueError): + rotateby(angle, vector, ag = ag, wrap=True)(ts) + + +@pytest.mark.parametrize('weights', ( + " ", + "totallynotmasses", + 123456789, + [0, 1, 2, 3, 4], + np.array([0, 1]), + np.array([0, 1, 2, 3, 4]), + np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])) +) +def test_rotateby_bad_weights(rotate_universes, weights): + # this universe as a box size zero + ts = rotate_universes[0].trajectory.ts + ag = rotate_universes[0].residues[0].atoms + # what if a wrong center type name is passed? + angle = 90 + vector = [0, 0, 1] + bad_weights = " " + with pytest.raises(TypeError): + rotateby(angle, vector, ag = ag, weights=bad_weights)(ts) + + +def test_rotateby_no_masses(rotate_universes): + # this universe as a box size zero + ts = rotate_universes[0].trajectory.ts + ag = rotate_universes[0].residues[0].atoms + # if the universe has no masses and `mass` is passed as the center arg + angle = 90 + vector = [0, 0, 1] + bad_center = "mass" + with pytest.raises(TypeError): + rotateby(angle, vector, ag = ag, weights=bad_center)(ts) + + +def test_rotateby_no_args(rotate_universes): + # this universe as a box size zero + ts = rotate_universes[0].trajectory.ts + angle = 90 + vector = [0, 0, 1] + # if no point or AtomGroup are passed to the function + # it should raise a ValueError + with pytest.raises(ValueError): + rotateby(angle, vector)(ts) \ No newline at end of file diff --git a/testsuite/MDAnalysisTests/transformations/test_translate.py b/testsuite/MDAnalysisTests/transformations/test_translate.py new file mode 100644 index 00000000000..6ae8b8a39e4 --- /dev/null +++ b/testsuite/MDAnalysisTests/transformations/test_translate.py @@ -0,0 +1,210 @@ +#-*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# + +from __future__ import absolute_import + +import numpy as np +import pytest +from numpy.testing import assert_array_almost_equal + +import MDAnalysis as mda +from MDAnalysis.transformations import translate, center_in_box +from MDAnalysisTests import make_Universe + + +@pytest.fixture() +def translate_universes(): + # create the Universe objects for the tests + # this universe has no masses and some tests need it as such + reference = make_Universe(trajectory=True) + transformed = make_Universe(['masses'], trajectory=True) + transformed.trajectory.ts.dimensions = np.array([372., 373., 374., 90, 90, 90]) + + return reference, transformed + + +def test_translate_coords(translate_universes): + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + vector = np.float32([1, 2, 3]) + ref.positions += vector + trans = translate(vector)(trans_u.trajectory.ts) + assert_array_almost_equal(trans.positions, ref.positions, decimal=6) + + +@pytest.mark.parametrize('vector', ( + [0, 1], + [0, 1, 2, 3, 4], + np.array([0, 1]), + np.array([0, 1, 2, 3, 4]), + np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]), + np.array([[0], [1], [2]])) +) +def test_translate_vector(translate_universes, vector): + # what happens if the vector argument is of wrong size? + ts = translate_universes[0].trajectory.ts + with pytest.raises(ValueError): + translate(vector)(ts) + + +def test_translate_transformations_api(translate_universes): + # test if the translate transformation works when using the + # on-the-fly transformations API + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + vector = np.float32([1, 2, 3]) + ref.positions += vector + trans_u.trajectory.add_transformations(translate(vector)) + assert_array_almost_equal(trans_u.trajectory.ts.positions, ref.positions, decimal=6) + + +def test_center_in_box_bad_ag(translate_universes): + # this universe has a box size zero + ts = translate_universes[0].trajectory.ts + # what happens if something other than an AtomGroup is given? + bad_ag = 1 + with pytest.raises(ValueError): + center_in_box(bad_ag)(ts) + + +@pytest.mark.parametrize('point', ( + [0, 1], + [0, 1, 2, 3, 4], + np.array([0, 1]), + np.array([0, 1, 2, 3, 4]), + np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]), + np.array([[0], [1], [2]])) +) +def test_center_in_box_bad_point(translate_universes, point): + ts = translate_universes[0].trajectory.ts + ag = translate_universes[0].residues[0].atoms + # what if the box is in the wrong format? + with pytest.raises(ValueError): + center_in_box(ag, point=point)(ts) + + +def test_center_in_box_bad_pbc(translate_universes): + # this universe has a box size zero + ts = translate_universes[0].trajectory.ts + ag = translate_universes[0].residues[0].atoms + # is pbc passed to the center methods? + # if yes it should raise an exception for boxes that are zero in size + with pytest.raises(ValueError): + center_in_box(ag, wrap=True)(ts) + + +def test_center_in_box_bad_center(translate_universes): + # this universe has a box size zero + ts = translate_universes[0].trajectory.ts + ag = translate_universes[0].residues[0].atoms + # what if a wrong center type name is passed? + bad_center = " " + with pytest.raises(ValueError): + center_in_box(ag, center=bad_center)(ts) + + +def test_center_in_box_no_masses(translate_universes): + # this universe has no masses + ts = translate_universes[0].trajectory.ts + ag = translate_universes[0].residues[0].atoms + # if the universe has no masses and `mass` is passed as the center arg + bad_center = "mass" + with pytest.raises(AttributeError): + center_in_box(ag, center=bad_center)(ts) + + +def test_center_in_box_coords_no_options(translate_universes): + # what happens when we center the coordinates arround the center of geometry of a residue? + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + ref_center = np.float32([6, 7, 8]) + box_center = np.float32([186., 186.5, 187.]) + ref.positions += box_center - ref_center + ag = trans_u.residues[0].atoms + trans = center_in_box(ag)(trans_u.trajectory.ts) + assert_array_almost_equal(trans.positions, ref.positions, decimal=6) + + +def test_center_in_box_coords_with_pbc(translate_universes): + # what happens when we center the coordinates arround the center of geometry of a residue? + # using pbc into account for center of geometry calculation + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + trans_u.dimensions = [363., 364., 365., 90., 90., 90.] + ag = trans_u.residues[24].atoms + box_center = np.float32([181.5, 182., 182.5]) + ref_center = np.float32([75.6, 75.8, 76.]) + ref.positions += box_center - ref_center + trans = center_in_box(ag, wrap=True)(trans_u.trajectory.ts) + assert_array_almost_equal(trans.positions, ref.positions, decimal=6) + + +def test_center_in_box_coords_with_mass(translate_universes): + # using masses for calculating the center of the atomgroup + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + ag = trans_u.residues[24].atoms + box_center = np.float32([186., 186.5, 187.]) + ref_center = ag.center_of_mass() + ref.positions += box_center - ref_center + trans = center_in_box(ag, center="mass")(trans_u.trajectory.ts) + assert_array_almost_equal(trans.positions, ref.positions, decimal=6) + + +def test_center_in_box_coords_with_box(translate_universes): + # using masses for calculating the center of the atomgroup + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + ag = trans_u.residues[0].atoms + newpoint = [1000, 1000, 1000] + box_center = np.float32(newpoint) + ref_center = np.float32([6, 7, 8]) + ref.positions += box_center - ref_center + trans = center_in_box(ag, point=newpoint)(trans_u.trajectory.ts) + assert_array_almost_equal(trans.positions, ref.positions, decimal=6) + + +def test_center_in_box_coords_all_options(translate_universes): + # what happens when we center the coordinates arround the center of geometry of a residue? + # using pbc into account for center of geometry calculation + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + ag = trans_u.residues[24].atoms + newpoint = [1000, 1000, 1000] + box_center = np.float32(newpoint) + ref_center = ag.center_of_mass(pbc=True) + ref.positions += box_center - ref_center + trans = center_in_box(ag, center='mass', wrap=True, point=newpoint)(trans_u.trajectory.ts) + assert_array_almost_equal(trans.positions, ref.positions, decimal=6) + + +def test_center_transformations_api(translate_universes): + # test if the translate transformation works when using the + # on-the-fly transformations API + ref_u, trans_u = translate_universes + ref = ref_u.trajectory.ts + ref_center = np.float32([6, 7, 8]) + box_center = np.float32([186., 186.5, 187.]) + ref.positions += box_center - ref_center + ag = trans_u.residues[0].atoms + trans_u.trajectory.add_transformations(center_in_box(ag)) + assert_array_almost_equal(trans_u.trajectory.ts.positions, ref.positions, decimal=6) diff --git a/testsuite/MDAnalysisTests/util.py b/testsuite/MDAnalysisTests/util.py index 136103b64f8..db30a962a31 100644 --- a/testsuite/MDAnalysisTests/util.py +++ b/testsuite/MDAnalysisTests/util.py @@ -40,6 +40,7 @@ import mock import os import warnings +import pytest from numpy.testing import assert_warns @@ -169,6 +170,18 @@ def assert_nowarns(warning_class, *args, **kwargs): raise AssertionError("function {0} raises warning of class {1}".format( func.__name__, warning_class.__name__)) + +@contextmanager +def no_warning(warning_class): + """contextmanager to check that no warning was raised""" + with warnings.catch_warnings(record=True) as record: + warnings.simplefilter('always') + yield + if len(record) != 0: + raise AssertionError("Raised warning of class {}".format( + warning_class.__name__)) + + class _NoDeprecatedCallContext(object): # modified version of similar pytest class object that checks for # raised DeprecationWarning diff --git a/testsuite/MDAnalysisTests/utils/test_datafiles.py b/testsuite/MDAnalysisTests/utils/test_datafiles.py index 946db49c64a..945b4157c15 100644 --- a/testsuite/MDAnalysisTests/utils/test_datafiles.py +++ b/testsuite/MDAnalysisTests/utils/test_datafiles.py @@ -22,7 +22,7 @@ from __future__ import absolute_import import pytest -from numpy.testing import assert_array_equal +from numpy.testing import assert_equal def test_import(): @@ -37,7 +37,7 @@ def test_all_exports(): missing = [name for name in dir(MDAnalysisTests.datafiles) if not name.startswith('_') and name not in MDAnalysisTests.datafiles.__all__ and name != 'absolute_import'] - assert_array_equal(missing, [], err_msg="Variables need to be added to __all__.") + assert_equal(missing, [], err_msg="Variables need to be added to __all__.") def test_export_variables(): @@ -45,4 +45,4 @@ def test_export_variables(): import MDAnalysis.tests.datafiles missing = [name for name in MDAnalysisTests.datafiles.__all__ if name not in dir(MDAnalysis.tests.datafiles)] - assert_array_equal(missing, [], err_msg="Variables not exported to MDAnalysis.tests.datafiles") + assert_equal(missing, [], err_msg="Variables not exported to MDAnalysis.tests.datafiles") diff --git a/testsuite/MDAnalysisTests/utils/test_distances.py b/testsuite/MDAnalysisTests/utils/test_distances.py deleted file mode 100644 index 5b29ca9b554..00000000000 --- a/testsuite/MDAnalysisTests/utils/test_distances.py +++ /dev/null @@ -1,765 +0,0 @@ -# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- -# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 -# -# MDAnalysis --- https://www.mdanalysis.org -# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors -# (see the file AUTHORS for the full list of names) -# -# Released under the GNU Public Licence, v2 or any higher version -# -# Please cite your use of MDAnalysis in published work: -# -# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, -# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. -# MDAnalysis: A Python package for the rapid analysis of molecular dynamics -# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th -# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. -# -# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. -# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. -# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 -# -from __future__ import division, absolute_import -import MDAnalysis -import MDAnalysis.lib.distances - -import numpy as np -import pytest -from numpy.testing import assert_almost_equal, assert_equal - -from MDAnalysis.tests.datafiles import PSF, DCD, TRIC -from MDAnalysis.lib import mdamath - - -@pytest.fixture() -def ref_system(): - box = np.array([1., 1., 2.], dtype=np.float32) - points = np.array( - [ - [0, 0, 0], [1, 1, 2], [1, 0, 2], # identical under PBC - [0.5, 0.5, 1.5], - ], dtype=np.float32) - ref = points[0:1] - conf = points[1:] - - return box, points, ref, conf - - -@pytest.mark.parametrize('backend', ['serial', 'openmp']) -class TestDistanceArray(object): - @staticmethod - def _dist(x, ref): - ref = np.asarray(ref, dtype=np.float32) - r = x - ref - return np.sqrt(np.dot(r, r)) - - def test_noPBC(self, backend, ref_system): - box, points, ref, conf = ref_system - - d = MDAnalysis.lib.distances.distance_array(ref, points, backend=backend) - - assert_almost_equal(d, np.array([[ - self._dist(points[0], ref[0]), - self._dist(points[1], ref[0]), - self._dist(points[2], ref[0]), - self._dist(points[3], ref[0])] - ])) - - def test_PBC(self, backend, ref_system): - box, points, ref, conf = ref_system - - d = MDAnalysis.lib.distances.distance_array(ref, points, box=box, backend=backend) - - assert_almost_equal(d, np.array([[0., 0., 0., self._dist(points[3], ref=[1, 1, 2])]])) - - def test_PBC2(self, backend): - a = np.array([7.90146923, -13.72858524, 3.75326586], dtype=np.float32) - b = np.array([-1.36250901, 13.45423985, -0.36317623], dtype=np.float32) - box = np.array([5.5457325, 5.5457325, 5.5457325], dtype=np.float32) - - def mindist(a, b, box): - x = a - b - return np.linalg.norm(x - np.rint(x / box) * box) - - ref = mindist(a, b, box) - val = MDAnalysis.lib.distances.distance_array(np.array([a]), np.array([b]), - box=box, backend=backend)[0, 0] - - assert_almost_equal(val, ref, decimal=6, - err_msg="Issue 151 not correct (PBC in distance array)") - -@pytest.fixture() -def DCD_Universe(): - universe = MDAnalysis.Universe(PSF, DCD) - trajectory = universe.trajectory - - return universe, trajectory - -@pytest.mark.parametrize('backend', ['serial', 'openmp']) -class TestDistanceArrayDCD(object): - # reasonable precision so that tests succeed on 32 and 64 bit machines - # (the reference values were obtained on 64 bit) - # Example: - # Items are not equal: wrong maximum distance value - # ACTUAL: 52.470254967456412 - # DESIRED: 52.470257062419059 - prec = 5 - - def test_simple(self, DCD_Universe, backend): - U, trajectory = DCD_Universe - trajectory.rewind() - x0 = U.atoms.positions - trajectory[10] - x1 = U.atoms.positions - d = MDAnalysis.lib.distances.distance_array(x0, x1, backend=backend) - assert_equal(d.shape, (3341, 3341), "wrong shape (should be (Natoms,Natoms))") - assert_almost_equal(d.min(), 0.11981228170520701, self.prec, - err_msg="wrong minimum distance value") - assert_almost_equal(d.max(), 53.572192429459619, self.prec, - err_msg="wrong maximum distance value") - - def test_outarray(self, DCD_Universe, backend): - U, trajectory = DCD_Universe - trajectory.rewind() - x0 = U.atoms.positions - trajectory[10] - x1 = U.atoms.positions - natoms = len(U.atoms) - d = np.zeros((natoms, natoms), np.float64) - MDAnalysis.lib.distances.distance_array(x0, x1, result=d, backend=backend) - assert_equal(d.shape, (natoms, natoms), "wrong shape, shoud be (Natoms,Natoms) entries") - assert_almost_equal(d.min(), 0.11981228170520701, self.prec, - err_msg="wrong minimum distance value") - assert_almost_equal(d.max(), 53.572192429459619, self.prec, - err_msg="wrong maximum distance value") - - def test_periodic(self, DCD_Universe, backend): - # boring with the current dcd as that has no PBC - U, trajectory = DCD_Universe - trajectory.rewind() - x0 = U.atoms.positions - trajectory[10] - x1 = U.atoms.positions - d = MDAnalysis.lib.distances.distance_array(x0, x1, box=U.coord.dimensions, - backend=backend) - assert_equal(d.shape, (3341, 3341), "should be square matrix with Natoms entries") - assert_almost_equal(d.min(), 0.11981228170520701, self.prec, - err_msg="wrong minimum distance value with PBC") - assert_almost_equal(d.max(), 53.572192429459619, self.prec, - err_msg="wrong maximum distance value with PBC") - - - -@pytest.mark.parametrize('backend', ['serial', 'openmp']) -class TestSelfDistanceArrayDCD(object): - prec = 5 - - def test_simple(self, DCD_Universe, backend): - U, trajectory = DCD_Universe - trajectory.rewind() - x0 = U.atoms.positions - d = MDAnalysis.lib.distances.self_distance_array(x0, backend=backend) - N = 3341 * (3341 - 1) / 2 - assert_equal(d.shape, (N,), "wrong shape (should be (Natoms*(Natoms-1)/2,))") - assert_almost_equal(d.min(), 0.92905562402529318, self.prec, - err_msg="wrong minimum distance value") - assert_almost_equal(d.max(), 52.4702570624190590, self.prec, - err_msg="wrong maximum distance value") - - def test_outarray(self, DCD_Universe, backend): - U, trajectory = DCD_Universe - trajectory.rewind() - x0 = U.atoms.positions - natoms = len(U.atoms) - N = natoms * (natoms - 1) // 2 - d = np.zeros((N,), np.float64) - MDAnalysis.lib.distances.self_distance_array(x0, result=d, backend=backend) - assert_equal(d.shape, (N,), "wrong shape (should be (Natoms*(Natoms-1)/2,))") - assert_almost_equal(d.min(), 0.92905562402529318, self.prec, - err_msg="wrong minimum distance value") - assert_almost_equal(d.max(), 52.4702570624190590, self.prec, - err_msg="wrong maximum distance value") - - def test_periodic(self, DCD_Universe, backend): - # boring with the current dcd as that has no PBC - U, trajectory = DCD_Universe - trajectory.rewind() - x0 = U.atoms.positions - natoms = len(U.atoms) - N = natoms * (natoms - 1) / 2 - d = MDAnalysis.lib.distances.self_distance_array(x0, box=U.coord.dimensions, - backend=backend) - assert_equal(d.shape, (N,), "wrong shape (should be (Natoms*(Natoms-1)/2,))") - assert_almost_equal(d.min(), 0.92905562402529318, self.prec, - err_msg="wrong minimum distance value with PBC") - assert_almost_equal(d.max(), 52.4702570624190590, self.prec, - err_msg="wrong maximum distance value with PBC") - - -@pytest.mark.parametrize('backend', ['serial', 'openmp']) -class TestTriclinicDistances(object): - """Unit tests for the Triclinic PBC functions. - Tests: - # transforming to and from S space (fractional coords) - mda.lib.distances.transform_StoR - mda.lib.distances.transform_RtoS - # distance calculations with PBC - mda.lib.distances.self_distance_array - mda.lib.distances.distance_array - """ - - prec = 2 - - @staticmethod - @pytest.fixture() - def TRIC(): - return MDAnalysis.Universe(TRIC) - - @staticmethod - @pytest.fixture() - def box(TRIC): - return MDAnalysis.coordinates.core.triclinic_vectors(TRIC.dimensions) - - @staticmethod - @pytest.fixture() - def boxV(box): - return MDAnalysis.coordinates.core.triclinic_box(box[0], box[1], box[2]) - - @staticmethod - @pytest.fixture() - def S_mol(TRIC): - S_mol1 = np.array([TRIC.atoms[383].position]) - S_mol2 = np.array([TRIC.atoms[390].position]) - - return S_mol1, S_mol2 - - def test_transforms(self, S_mol, box, boxV, backend): - from MDAnalysis.lib.distances import transform_StoR, transform_RtoS - # To check the cython coordinate transform, the same operation is done in numpy - # Is a matrix multiplication of Coords x Box = NewCoords, so can use np.dot - S_mol1, S_mol2 = S_mol - # Test transformation - R_mol1 = transform_StoR(S_mol1, box, backend=backend) - R_np1 = np.dot(S_mol1, box) - - # Test transformation when given box in different form - R_mol2 = transform_StoR(S_mol2, boxV, backend=backend) - R_np2 = np.dot(S_mol2, box) - - assert_almost_equal(R_mol1, R_np1, self.prec, err_msg="StoR transform failed with box") - assert_almost_equal(R_mol2, R_np2, self.prec, err_msg="StoR transform failed with boxV") - - # Round trip test - # boxV here althought initial transform with box - S_test1 = transform_RtoS(R_mol1, boxV, backend=backend) - # and vice versa, should still work - S_test2 = transform_RtoS(R_mol2, box, backend=backend) - - assert_almost_equal(S_test1, S_mol1, self.prec, err_msg="Round trip failed in transform") - assert_almost_equal(S_test2, S_mol2, self.prec, err_msg="Round trip failed in transform") - - def test_selfdist(self, S_mol, box, boxV, backend): - from MDAnalysis.lib.distances import self_distance_array - from MDAnalysis.lib.distances import transform_StoR - - S_mol1, S_mol2 = S_mol - - R_coords = transform_StoR(S_mol1, box, backend=backend) - # Transform functions are tested elsewhere so taken as working here - dists = self_distance_array(R_coords, box=box, backend=backend) - # Manually calculate self_distance_array - manual = np.zeros(len(dists), dtype=np.float64) - distpos = 0 - for i, Ri in enumerate(R_coords): - for Rj in R_coords[i + 1:]: - Rij = Rj - Ri - Rij -= round(Rij[2] / box[2][2]) * box[2] - Rij -= round(Rij[1] / box[1][1]) * box[1] - Rij -= round(Rij[0] / box[0][0]) * box[0] - Rij = np.linalg.norm(Rij) # find norm of Rij vector - manual[distpos] = Rij # and done, phew - distpos += 1 - - assert_almost_equal(dists, manual, self.prec, - err_msg="self_distance_array failed with input 1") - - # Do it again for input 2 (has wider separation in points) - # Also use boxV here in self_dist calculation - R_coords = transform_StoR(S_mol2, box, backend=backend) - # Transform functions are tested elsewhere so taken as working here - dists = self_distance_array(R_coords, box=boxV, backend=backend) - # Manually calculate self_distance_array - manual = np.zeros(len(dists), dtype=np.float64) - distpos = 0 - for i, Ri in enumerate(R_coords): - for Rj in R_coords[i + 1:]: - Rij = Rj - Ri - Rij -= round(Rij[2] / box[2][2]) * box[2] - Rij -= round(Rij[1] / box[1][1]) * box[1] - Rij -= round(Rij[0] / box[0][0]) * box[0] - Rij = np.linalg.norm(Rij) # find norm of Rij vector - manual[distpos] = Rij # and done, phew - distpos += 1 - - assert_almost_equal(dists, manual, self.prec, - err_msg="self_distance_array failed with input 2") - - def test_distarray(self, S_mol, box, boxV, backend): - from MDAnalysis.lib.distances import distance_array - from MDAnalysis.lib.distances import transform_StoR - - S_mol1, S_mol2 = S_mol - - R_mol1 = transform_StoR(S_mol1, box, backend=backend) - R_mol2 = transform_StoR(S_mol2, box, backend=backend) - - # Try with box - dists = distance_array(R_mol1, R_mol2, box=box, backend=backend) - # Manually calculate distance_array - manual = np.zeros((len(R_mol1), len(R_mol2))) - for i, Ri in enumerate(R_mol1): - for j, Rj in enumerate(R_mol2): - Rij = Rj - Ri - Rij -= round(Rij[2] / box[2][2]) * box[2] - Rij -= round(Rij[1] / box[1][1]) * box[1] - Rij -= round(Rij[0] / box[0][0]) * box[0] - Rij = np.linalg.norm(Rij) # find norm of Rij vector - manual[i][j] = Rij - - assert_almost_equal(dists, manual, self.prec, - err_msg="distance_array failed with box") - - # Now check using boxV - dists = distance_array(R_mol1, R_mol2, box=boxV, backend=backend) - assert_almost_equal(dists, manual, self.prec, - err_msg="distance_array failed with boxV") - - def test_pbc_dist(self, S_mol, boxV, backend): - from MDAnalysis.lib.distances import distance_array - S_mol1, S_mol2 = S_mol - - results = np.array([[37.629944]]) - dists = distance_array(S_mol1, S_mol2, box=boxV, - backend=backend) - - assert_almost_equal(dists, results, self.prec, - err_msg="distance_array failed to retrieve PBC distance") - - def test_pbc_wrong_wassenaar_distance(self, backend): - from MDAnalysis.lib.distances import distance_array - box = MDAnalysis.lib.mdamath.triclinic_vectors([2, 2, 2, 60, 60, 60]) - a, b, c = box - point_a = a + b - point_b = .5 * point_a - dist = distance_array(point_a[np.newaxis, :], point_b[np.newaxis, :], - box=box, backend=backend) - assert_almost_equal(dist[0, 0], 1) - # check that our distance is different then the wassenaar distance as - # expected. - assert np.linalg.norm(point_a - point_b) != dist[0, 0] - - - -@pytest.mark.parametrize('backend', ['serial', 'openmp']) -class TestCythonFunctions(object): - # Unit tests for calc_bonds calc_angles and calc_dihedrals in lib.distances - # Tests both numerical results as well as input types as Cython will silently - # produce nonsensical results if given wrong data types otherwise. - prec = 5 - - @staticmethod - @pytest.fixture() - def box(): - return np.array([10., 10., 10.], dtype=np.float32) - - @staticmethod - @pytest.fixture() - def triclinic_box(): - return np.array([[10., 0., 0.], [1., 10., 0., ], [1., 0., 10.]], dtype=np.float32) - - @staticmethod - @pytest.fixture() - def positions(): - # dummy atom data - - a = np.array([[0., 0., 0.], [0., 0., 0.], [0., 11., 0.], [1., 1., 1.]], dtype=np.float32) - b = np.array([[0., 0., 0.], [1., 1., 1.], [0., 0., 0.], [29., -21., 99.]], dtype=np.float32) - c = np.array([[0., 0., 0.], [2., 2., 2.], [11., 0., 0.], [1., 9., 9.]], dtype=np.float32) - d = np.array([[0., 0., 0.], [3., 3., 3.], [11., -11., 0.], [65., -65., 65.]], dtype=np.float32) - return a, b, c, d - - @staticmethod - @pytest.fixture() - def wrongtype(): - # declared as float64 and should raise TypeError - return np.array([[0., 0., 0.], [3., 3., 3.], [3., 3., 3.], [3., 3., 3.]], - dtype=np.float64) - - @staticmethod - @pytest.fixture() - def wronglength(): - # has a different length to other inputs and should raise ValueError - return np.array([[0., 0., 0.], [3., 3., 3.]], - dtype=np.float32) - - def test_bonds(self, positions, box, backend): - a, b, c, d = positions - dists = MDAnalysis.lib.distances.calc_bonds(a, b, - backend=backend) - assert_equal(len(dists), 4, err_msg="calc_bonds results have wrong length") - dists_pbc = MDAnalysis.lib.distances.calc_bonds(a, b, box=box, - backend=backend) - #tests 0 length - assert_almost_equal(dists[0], 0.0, self.prec, err_msg="Zero length calc_bonds fail") - assert_almost_equal(dists[1], 1.7320508075688772, self.prec, - err_msg="Standard length calc_bonds fail") # arbitrary length check - # PBC checks, 2 without, 2 with - assert_almost_equal(dists[2], 11.0, self.prec, - err_msg="PBC check #1 w/o box") # pbc check 1, subtract single box length - assert_almost_equal(dists_pbc[2], 1.0, self.prec, - err_msg="PBC check #1 with box") - assert_almost_equal(dists[3], 104.26888318, self.prec, # pbc check 2, subtract multiple box - err_msg="PBC check #2 w/o box") # lengths in all directions - assert_almost_equal(dists_pbc[3], 3.46410072, self.prec, - err_msg="PBC check #w with box") - - #Bad input checking - def test_bonds_wrongtype(self, positions, wrongtype, wronglength, backend): - a, b, c, d = positions - - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_bonds(a, wrongtype, backend=backend) - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_bonds(wrongtype, b, backend=backend) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_bonds(a, wronglength, backend=backend) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_bonds(wronglength, b, backend= - backend) - - - def test_bonds_badbox(self, positions, backend): - a, b, c, d = positions - badboxtype = np.array([10., 10., 10.], dtype=np.float64) - badboxsize = np.array([[10., 10.], [10., 10., ]], dtype=np.float32) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_bonds(a, - b, box=badboxsize, - backend=backend) # Bad box data - - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_bonds(a, - b, box=badboxtype, - backend=backend) # Bad box type - - def test_bonds_badresult(self, positions, backend): - a, b, c, d = positions - badresult = np.zeros(len(a) - 1) - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_bonds( - a, b, result=badresult, backend=backend) # Bad result array - - def test_bonds_triclinic(self, positions, triclinic_box, backend): - a, b, c, d = positions - dists = MDAnalysis.lib.distances.calc_bonds(a, b, - box=triclinic_box, backend=backend) - reference = np.array([0.0, 1.7320508, 1.4142136, 2.82842712]) - assert_almost_equal(dists, reference, self.prec, err_msg="calc_bonds with triclinic box failed") - - def test_angles(self, positions, backend): - a, b, c, d = positions - angles = MDAnalysis.lib.distances.calc_angles(a, b, c, - backend=backend) - # Check calculated values - assert_equal(len(angles), 4, err_msg="calc_angles results have wrong length") - # assert_almost_equal(angles[0], 0.0, self.prec, - # err_msg="Zero length angle calculation failed") # What should this be? - assert_almost_equal(angles[1], np.pi, self.prec, - err_msg="180 degree angle calculation failed") - assert_almost_equal(np.rad2deg(angles[2]), 90., self.prec, - err_msg="Ninety degree angle in calc_angles failed") - assert_almost_equal(angles[3], 0.098174833, self.prec, - err_msg="Small angle failed in calc_angles") - - # Check data type checks - def test_angles_wrongtype(self, positions, wrongtype, wronglength, backend): - a, b, c, d = positions - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_angles( - a, wrongtype, c, backend=backend) - - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_angles() - wrongtype, b, c, backend = backend - - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_angles( - a, b, wrongtype, backend=backend) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_angles( - a, wronglength, c, - backend=backend) # try inputting arrays of different length - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_angles( - wronglength, b, c, - backend=backend) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_angles( - a, b, wronglength, - backend=backend) - - def test_angles_bad_result(self, positions, backend): - a, b, c, d = positions - badresult = np.zeros(len(a) - 1) - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_angles( - a, b, c, result=badresult, backend=backend) # Bad result array - - def test_dihedrals(self, positions, backend): - a, b, c, d = positions - dihedrals = MDAnalysis.lib.distances.calc_dihedrals(a, b, - c, d, - backend=backend) - # Check calculated values - assert_equal(len(dihedrals), 4, err_msg="calc_dihedrals results have wrong length") - assert np.isnan(dihedrals[0]), "Zero length dihedral failed" - assert np.isnan(dihedrals[1]), "Straight line dihedral failed" - assert_almost_equal(dihedrals[2], np.pi, self.prec, err_msg="180 degree dihedral failed") - assert_almost_equal(dihedrals[3], -0.50714064, self.prec, - err_msg="arbitrary dihedral angle failed") - - # Check data type checks - def test_dihedrals_wrongtype(self, positions, wrongtype, backend): - a, b, c, d = positions - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_dihedrals( - a, wrongtype, c, d, - backend=backend) # try inputting float64 values - - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_dihedrals( - wrongtype, b, c, d, - backend=backend) - - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_dihedrals( - a, b, wrongtype, d, - backend=backend) - - with pytest.raises(TypeError): - MDAnalysis.lib.distances.calc_dihedrals( - a, b, c, wrongtype, - backend=backend) - - def test_dihedrals_wronglength(self, positions, wronglength, backend): - a, b, c, d = positions - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_dihedrals( - a, wronglength, c, d, - backend=backend) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_dihedrals( - wronglength, b, c, d, - backend=backend) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_dihedrals( - a, b, wronglength, d, - backend=backend) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_dihedrals( - a, b, c, wronglength, - backend=backend) - - def test_dihedrals_bad_result(self, positions, backend): - a, b, c, d = positions - badresult = np.zeros(len(a) - 1) - - with pytest.raises(ValueError): - MDAnalysis.lib.distances.calc_dihedrals( - a, b, c, d, result=badresult, - backend=backend) # Bad result array - - - - def test_numpy_compliance(self, positions, backend): - a, b, c, d = positions - # Checks that the cython functions give identical results to the numpy versions - bonds = MDAnalysis.lib.distances.calc_bonds(a, b, - backend=backend) - angles = MDAnalysis.lib.distances.calc_angles(a, b, c, - backend=backend) - dihedrals = MDAnalysis.lib.distances.calc_dihedrals(a, b, - c, d, - backend=backend) - - bonds_numpy = np.array([mdamath.norm(y - x) for x, y in zip(a, b)]) - vec1 = a - b - vec2 = c - b - angles_numpy = np.array([mdamath.angle(x, y) for x, y in zip(vec1, vec2)]) - ab = a - b - bc = b - c - cd = c - d - dihedrals_numpy = np.array([mdamath.dihedral(x, y, z) for x, y, z in zip(ab, bc, cd)]) - - assert_almost_equal(bonds, bonds_numpy, self.prec, - err_msg="Cython bonds didn't match numpy calculations") - # numpy 0 angle returns NaN rather than 0 - assert_almost_equal(angles[1:], angles_numpy[1:], self.prec, - err_msg="Cython angles didn't match numpy calcuations") - assert_almost_equal(dihedrals, dihedrals_numpy, self.prec, - err_msg="Cython dihedrals didn't match numpy calculations") - - -@pytest.mark.parametrize('backend', ['serial', 'openmp']) -class Test_apply_PBC(object): - prec = 6 - - def test_ortho_PBC(self, backend): - from MDAnalysis.lib.distances import apply_PBC - - U = MDAnalysis.Universe(PSF, DCD) - atoms = U.atoms.positions - box1 = np.array([2.5, 2.5, 3.5], dtype=np.float32) - box2 = np.array([2.5, 2.5, 3.5, 90., 90., 90.], dtype=np.float32) - - cyth1 = apply_PBC(atoms, box1, backend=backend) - cyth2 = apply_PBC(atoms, box2, backend=backend) - reference = atoms - np.floor(atoms / box1) * box1 - - assert_almost_equal(cyth1, reference, self.prec, - err_msg="Ortho apply_PBC #1 failed comparison with np") - assert_almost_equal(cyth2, reference, self.prec, - err_msg="Ortho apply_PBC #2 failed comparison with np") - - def test_tric_PBC(self, backend): - from MDAnalysis.lib.distances import apply_PBC - - U = MDAnalysis.Universe(TRIC) - atoms = U.atoms.positions - box1 = U.dimensions - box2 = MDAnalysis.coordinates.core.triclinic_vectors(box1) - - def numpy_PBC(coords, box): - # move to fractional coordinates - fractional = MDAnalysis.lib.distances.transform_RtoS(coords, box) - # move fractional coordinates to central cell - fractional -= np.floor(fractional) - # move back to real coordinates - return MDAnalysis.lib.distances.transform_StoR(fractional, box) - - cyth1 = apply_PBC(atoms, box1, backend=backend) - cyth2 = apply_PBC(atoms, box2, backend=backend) - reference = numpy_PBC(atoms, box2) - - assert_almost_equal(cyth1, reference, decimal=4, - err_msg="Triclinic apply_PBC failed comparison with np") - assert_almost_equal(cyth2, reference, decimal=4, - err_msg="Triclinic apply_PBC failed comparison with np") - - box = np.array([10, 7, 3, 45, 60, 90], dtype=np.float32) - r = np.array([[5.75, 0.36066014, 0.75]], dtype=np.float32) - r_in_cell = MDAnalysis.lib.distances.apply_PBC(r, box)[0] - assert_almost_equal([5.75, 7.3606596, 0.75], - r_in_cell, self.prec) - -@pytest.mark.parametrize('backend', ['serial', 'openmp']) -class TestPeriodicAngles(object): - """Test case for properly considering minimum image convention when calculating angles and dihedrals - (Issue 172) - """ - @staticmethod - @pytest.fixture() - def positions(): - a = np.array([[0.0, 1.0, 0.0]], dtype=np.float32) - b = np.array([[0.0, 0.0, 0.0]], dtype=np.float32) - c = np.array([[1.0, 0.0, 0.0]], dtype=np.float32) - d = np.array([[1.0, 0.0, 1.0]], dtype=np.float32) - box = np.array([10.0, 10.0, 10.0], dtype=np.float32) - return a, b, c, d, box - - prec = 5 - - def test_angles(self, positions, backend): - from MDAnalysis.lib.distances import calc_angles - # Shift atom coordinates a few box lengths in random directions and see if we still get same results - a, b, c, d, box = positions - a2 = (a + box * (-1, 0, 0)).astype(np.float32) # seem to get converted to float64 otherwise - b2 = (b + box * (1, 0, 1)).astype(np.float32) - c2 = (c + box * (-2, 5, -7)).astype(np.float32) - - ref = calc_angles(a, b, c, backend=backend) - - test1 = calc_angles(a2, b, c, box=box, backend=backend) - test2 = calc_angles(a, b2, c, box=box, backend=backend) - test3 = calc_angles(a, b, c2, box=box, backend=backend) - test4 = calc_angles(a2, b2, c2, box=box, backend=backend) - - for val in [test1, test2, test3, test4]: - assert_almost_equal(ref, val, self.prec, err_msg="Min image in angle calculation failed") - - def test_dihedrals(self, positions, backend): - from MDAnalysis.lib.distances import calc_dihedrals - a, b, c, d, box = positions - a2 = (a + box * (-1, 0, 0)).astype(np.float32) - b2 = (b + box * (1, 0, 1)).astype(np.float32) - c2 = (c + box * (-2, 5, -7)).astype(np.float32) - d2 = (d + box * (0, -5, 0)).astype(np.float32) - - ref = calc_dihedrals(a, b, c, d, backend=backend) - - test1 = calc_dihedrals(a2, b, c, d, box=box, - backend=backend) - test2 = calc_dihedrals(a, b2, c, d, box=box, - backend=backend) - test3 = calc_dihedrals(a, b, c2, d, box=box, - backend=backend) - test4 = calc_dihedrals(a, b, c, d2, box=box, - backend=backend) - test5 = calc_dihedrals(a2, b2, c2, d2, box=box, - backend=backend) - - for val in [test1, test2, test3, test4, test5]: - assert_almost_equal(ref, val, self.prec, err_msg="Min image in dihedral calculation failed") - - -class TestDistanceBackendSelection(object): - @staticmethod - @pytest.fixture() - def backend_selection_pos(): - positions = np.random.rand(10, 3) - N = positions.shape[0] - result = np.empty(N * (N - 1) // 2, dtype=np.float64) - - return positions, result - - @pytest.mark.parametrize('backend', [ - "serial", "Serial", "SeRiAL", "SERIAL", - "openmp", "OpenMP", "oPENmP", "OPENMP", - ]) - def test_case_insensitivity(self, backend, backend_selection_pos): - positions, result = backend_selection_pos - try: - MDAnalysis.lib.distances._run("calc_self_distance_array", - args=(positions, result), - backend=backend) - except RuntimeError: - pytest.fail("Failed to understand backend {0}".format(backend)) - - def test_wront_backend(self, backend_selection_pos): - positions, result = backend_selection_pos - with pytest.raises(ValueError): - MDAnalysis.lib.distances._run("calc_self_distance_array", - args=(positions, result), - backend="not implemented stuff") - -def test_used_openmpflag(): - assert isinstance(MDAnalysis.lib.distances.USED_OPENMP, bool) diff --git a/testsuite/MDAnalysisTests/utils/test_duecredit.py b/testsuite/MDAnalysisTests/utils/test_duecredit.py new file mode 100644 index 00000000000..ca5ccfd207a --- /dev/null +++ b/testsuite/MDAnalysisTests/utils/test_duecredit.py @@ -0,0 +1,96 @@ +# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 +# +# MDAnalysis --- https://www.mdanalysis.org +# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors +# (see the file AUTHORS for the full list of names) +# +# Released under the GNU Public Licence, v2 or any higher version +# +# Please cite your use of MDAnalysis in published work: +# +# R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, +# D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. +# MDAnalysis: A Python package for the rapid analysis of molecular dynamics +# simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th +# Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. +# +# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. +# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. +# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 +# +from __future__ import absolute_import +import os +import pytest + +import importlib + +# environment variable DUECREDIT_ENABLE is set to yes in MDAnalysisTests/__init__.py +# (if set to 'no', the tests will be SKIPPED; has to be yes, true, or 1 for duecredit +# to work; duecredit must also be installed) +import MDAnalysis as mda +from MDAnalysisTests.datafiles import MMTF + +# duecredit itself is not needed in the name space but this is a +# convenient way to skip all tests if duecredit is not installed +# (see https://github.com/MDAnalysis/mdanalysis/issues/1906) +pytest.importorskip('duecredit') + +@pytest.mark.skipif((os.environ.get('DUECREDIT_ENABLE', 'yes').lower() + in ('no', '0', 'false')), + reason= + "duecredit is explicitly disabled with DUECREDIT_ENABLE=no") +class TestDuecredit(object): + + def test_duecredit_active(self): + assert mda.due.active == True + + @pytest.mark.parametrize("module,path,citekey", [ + ("MDAnalysis", "MDAnalysis", "gowers2016"), + ("MDAnalysis", "MDAnalysis", "10.1002/jcc.21787"), + ]) + def test_duecredit_collector_primary(self, module, path, citekey): + assert mda.due.citations[(path, citekey)].cites_module == True + + # note: citekeys are *all lower case* + @pytest.mark.parametrize("module,path,citekey", [ + ("MDAnalysis.analysis.psa", + "MDAnalysis.analysis.psa", + "10.1371/journal.pcbi.1004568"), + ("MDAnalysis.analysis.hbonds.hbond_autocorrel", + "MDAnalysis.analysis.hbonds.hbond_autocorrel", + "10.1063/1.4922445"), + ("MDAnalysis.analysis.leaflet", + "MDAnalysis.analysis.leaflet", + "10.1002/jcc.21787"), + ("MDAnalysis.analysis.hole", + "MDAnalysis.analysis.hole", + "10.1016/s0006-3495(93)81293-1"), + ("MDAnalysis.analysis.hole", + "MDAnalysis.analysis.hole", + "10.1016/s0263-7855(97)00009-x"), + ("MDAnalysis.analysis.hole", + "MDAnalysis.analysis.hole", + "10.1016/j.jmb.2013.10.024"), + ("MDAnalysis.lib.qcprot", + "MDAnalysis.lib.qcprot", + "10.1107/s0108767305015266"), + ("MDAnalysis.lib.qcprot", + "MDAnalysis.lib.qcprot", + "qcprot2"), + ("MDAnalysis.analysis.encore", + "MDAnalysis.analysis.encore", + "10.1371/journal.pcbi.1004415"), + ]) + def test_duecredit_collector_analysis_modules(self, module, path, citekey): + importlib.import_module(module) + assert mda.due.citations[(path, citekey)].cites_module == True + + def test_duecredit_mmtf(self): + # doesn't trigger on import but on use of either parser or reader + u = mda.Universe(MMTF) + + assert mda.due.citations[('MDAnalysis.coordinates.MMTF', + '10.1371/journal.pcbi.1005575')].cites_module + assert mda.due.citations[('MDAnalysis.topology.MMTFParser', + '10.1371/journal.pcbi.1005575')].cites_module diff --git a/testsuite/MDAnalysisTests/utils/test_log.py b/testsuite/MDAnalysisTests/utils/test_log.py index 48b8b58d276..70f7200b3f0 100644 --- a/testsuite/MDAnalysisTests/utils/test_log.py +++ b/testsuite/MDAnalysisTests/utils/test_log.py @@ -29,7 +29,6 @@ import MDAnalysis import MDAnalysis.lib.log import pytest -from MDAnalysis.lib.log import _set_verbose def test_start_stop_logging(): @@ -143,44 +142,3 @@ def test_not_dynamic_ProgressMeter(buffer, step, percentage, n=51, interval=10): buffer.seek(0) output = "".join(buffer.readlines()) _assert_in(output, (template + '\n').format(**{'step': step, 'numsteps': n, 'percentage': percentage})) - - -class TestSetVerbose(object): - - @pytest.mark.parametrize('verbose, quiet, default, result', [ - (True, False, True, True), # Everything agrees verbose should be True - (False, True, False, False),# Everything agrees verbose should be False - (True, False, False, True), # Make sure the default does not overwrite the user choice - (False, True, True, False), # Make sure the default does not overwrite the user choice - (None, True, False, False), # Verbose is not provided - (None, False, False, True), # Verbose is not provided - ]) - def test__set_verbose_deprecated(self, verbose, quiet, default, result): - with pytest.deprecated_call(): - assert _set_verbose(verbose=verbose, quiet=quiet, default=default) == result - - @pytest.mark.parametrize('verbose, quiet, default, result', [ - (True, None, False, True), # Quiet is not provided - (False, None, False, False),# Quiet is not provided - (None, None, True, True), # Nothing is provided - (None, None, False, False), # Nothing is provided - ]) - def test__set_verbose(self, verbose, quiet, default, result): - assert _set_verbose(verbose=verbose, quiet=quiet, default=default) == result - - @pytest.mark.parametrize('verbose', (True, False)) - def test__set_verbose_invalid_args(self, verbose): - # can't combine the two context managers - with pytest.deprecated_call(): - with pytest.raises(ValueError): - # setting quiet==verbose is a contradiction - _set_verbose(verbose=verbose, quiet=verbose, default=None) - - - @pytest.mark.parametrize('verbose, quiet', [ - (None, True), - (False, True) - ]) - def test_warnings__set_verbose(self, verbose, quiet): - pytest.deprecated_call(_set_verbose, verbose=verbose, quiet=quiet) - diff --git a/testsuite/MDAnalysisTests/utils/test_modelling.py b/testsuite/MDAnalysisTests/utils/test_modelling.py index 376e1baa473..5dcdd2bcfca 100644 --- a/testsuite/MDAnalysisTests/utils/test_modelling.py +++ b/testsuite/MDAnalysisTests/utils/test_modelling.py @@ -21,6 +21,7 @@ # from __future__ import absolute_import, print_function +import os import MDAnalysis import pytest from MDAnalysis.tests.datafiles import ( @@ -140,6 +141,9 @@ def u_water(): class TestMerge(object): + @pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Setup fixtures fail on Windows.") def test_merge(self, u_protein, u_ligand, u_water, tmpdir): ids_before = [a.index for u in [u_protein, u_ligand, u_water] for a in u.atoms] # Do the merge @@ -178,17 +182,26 @@ def test_merge(self, u_protein, u_ligand, u_water, tmpdir): ids_new2 = [a.index for a in u.atoms] assert_equal(ids_new, ids_new2) + @pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Setup fixtures fail on Windows.") def test_merge_same_universe(self, u_protein): u0 = MDAnalysis.Merge(u_protein.atoms, u_protein.atoms, u_protein.atoms) assert_equal(len(u0.atoms), 3 * len(u_protein.atoms)) assert_equal(len(u0.residues), 3 * len(u_protein.residues)) assert_equal(len(u0.segments), 3 * len(u_protein.segments)) + @pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Setup fixtures fail on Windows.") def test_residue_references(self, u_protein, u_ligand): m = Merge(u_protein.atoms, u_ligand.atoms) assert_equal(m.atoms.residues[0].universe, m, "wrong universe reference for residues after Merge()") + @pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Setup fixtures fail on Windows.") def test_segment_references(self, u_protein, u_ligand): m = Merge(u_protein.atoms, u_ligand.atoms) assert_equal(m.atoms.segments[0].universe, m, @@ -202,6 +215,9 @@ def test_nonsense_TypeError(self): with pytest.raises(TypeError): Merge(['1', 2]) + @pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Setup fixtures fail on Windows.") def test_emptyAG_ValueError(self, u_protein): a = AtomGroup([], u_protein) b = AtomGroup([], u_protein) @@ -235,6 +251,9 @@ def test_merge_with_topology(self, u): # One of these bonds isn't in the merged Universe assert(len(ag2[0].bonds) - 1 == len(u_merge.atoms[20].bonds)) + @pytest.mark.xfail(os.name == 'nt', + strict=True, + reason="Setup fixtures fail on Windows.") def test_merge_with_topology_from_different_universes(self, u, u_ligand): u_merge = MDAnalysis.Merge(u.atoms[:110], u_ligand.atoms) diff --git a/testsuite/MDAnalysisTests/utils/test_qcprot.py b/testsuite/MDAnalysisTests/utils/test_qcprot.py index 83f7a32a8d4..fbf928ea874 100644 --- a/testsuite/MDAnalysisTests/utils/test_qcprot.py +++ b/testsuite/MDAnalysisTests/utils/test_qcprot.py @@ -171,4 +171,3 @@ def test_weights(): assert_almost_equal(p, 32.798779202159416) q = np.array([0.99861395, .022982, .04735006, -.02409085, .99944556, .022982, -.04679564, -.02409085, .99861395]) np.testing.assert_almost_equal(q, o) - diff --git a/testsuite/MDAnalysisTests/utils/test_streamio.py b/testsuite/MDAnalysisTests/utils/test_streamio.py index 2b510aeda8e..0668a60e6ba 100644 --- a/testsuite/MDAnalysisTests/utils/test_streamio.py +++ b/testsuite/MDAnalysisTests/utils/test_streamio.py @@ -168,7 +168,7 @@ def test_matryoshka(self): class TestNamedStream_filename_behavior(object): - textname = "~/stories/jabberwock.txt" # with tilde ~ to test regular expanduser() + textname = os.path.join("~", "stories", "jabberwock.txt") # with tilde ~ to test regular expanduser() # note: no setUp() because classes with generators would run it # *for each generated test* and we need it for the generator method diff --git a/testsuite/MDAnalysisTests/visualization/test_streamlines.py b/testsuite/MDAnalysisTests/visualization/test_streamlines.py index c600c43b76d..ab5bf8f8fee 100644 --- a/testsuite/MDAnalysisTests/visualization/test_streamlines.py +++ b/testsuite/MDAnalysisTests/visualization/test_streamlines.py @@ -19,7 +19,7 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -from __future__ import absolute_import, print_function +from __future__ import absolute_import, print_function, division import numpy as np from numpy.testing import assert_almost_equal import MDAnalysis diff --git a/testsuite/README b/testsuite/README index e334fa381cb..d1c116b7163 100644 --- a/testsuite/README +++ b/testsuite/README @@ -1,39 +1,57 @@ -============================= - MDAnalysisTests README -============================= +=================== + MDAnalysisTests +=================== -MDAnalysis is a Python toolkit to analyze molecular dynamics +|build| |cov| |devdocs| |developergroup| + +MDAnalysis_ is a Python toolkit to analyze molecular dynamics trajectories generated by CHARMM, Amber, NAMD, LAMMPS, or Gromacs. .. NOTE:: *This* package only contains the UnitTests and the data - files that are used in the test suite of the MDAnalysis + files that are used in the test suite of the MDAnalysis_ package https://www.mdanalysis.org. They should be - installed together with MDAnalysis. - - You can get MDAnalysis from https://www.mdanalysis.org - + installed together with MDAnalysis_. The test files change less frequently, take up around 70 MB of space, and are not needed for daily use of MDAnalysis so they are distributed separately from the main package. For installation instruction please have a look at INSTALL and the -instructions online at http://wiki.mdanalysis.org/INSTALL +instructions online at https://github.com/MDAnalysis/mdanalysis/wiki/INSTALL -The tests are described at http://wiki.mdanalysis.org/UnitTests +The tests are described at https://github.com/MDAnalysis/mdanalysis/wiki/UnitTests -For further information please see the documentation for MDAnalysis +For further information please see the `documentation for MDAnalysis`_ itself. Contact ======= -Please report bugs and feature requests through the Issue Tracker at +Please report bugs and feature requests through the `Issue Tracker`_. + +Help is also available through the mailing list at https://groups.google.com/group/mdnalysis-discussion + +.. Links +.. _MDAnalysis: https://www.mdanalysis.org +.. _Issue Tracker: https://github.com/mdanalysis/mdanalysis/issues +.. _`documentation for MDAnalysis`: https://www.mdanalysis.org/docs/ - http://issues.mdanalysis.org -Help is also available through the mailing list +.. badges + +.. |build| image:: https://travis-ci.org/MDAnalysis/mdanalysis.svg?branch=develop + :alt: Build Status + :target: https://travis-ci.org/MDAnalysis/mdanalysis - http://groups.google.com/group/mdnalysis-discussion +.. |cov| image:: https://codecov.io/gh/MDAnalysis/mdanalysis/branch/develop/graph/badge.svg + :alt: Coverage Status + :target: https://codecov.io/gh/MDAnalysis/mdanalysis +.. |devdocs| image:: https://img.shields.io/badge/docs-development-yellow.svg + :alt: Documentation (development version) + :target: https://www.mdanalysis.org/mdanalysis/ + +.. |developergroup| image:: https://img.shields.io/badge/Google%20Group-Developers-lightgrey.svg + :alt: Developer Google Group + :target: http://developers.mdanalysis.org diff --git a/testsuite/setup.py b/testsuite/setup.py index c2ba93dc943..14a594c4626 100755 --- a/testsuite/setup.py +++ b/testsuite/setup.py @@ -65,7 +65,7 @@ def dynamic_author_list(): # authors". We first want move the cursor down to the title of # interest. for line_no, line in enumerate(infile, start=1): - if line[:-1] == "Chronological list of authors": + if line.rstrip() == "Chronological list of authors": break else: # If we did not break, it means we did not find the authors. @@ -132,28 +132,26 @@ def dynamic_author_list(): warnings.warn('Cannot write the list of authors.') # this must be in-sync with MDAnalysis - RELEASE = "0.18.0" + RELEASE = "0.19.0" + with open("README") as summary: + LONG_DESCRIPTION = summary.read() - LONG_DESCRIPTION = \ - """MDAnalysis is a tool for analyzing molecular dynamics trajectories. - -This package (MDAnalysisTests) contains the test code and the trajectory data -that are used for the test cases. In order to make downloads and binary package -maintenance more efficient, these tests were moved into this package. - -For details see the report for `Issue 87`_. - -.. _`Issue 87`: https://github.com/MDAnalysis/mdanalysis/issues/87 -""" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: GNU General Public License (GPL)', + 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', 'Operating System :: POSIX', 'Operating System :: MacOS :: MacOS X', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: C', + 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Bio-Informatics', 'Topic :: Scientific/Engineering :: Chemistry', 'Topic :: Software Development :: Libraries :: Python Modules', @@ -161,14 +159,24 @@ def dynamic_author_list(): setup(name='MDAnalysisTests', version=RELEASE, - description='MDAnalysis http://mdanalysis.org testsuite', + description='MDAnalysis testsuite', + long_description=LONG_DESCRIPTION, + long_description_content_type='text/x-rst', author='Naveen Michaud-Agrawal', author_email='naveen.michaudagrawal@gmail.com', maintainer='Richard Gowers', maintainer_email='mdnalysis-discussion@googlegroups.com', url='https://www.mdanalysis.org', download_url='https://github.com/MDAnalysis/mdanalysis/releases', + project_urls={'Documentation': 'https://github.com/MDAnalysis/mdanalysis/wiki/UnitTests', + 'CI Tests': 'https://travis-ci.org/MDAnalysis/mdanalysis', + 'CI Coverage': 'https://codecov.io/gh/MDAnalysis/mdanalysis', + 'Developer Group': 'https://groups.google.com/forum/#!forum/mdnalysis-devel', + 'Issue Tracker': 'https://github.com/mdanalysis/mdanalysis/issues', + 'Source': 'https://github.com/mdanalysis/mdanalysis', + }, license='GPL 2', + classifiers=CLASSIFIERS, packages=find_packages(), package_dir={'MDAnalysisTests': 'MDAnalysisTests', 'MDAnalysisTests.plugins': 'MDAnalysisTests/plugins'}, @@ -196,10 +204,7 @@ def dynamic_author_list(): 'data/mol2/*.mol2', 'data/contacts/*.gro.bz2', 'data/contacts/*.dat', 'data/capping/*.gro', 'data/capping/*.pdb', - 'data/lammps/*.data', 'data/lammps/*.data.bz2', - 'data/lammps/*.data2', - 'data/lammps/*.dcd', 'data/lammps/*.trz', - 'data/lammps/*.inp', + 'data/lammps/*', 'data/gms/*.xyz', 'data/gms/*.gms', 'data/gms/*.gms.gz', 'data/*.inpcrd', @@ -208,12 +213,11 @@ def dynamic_author_list(): 'data/*.xml', 'data/coordinates/*', 'data/*xvg', - 'data/*.mmtf', 'data/*.mmtf.gz', 'data/analysis/*', + 'data/*.mmtf', 'data/*.mmtf.gz', + 'data/analysis/*', 'data/*.gsd', ], }, - classifiers=CLASSIFIERS, - long_description=LONG_DESCRIPTION, install_requires=[ 'MDAnalysis=={0!s}'.format(RELEASE), # same as this release! 'pytest>=3.1.2',